This topic has been written about several times (over the course of more than a decade), but I have yet to see any resolutions.
I am playing ToME 2.3.5 as found in the Software Manager of Linux Mint 17.2 "Rafaela." However, whenever I try to save, I crash to desktop. Anyone else have this problem and/or know how to fix it?
ToME 2.3.5 - Crash on Save/Load
Moderator: Moderator
-
- Uruivellas
- Posts: 718
- Joined: Tue Dec 13, 2005 12:35 am
Re: ToME 2.3.5 - Crash on Save/Load
My recommendation is to install cmake, git, build-essential, and xorg-dev, and then check out v.2.3.9-ah
and compile
Alternatively, if you want to stick with 2.3.5, you could install gdb and try to pinpoint the issue.
And then when you get a crash
will get you a stack trace, showing which function it crashed in.
Good luck!
P.S. I bet this is Ubuntu's buffer overflow detection.
Edit: actually let me try to reproduce this...
Code: Select all
git clone -b v2.3.9-ah https://gitlab.com/tome2/tome2.git
Code: Select all
cd tome2
cmake .
nice make
Code: Select all
gdb /usr/bin/tome2
run -mx11
Code: Select all
bt
Good luck!
P.S. I bet this is Ubuntu's buffer overflow detection.
Edit: actually let me try to reproduce this...
-
- Uruivellas
- Posts: 718
- Joined: Tue Dec 13, 2005 12:35 am
Re: ToME 2.3.5 - Crash on Save/Load
Yeah, this is Ubuntu's buffer overflow detection killing the program. You'll have to either upgrade to the tome2-ah versions, or fix the bug and recompile. Let me see if I can figure out where it's bugging out exactly.
-
- Uruivellas
- Posts: 718
- Joined: Tue Dec 13, 2005 12:35 am
Re: ToME 2.3.5 - Crash on Save/Load
So, this is a bad strcpy call in do_subrace() in loadsave.c, line 240. I'm guessing the target buffer is too small, thus the buffer overflow detection.
-
- Uruivellas
- Posts: 718
- Joined: Tue Dec 13, 2005 12:35 am
Re: ToME 2.3.5 - Crash on Save/Load
@Gloomshrou
The issue appears to be that the buffer is one character too short. do_string() applies a terminating NUL past the end of the buffer, which is caught by buffer overflow protection and crashes the program. Changing
to have
instead, fixes the crash... at least for now.
(But frankly I'm very distrustful of that I/O code in loadsave.c, and think you should upgrade to 2.3.9-ah anyway.
)
The issue appears to be that the buffer is one character too short. do_string() applies a terminating NUL past the end of the buffer, which is caught by buffer overflow protection and crashes the program. Changing
Code: Select all
static void do_subrace(int flag)
{
player_race_mod *sr_ptr = &race_mod_info[SUBRACE_SAVE];
int i;
char buf[81];
...
Code: Select all
char buf[82];
(But frankly I'm very distrustful of that I/O code in loadsave.c, and think you should upgrade to 2.3.9-ah anyway.
