-
Notifications
You must be signed in to change notification settings - Fork 49
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
The game crashes when taking a screenshot #723
Comments
Is there something odd going on with this "free()" function?
No. free() is a C stdlib function and perfectly well implemented.
There likely is a double free happening somehow, i.e. TSC is freeing
memory that has already been freed earlier by TSC code.
Please provide a gdb stack trace so we can see where exactly in the
code things go wrong.
-quintus
|
Sorry, I'm still very new to this stuff. How do I do a "gdb stack trace"? |
Compile TSC in debug mode ( Then run TSC like this:
You can end the debugging session with The stacktrace contains the complete stack of function invocations that lead to the crash, starting from You can also edit
to
in order to achieve that. GDB is incredibly useful for debugging problems like this. It’s worth to learn it. Full docs: https://sourceware.org/gdb/current/onlinedocs/gdb.html/
|
It only got worse. The game froze when I took the screenshot and I was not able to move my mouse or alt+f4 to get out of it. I had to kill the process using the task manager and the terminal (I was lucky, because I had to access those programs using my keyboard only). I ran the program using GDB and it gave me more information, but only at the beginning. When the game crashed, it gave me the exact same error and nothing more. However, the message changed a little bit when I tried this error again yesterday. It say "double free or corruption (!frev)", so your hypothesis might be right. I'm trying to see what's going on in |
It only got worse. The game froze when I took the screenshot and I was not able to move my mouse or alt+f4 to get out of it. I had to kill the process using the task manager and the terminal. I ran the program using GDB and it gave me more information, but only at the beginning. When the game crashed, it gave me the exact same error and nothing more. However, the message change a little bit when I tried this error again yesterday. It say "double free or corruption (!frev)", so your hypothesis might be right.
Of course it freezes. The moment it would crash gdb kicks in and
freezes the processes. From that point on you need to interact with
gdb. That is, you need to move the frozen game window away and work
with gdb instead; the game is frozen exactly on the function which
crashes.
In other words, if you run the game through gdb, the window won’t
dissappear in the crash moment, instead the game will freeze. This is
because gdb is used to inspect everything exactly as it is in the
crash moment.
As a consequence, running the game through gdb works best if you play
it in windowed mode rather than fullscreen mode.
Sorry for not clarifying that. I have worked so often and much with
gdb that I simply forget about these trivialities. I basically never
run TSC in fullscreen mode exactly because of this.
-quintus
|
If you say so, then the situation might be even worse than I though, and that's because I found out that the only way for me to reproduce the crash is to go in fullscreen mode with the highest resolution available for my computer (other resolutions don't crash the game, not even in fullscreen), which is a resolution of 1366x768. I tried to reproduce the crash in a lot of resolutions (including the highest one) while in windowed mode with no success, because the screenshot function actually works and doesn't crash the game in that mode. |
My operating system is Linux Mint 22.1 Xia, and when I try to take a screenshot, the game crashes with the following two lines of error:
free(): invalid next size (normal)
./run-tsc.sh: line 7: 13093 Aborted (core dumped) ./bin/tsc
Is there something odd going on with this "free()" function?
The text was updated successfully, but these errors were encountered: