Control: reassign -1 src:sdl12-compat 1.2.64-5 Control: affects -1 src:libsdl-perl Control: forwarded -1 https://github.com/libsdl-org/sdl12-compat/issues/305
On Mon, 17 Jul 2023 at 10:35:14 +0100, Simon McVittie wrote: > I can reproduce a use-after-free on amd64. The test doesn't crash on amd64 > for whatever reason, but it's visible when using valgrind, or when > recompiling sdl12-compat and libsdl2 with -fsanitize=address. > > I think this is probably the same root cause as the crash on 32-bit > architectures, it's just less fatal on 64-bit for whatever reason. > An easy reproducer is to run `perl ./t/core_video.t` from the libsdl-perl > source tree: it is not necessary to recompile it. I was able to reduce the Perl test to a small C reproducer, which I've sent upstream to sdl12-compat (see URL above). As far as I can tell, it's most likely to be a sdl12-compat bug, but I don't understand the memory management for these surfaces well enough to fix it. A brute-force workaround would be to intentionally leak every surface object that was previously the video surface, by adding a flag that would make SDL_FreeSurface ignore it, but I hope upstream will be able to suggest something less bad than that. smcv