Open larpon opened 5 months ago
For me, on Ubuntu 20.04 and SDL 2.0.10, the example above compiles and runs cleanly, but v run ~/.vmodules/sdl/examples/tvintris/
exhibits a probably similar crash.
With v -d sdl_memory_no_gc run ~/.vmodules/sdl/examples/tvintris/
everything works without a crash.
On Arch, with sdl2-2.30.3, it crashes for both the example in the issue, and with tvintris reliably.
In some cases, with some versions of SDL2, on some different distributions and platforms SDL2 crashes at runtime if applications are built using V's default garbage collector.
Currently, especially the
tVintris
example is known to cause different kind of crashes on different systems.A, relatively simple, example MRE that crashes on my system (EndeavourOS, rolling, Arch based SDL v2.30.3
vlang/sdl
branch2.30.0
):We have introduced the compiletime flag:
-d sdl_memory_no_gc
to mitigate the problem. Usage of this flag also means that the user will have to manage SDL's memory manually by utilizing SDL2'sdestroy
/sdl.free/1
functions.The output when crashing is often similar to this: