[Fixed] Crash after fatal error

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Crash after fatal error

Postby Marisa Kirisame » Sun Jul 25, 2021 2:01 pm

This is something that's pretty much been happening since I can remember. Definitely a Linux-only issue since it seems to be linked to SDL. Whenever a "fatal error" dialog pops up (e.g.: for an error in a script file), and this dialog is dismissed, rather than exiting cleanly, gzdoom immediately segfaults. This crash seems to be in I_ShutdownInput(). I'll provide a detailed backtrace once I get a debug build done.

Edit: The troublemaker here is a call to SDL_JoystickClose in src/common/platform/posix/sdl/i_joystick.cpp line 62. My best guess is that it's trying to close a device that wasn't even opened yet.
Code: Select allExpand view
#0  0x00007ffff73f7d22 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff73e1862 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff7439d28 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007ffff744192a in  () at /usr/lib/libc.so.6
#4  0x00007ffff7443408 in _int_free () at /usr/lib/libc.so.6
#5  0x00007ffff74469e8 in free () at /usr/lib/libc.so.6
#6  0x00007ffff7e845cf in  () at /usr/lib/libSDL2-2.0.so.0
#7  0x00007ffff7ee2136 in  () at /usr/lib/libSDL2-2.0.so.0
#8  0x00005555559f15c9 in SDLInputJoystick::~SDLInputJoystick() (this=0x5555572defd0, __in_chrg=<optimized out>) at /media/Data/Development/active/gzdoom/src/common/platform/posix/sdl/i_joystick.cpp:62
#9  0x00005555559f1600 in SDLInputJoystick::~SDLInputJoystick() (this=0x5555572defd0, __in_chrg=<optimized out>) at /media/Data/Development/active/gzdoom/src/common/platform/posix/sdl/i_joystick.cpp:63
#10 0x00005555559f219a in SDLInputJoystickManager::~SDLInputJoystickManager() (this=0x5555572da100, __in_chrg=<optimized out>) at /media/Data/Development/active/gzdoom/src/common/platform/posix/sdl/i_joystick.cpp:274
#11 0x00005555559f135b in I_ShutdownInput() () at /media/Data/Development/active/gzdoom/src/common/platform/posix/sdl/i_joystick.cpp:312
#12 0x0000555555d38b35 in GameMain() () at /media/Data/Development/active/gzdoom/src/d_main.cpp:3705
#13 0x00005555559f31b6 in main(int, char**) (argc=3, argv=0x7fffffffe688) at /media/Data/Development/active/gzdoom/src/common/platform/posix/sdl/i_main.cpp:194
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Crash after fatal error

Postby _mental_ » Mon Jul 26, 2021 4:16 am

Does it help to change this line to the following code? You can try to remove that line completely as well.
Code: Select allExpand view
SDL_QuitSubSystem(SDL_INIT_VIDEO);
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Crash after fatal error

Postby Marisa Kirisame » Tue Jul 27, 2021 3:58 am

That definitely did it.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Crash after fatal error

Postby _mental_ » Wed Jul 28, 2021 1:04 am

_mental_
 
 
 
Joined: 07 Aug 2011


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests