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
Memory corruption when playing at 1440p #181
Comments
Did some additional testing on another machine, this one has an intel cpu and intel graphics card - running the same OS, but using Mesa for opengl. Bug manifests in same way - bad write in I did manage to crash the game when interacting with a pattern buffer. Another occasion the lua script that draws the UI appeared to crash, with the UI disappearing, but the game continuing ( More backtraces here. They look remarkably identical, so I didn't include any codeblocks here. |
Great info! Looks like |
This quick and dirty patch appears to have fix the issue by bumping the |
Probably the ‘right’ fix would be to not have a hard limit, and instead alloc world_pixels_structure based on whatever the actual screen resolution is. The work there will be handling resolution changes, and re-initializing world_pixels_structure. A simpler option might be to just prevent the user from selecting a resolution higher than the max. I’m also not seeing anything that uses MAXIMUM_WORLD_WIDTH, so at least there is no horizontal limit. |
Looks perfect! I did testing of the commit and was unable to trigger the bug. Valgrind is also happy. Thanks for the responsive discussion and fix =) |
When playing alephone at 1440p exiting the game back to desktop usually results in a segfault. Running alephone in valgrind shows invalid writes in
precalculate_bitmap_row_addresses
that causes valgrind to crash due to heap corruption. Outside of valgrind, memory corruption does not become apparent until I exit the game, with a segfault happening during glibc'sfree()
finding broken invariants. All the text snippets below are in this gist, along with additional information.None of these problems have occurred for me playing at 1080p and lower resolutions.
I had noticed significant visual corruption during a previous session; unfortunately I had not captured images of that situation. I'll report back if I manage to create more visual artifacts.
In most cases after playing at 1440p, I get a crash on exit due to glibc's free() catching memory corruption:
Crash backtrace (occurs while exiting alephone) (
backtrace full
available here)Valgrind trace of the offending bad write. More traces details here:
The text was updated successfully, but these errors were encountered: