Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LÖVE memory corruption upon loading state #620

Open
qixils opened this issue Oct 1, 2024 · 0 comments
Open

LÖVE memory corruption upon loading state #620

qixils opened this issue Oct 1, 2024 · 0 comments

Comments

@qixils
Copy link
Contributor

qixils commented Oct 1, 2024

Loading savestates during a LÖVE game now causes memory corruption. As tested on Mari0, this can include entities suddenly falling through floors, text corrupting, or most likely, the game crashing (sometimes the engine safely crashes, sometimes it segfaults).

Affected Versions

This has been tested on WSL2 and confirmed on Ubuntu 18.04, 20.04, and 22.04. It has occurred on versions as recently as 95b4426. The issue is quite hard to bisect, as depending on your exact system version and config, some old libTAS versions may fail to build, or may experience odd performance issues. I suspect the "broken" versions may even work on some system setups, as I have definitely used the newer variable framerate features without memory corruption before. However, my bisecting has seemed to suggest an origin in the development process of v1.4.2. I performed a bisect in March of this year, and again just now, on two different WSL installs, and got the same result:

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
47b5406
fd9d655
c22d42e
We cannot bisect more!

These versions were skipped due to failures to compile.

Interestingly these older versions exhibit an inability to prevent writing files to disk, though this may be unrelated.

Affected Options

This issue occurs regardless of Recycle Threads and any other savestate-related setting.

Stacktrace

I'm unsure of how useful a stacktrace would really be here but I have fetched one from one of the segfaults:

Thread 1 "love" received signal SIGSEGV, Segmentation fault.
0x00007ffff7af9e3b in ?? () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
(gdb) bt
#0  0x00007ffff7af9e3b in ?? () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
#1  0x00005555554010b5 in ?? ()
#2  0x00007ffff7200d90 in __libc_start_call_main (main=main@entry=0x555555400e40, argc=argc@entry=2,
    argv=argv@entry=0x7fffffffd498) at ../sysdeps/nptl/libc_start_call_main.h:58
#3  0x00007ffff7200e40 in __libc_start_main_impl (main=0x555555400e40, argc=2, argv=0x7fffffffd498,
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd488)
    at ../csu/libc-start.c:392
#4  0x00005555554012fa in ?? ()

Steps to reproduce

Install LÖVE and download mari0

sudo add-apt-repository ppa:bartbes/love-stable
sudo apt update
sudo apt install love
clone https://github.com/Stabyourself/mari0

Run libTAS with game executable /usr/bin/love and command-line options ~/mari0

Create a savestate a few frames into loading, on the title screen, in the game etc. and then load them a couple times until issues occur. The issues are most noticeable when going between different game states; loading a state of the title screen while on the title screen is generally safe, for instance, while loading a state of the title screen while in a level is likely to cause a crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant