[LINUX/ARM] Segfault on exit

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [LINUX/ARM] Segfault on exit

Re: [LINUX/ARM] Segfault on exit

by drfrag » Thu Sep 12, 2019 4:30 am

Thanks! :D
So the volatile int it's not a problem. Then i think i'll approve it with my proposed change, without the _linux_ ifdef.

Re: [LINUX/ARM] Segfault on exit

by _mental_ » Thu Sep 12, 2019 4:12 am

Looks good.

Re: [LINUX/ARM] Segfault on exit

by drfrag » Thu Sep 12, 2019 2:09 am

Rise from your grave!
Someone has made a PR for LZDoom to fix this :o , of course i've pressed the panic button. :)
@_mental_ @realdevs: I need a second opinion on this. Thanks!
https://github.com/drfrag666/gzdoom/pull/10

Re: [LINUX/ARM] Segfault on exit

by vanfanel » Wed Apr 04, 2018 5:42 am

@_mental_: I tried doing a debug build with -DWITH_ASAN=1, and in fact I get many memory leaks on exit but no crashes! :cry:

Code: Select all

GZDoom <unknown version> -  - SDL version
Compiled on Apr  4 2018

M_LoadDefaults: Load system defaults.
W_Init: Init WADfiles.
 adding /home/manuel/doom/gzdoom.pk3, 684 lumps
 adding ./doom1.wad, 1264 lumps
I_Init: Setting up machine state.
CPU Vendor ID: GenuineIntel
  Name: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  Family 6, Model 142, Stepping 9
  Features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 HyperThreading
I_InitSound: Initializing OpenAL
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
  Opened device Built-in Audio Analog Stereo
  EFX enabled
V_Init: allocate screen.
S_Init: Setting up sound.
ST_Init: Init startup screen.
Checking cmd-line parameters...
S_InitData: Load sound definitions.
G_ParseMapInfo: Load map definitions.
Texman.Init: Init texture manager.
ParseTeamInfo: Load team definitions.
LoadActors: Load actor definitions.
script parsing took 526.70 ms
R_Init: Init Doom refresh subsystem.
DecalLibrary: Load decals.
M_Init: Init menus.
P_Init: Init Playloop state.
ParseSBarInfo: Loading custom status bar definition.
D_CheckNetGame: Checking network game status.
player 1 of 1 (1 nodes)
Using video driver KMSDRM
GL_VENDOR: Intel Open Source Technology Center
GL_RENDERER: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) 
GL_VERSION: 4.5 (Core Profile) Mesa 17.2.8 (Core profile)
GL_SHADING_LANGUAGE_VERSION: 4.50

Max. texture size: 16384
Max. texture units: 32
Max. varying: 128
Max. combined shader storage blocks: 72
Max. vertex shader storage blocks: 12
Resolution: 640 x 480
fluidsynth: error: Not a RIFF file
fluidsynth: error: Couldn't load soundfont file
fluidsynth: error: Failed to load SoundFont "gzdoom"
libWildMidi(_WM_InitReader:53): ERROR Unable to load  (No such file or directory)
gzdoom: Unable to load sound fontUnable to create FluidSynth MIDI device. Falling back to OPL
Playing demo DEMO1
Cannot play non-GZDoom demos.


e1m1 - Hangar

fluidsynth: error: Not a RIFF file
fluidsynth: error: Couldn't load soundfont file
fluidsynth: error: Failed to load SoundFont "gzdoom"
libWildMidi(_WM_InitReader:53): ERROR Unable to load  (No such file or directory)
Unable to create FluidSynth MIDI device. Falling back to GUS

=================================================================
==27602==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 43888 byte(s) in 1517 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x558d32771019 in FStringData::Alloc(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1236
    #2 0x558d32770963 in FString::AllocBuffer(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1142
    #3 0x558d3276b35c in FString::FString(char const*, unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:81
    #4 0x558d31b047b0 in FSharedStringArena::Alloc(char const*, unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/memarena.cpp:357
    #5 0x558d325ac5d2 in ParseSingleFile /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:275
    #6 0x558d325adb75 in DoParse /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:433
    #7 0x558d325ae7c3 in ParseScripts() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:503
    #8 0x558d323bcf75 in LoadActors() /home/manuel/src/gzdoom-g3.3.1/src/scripting/thingdef.cpp:387
    #9 0x558d31ae10d4 in PClassActor::StaticInit() /home/manuel/src/gzdoom-g3.3.1/src/info.cpp:263
    #10 0x558d31a08472 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2533
    #11 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #12 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 13424 byte(s) in 241 object(s) allocated from:
    #0 0x7f06c43aef40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x558d327711d7 in FStringData::Realloc(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1258
    #2 0x558d32770b85 in FString::ReallocBuffer(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1159
    #3 0x558d3276c9b1 in FString::operator+=(char const*) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:342
    #4 0x558d30dec1dc in FString::operator<<(char const*) /home/manuel/src/gzdoom-g3.3.1/src/./zstring.h:186
    #5 0x558d32040696 in FWadCollection::GetLumpFullPath(int) const /home/manuel/src/gzdoom-g3.3.1/src/w_wad.cpp:1208
    #6 0x558d31fc6a5e in FScanner::OpenLumpNum(int) /home/manuel/src/gzdoom-g3.3.1/src/sc_man.cpp:314
    #7 0x558d325ac350 in ParseSingleFile /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:260
    #8 0x558d325adb75 in DoParse /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:433
    #9 0x558d325ae7c3 in ParseScripts() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:503
    #10 0x558d323bcf75 in LoadActors() /home/manuel/src/gzdoom-g3.3.1/src/scripting/thingdef.cpp:387
    #11 0x558d31ae10d4 in PClassActor::StaticInit() /home/manuel/src/gzdoom-g3.3.1/src/info.cpp:263
    #12 0x558d31a08472 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2533
    #13 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #14 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06bf3e8ecb  (<unknown module>)

Direct leak of 2048 byte(s) in 2 object(s) allocated from:
    #0 0x7f06c43aef40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x7f06a403f58e in fluid_rvoice_mixer_set_polyphony (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x2658e)

Direct leak of 1152 byte(s) in 24 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a71589ec  (<unknown module>)

Direct leak of 1056 byte(s) in 22 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a71589ec  (<unknown module>)
    #2 0xd0d0d0d000000000  (<unknown module>)

Direct leak of 552 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aed38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f06a46e8ad1  (<unknown module>)

Direct leak of 240 byte(s) in 2 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a4030d8d in new_fluid_hashtable_full (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x17d8d)

Direct leak of 219 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a46dd94d  (<unknown module>)

Direct leak of 72 byte(s) in 3 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x558d32771019 in FStringData::Alloc(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1236
    #2 0x558d32770963 in FString::AllocBuffer(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1142
    #3 0x558d3276b35c in FString::FString(char const*, unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:81
    #4 0x558d31b047b0 in FSharedStringArena::Alloc(char const*, unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/memarena.cpp:357
    #5 0x558d31b04681 in FSharedStringArena::Alloc(char const*) /home/manuel/src/gzdoom-g3.3.1/src/memarena.cpp:339
    #6 0x558d3258e35d in yy_reduce /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc-parse.lemon:614
    #7 0x558d325a70c6 in ZCCParse(void*, int, ZCCToken, ZCCParseState*) /home/manuel/src/gzdoom-g3.3.1/b3/src/zcc-parse.c:5628
    #8 0x558d325accee in ParseSingleFile /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:343
    #9 0x558d325adb75 in DoParse /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:433
    #10 0x558d325ae7c3 in ParseScripts() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:503
    #11 0x558d323bcf75 in LoadActors() /home/manuel/src/gzdoom-g3.3.1/src/scripting/thingdef.cpp:387
    #12 0x558d31ae10d4 in PClassActor::StaticInit() /home/manuel/src/gzdoom-g3.3.1/src/info.cpp:263
    #13 0x558d31a08472 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2533
    #14 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #15 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 60 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06c2704bf5 in _dl_signal_error (/lib/x86_64-linux-gnu/libc.so.6+0x158bf5)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43b0458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x558d31a72bb2 in FileReader::OpenFile(char const*, long, long) /home/manuel/src/gzdoom-g3.3.1/src/files.cpp:352
    #2 0x558d322449df in FResourceFile::OpenResourceFile(char const*, bool, bool) /home/manuel/src/gzdoom-g3.3.1/src/resourcefiles/resourcefile.cpp:312
    #3 0x558d31cb123c in P_LoadGLNodes(MapData*) /home/manuel/src/gzdoom-g3.3.1/src/p_glnodes.cpp:893
    #4 0x558d31cb1b2a in P_CheckNodes(MapData*, bool, int) /home/manuel/src/gzdoom-g3.3.1/src/p_glnodes.cpp:953
    #5 0x558d31e7c229 in P_SetupLevel(char const*, int) /home/manuel/src/gzdoom-g3.3.1/src/p_setup.cpp:4004
    #6 0x558d31a9c00b in G_DoLoadLevel(int, bool) /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:993
    #7 0x558d31a995bb in G_InitNew(char const*, bool) /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:518
    #8 0x558d31a9888c in G_DoNewGame() /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:381
    #9 0x558d31a852ce in G_Ticker() /home/manuel/src/gzdoom-g3.3.1/src/g_game.cpp:1091
    #10 0x558d31a1a1a7 in TryRunTics() /home/manuel/src/gzdoom-g3.3.1/src/d_net.cpp:1956
    #11 0x558d31a00be7 in D_DoomLoop() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:1066
    #12 0x558d31a095e4 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2757
    #13 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #14 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43b0458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x558d31a72bb2 in FileReader::OpenFile(char const*, long, long) /home/manuel/src/gzdoom-g3.3.1/src/files.cpp:352
    #2 0x558d325be214 in FSoundFontManager::OpenSoundFont(char const*, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/i_soundfont.cpp:453
    #3 0x558d32729569 in _WM_InitReader(char const*) /home/manuel/src/gzdoom-g3.3.1/src/sound/wildmidi/file_io.cpp:50
    #4 0x558d32738e2b in WM_LoadConfig /home/manuel/src/gzdoom-g3.3.1/src/sound/wildmidi/wildmidi_lib.cpp:682
    #5 0x558d3274989c in WildMidi_Init(char const*, unsigned short, unsigned short) /home/manuel/src/gzdoom-g3.3.1/src/sound/wildmidi/wildmidi_lib.cpp:2575
    #6 0x558d325cd6f8 in WildMIDIDevice::WildMIDIDevice(char const*, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/mididevices/music_wildmidi_mididevice.cpp:106
    #7 0x558d325f02b1 in MIDIStreamer::CreateMIDIDevice(EMidiDevice, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/musicformats/music_midistream.cpp:234
    #8 0x558d325f09a3 in MIDIStreamer::Play(bool, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/musicformats/music_midistream.cpp:298
    #9 0x558d325b3d44 in MusInfo::Start(bool, float, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/i_music.cpp:231
    #10 0x558d31f98f13 in S_ChangeMusic(char const*, int, bool, bool) /home/manuel/src/gzdoom-g3.3.1/src/s_sound.cpp:2734
    #11 0x558d31f89087 in S_Start() /home/manuel/src/gzdoom-g3.3.1/src/s_sound.cpp:483
    #12 0x558d31e7a69d in P_SetupLevel(char const*, int) /home/manuel/src/gzdoom-g3.3.1/src/p_setup.cpp:3681
    #13 0x558d31a9c00b in G_DoLoadLevel(int, bool) /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:993
    #14 0x558d31a995bb in G_InitNew(char const*, bool) /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:518
    #15 0x558d31a9888c in G_DoNewGame() /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:381
    #16 0x558d31a852ce in G_Ticker() /home/manuel/src/gzdoom-g3.3.1/src/g_game.cpp:1091
    #17 0x558d31a1a1a7 in TryRunTics() /home/manuel/src/gzdoom-g3.3.1/src/d_net.cpp:1956
    #18 0x558d31a00be7 in D_DoomLoop() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:1066
    #19 0x558d31a095e4 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2757
    #20 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #21 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43b0458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x558d31a72bb2 in FileReader::OpenFile(char const*, long, long) /home/manuel/src/gzdoom-g3.3.1/src/files.cpp:352
    #2 0x558d325be214 in FSoundFontManager::OpenSoundFont(char const*, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/i_soundfont.cpp:453
    #3 0x558d32729569 in _WM_InitReader(char const*) /home/manuel/src/gzdoom-g3.3.1/src/sound/wildmidi/file_io.cpp:50
    #4 0x558d32738e2b in WM_LoadConfig /home/manuel/src/gzdoom-g3.3.1/src/sound/wildmidi/wildmidi_lib.cpp:682
    #5 0x558d3274989c in WildMidi_Init(char const*, unsigned short, unsigned short) /home/manuel/src/gzdoom-g3.3.1/src/sound/wildmidi/wildmidi_lib.cpp:2575
    #6 0x558d325cd6f8 in WildMIDIDevice::WildMIDIDevice(char const*, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/mididevices/music_wildmidi_mididevice.cpp:106
    #7 0x558d325f02b1 in MIDIStreamer::CreateMIDIDevice(EMidiDevice, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/musicformats/music_midistream.cpp:234
    #8 0x558d325f09a3 in MIDIStreamer::Play(bool, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/musicformats/music_midistream.cpp:298
    #9 0x558d325b3d44 in MusInfo::Start(bool, float, int) /home/manuel/src/gzdoom-g3.3.1/src/sound/i_music.cpp:231
    #10 0x558d31f98f13 in S_ChangeMusic(char const*, int, bool, bool) /home/manuel/src/gzdoom-g3.3.1/src/s_sound.cpp:2734
    #11 0x558d31a01e00 in D_DoAdvanceDemo() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:1351
    #12 0x558d31a1a10d in TryRunTics() /home/manuel/src/gzdoom-g3.3.1/src/d_net.cpp:1951
    #13 0x558d31a00be7 in D_DoomLoop() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:1066
    #14 0x558d31a095e4 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2757
    #15 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #16 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43b0458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x558d31a72bb2 in FileReader::OpenFile(char const*, long, long) /home/manuel/src/gzdoom-g3.3.1/src/files.cpp:352
    #2 0x558d31cb40f1 in CheckCachedNodes /home/manuel/src/gzdoom-g3.3.1/src/p_glnodes.cpp:1166
    #3 0x558d31cb0ec9 in P_LoadGLNodes(MapData*) /home/manuel/src/gzdoom-g3.3.1/src/p_glnodes.cpp:859
    #4 0x558d31cb1b2a in P_CheckNodes(MapData*, bool, int) /home/manuel/src/gzdoom-g3.3.1/src/p_glnodes.cpp:953
    #5 0x558d31e7c229 in P_SetupLevel(char const*, int) /home/manuel/src/gzdoom-g3.3.1/src/p_setup.cpp:4004
    #6 0x558d31a9c00b in G_DoLoadLevel(int, bool) /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:993
    #7 0x558d31a995bb in G_InitNew(char const*, bool) /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:518
    #8 0x558d31a9888c in G_DoNewGame() /home/manuel/src/gzdoom-g3.3.1/src/g_level.cpp:381
    #9 0x558d31a852ce in G_Ticker() /home/manuel/src/gzdoom-g3.3.1/src/g_game.cpp:1091
    #10 0x558d31a1a1a7 in TryRunTics() /home/manuel/src/gzdoom-g3.3.1/src/d_net.cpp:1956
    #11 0x558d31a00be7 in D_DoomLoop() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:1066
    #12 0x558d31a095e4 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2757
    #13 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #14 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43b0458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x558d31a72bb2 in FileReader::OpenFile(char const*, long, long) /home/manuel/src/gzdoom-g3.3.1/src/files.cpp:352
    #2 0x558d31fc6439 in FScanner::OpenFile(char const*) /home/manuel/src/gzdoom-g3.3.1/src/sc_man.cpp:252
    #3 0x558d31fe491f in ParseStatistics /home/manuel/src/gzdoom-g3.3.1/src/statistics.cpp:140
    #4 0x558d31fe530e in ReadStatistics() /home/manuel/src/gzdoom-g3.3.1/src/statistics.cpp:204
    #5 0x558d31a08380 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2516
    #6 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #7 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43b0458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x558d31a72bb2 in FileReader::OpenFile(char const*, long, long) /home/manuel/src/gzdoom-g3.3.1/src/files.cpp:352
    #2 0x558d325bca12 in FSoundFontManager::ProcessOneFile(FString const&) /home/manuel/src/gzdoom-g3.3.1/src/sound/i_soundfont.cpp:297
    #3 0x558d325bd72e in FSoundFontManager::CollectSoundfonts() /home/manuel/src/gzdoom-g3.3.1/src/sound/i_soundfont.cpp:376
    #4 0x558d325be61f in I_InitSoundFonts() /home/manuel/src/gzdoom-g3.3.1/src/sound/i_soundfont.cpp:479
    #5 0x558d325b3936 in I_InitMusic() /home/manuel/src/gzdoom-g3.3.1/src/sound/i_music.cpp:148
    #6 0x558d325b789e in I_InitSound() /home/manuel/src/gzdoom-g3.3.1/src/sound/i_sound.cpp:286
    #7 0x558d30dea048 in I_Init() /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_system.cpp:132
    #8 0x558d31a081b0 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2479
    #9 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #10 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43b0458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x558d31a72bb2 in FileReader::OpenFile(char const*, long, long) /home/manuel/src/gzdoom-g3.3.1/src/files.cpp:352
    #2 0x558d31fc6439 in FScanner::OpenFile(char const*) /home/manuel/src/gzdoom-g3.3.1/src/sc_man.cpp:252
    #3 0x558d30dd90eb in ParseSteamRegistry /home/manuel/src/gzdoom-g3.3.1/src/posix/i_steam.cpp:126
    #4 0x558d30dd957b in I_GetSteamPath() /home/manuel/src/gzdoom-g3.3.1/src/posix/i_steam.cpp:209
    #5 0x558d319f573c in FIWadManager::CollectSearchPaths() /home/manuel/src/gzdoom-g3.3.1/src/d_iwad.cpp:395
    #6 0x558d319f6aa0 in FIWadManager::IdentifyVersion(TArray<FString, FString>&, char const*, char const*, char const*) /home/manuel/src/gzdoom-g3.3.1/src/d_iwad.cpp:504
    #7 0x558d319f8a32 in FIWadManager::FindIWAD(TArray<FString, FString>&, char const*, char const*, char const*) /home/manuel/src/gzdoom-g3.3.1/src/d_iwad.cpp:752
    #8 0x558d31a07ce5 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2401
    #9 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #10 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aed38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f06a46d9347  (<unknown module>)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x558d32771019 in FStringData::Alloc(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1236
    #2 0x558d32770963 in FString::AllocBuffer(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1142
    #3 0x558d3276b2f6 in FString::FString(char const*) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:74
    #4 0x558d3246abc8 in ExpVal::GetString() const /home/manuel/src/gzdoom-g3.3.1/src/scripting/backend/codegen.h:200
    #5 0x558d323ea8d0 in FxStringCast::Resolve(FCompileContext&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/backend/codegen.cpp:1274
    #6 0x558d32550cdd in ZCCCompiler::GetStringConst(FxExpression*, FCompileContext&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:75
    #7 0x558d325670da in ZCCCompiler::DispatchScriptProperty(PProperty*, ZCC_PropertyStmt*, AActor*, Baggage&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:2046
    #8 0x558d32567ef5 in ZCCCompiler::ProcessDefaultProperty(PClassActor*, ZCC_PropertyStmt*, Baggage&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:2135
    #9 0x558d325695ba in ZCCCompiler::InitDefaults() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:2270
    #10 0x558d32554877 in ZCCCompiler::Compile() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:478
    #11 0x558d325ae1c4 in DoParse /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:477
    #12 0x558d325ae7c3 in ParseScripts() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:503
    #13 0x558d323bcf75 in LoadActors() /home/manuel/src/gzdoom-g3.3.1/src/scripting/thingdef.cpp:387
    #14 0x558d31ae10d4 in PClassActor::StaticInit() /home/manuel/src/gzdoom-g3.3.1/src/info.cpp:263
    #15 0x558d31a08472 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2533
    #16 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #17 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x558d32771019 in FStringData::Alloc(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1236
    #2 0x558d32770963 in FString::AllocBuffer(unsigned long) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:1142
    #3 0x558d3276b2f6 in FString::FString(char const*) /home/manuel/src/gzdoom-g3.3.1/src/zstring.cpp:74
    #4 0x558d3246abc8 in ExpVal::GetString() const /home/manuel/src/gzdoom-g3.3.1/src/scripting/backend/codegen.h:200
    #5 0x558d323ea8d0 in FxStringCast::Resolve(FCompileContext&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/backend/codegen.cpp:1274
    #6 0x558d32550cdd in ZCCCompiler::GetStringConst(FxExpression*, FCompileContext&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:75
    #7 0x558d32565673 in ZCCCompiler::DispatchProperty(FPropertyInfo*, ZCC_PropertyStmt*, AActor*, Baggage&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:1858
    #8 0x558d32567d4c in ZCCCompiler::ProcessDefaultProperty(PClassActor*, ZCC_PropertyStmt*, Baggage&) /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:2119
    #9 0x558d325695ba in ZCCCompiler::InitDefaults() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:2270
    #10 0x558d32554877 in ZCCCompiler::Compile() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_compile.cpp:478
    #11 0x558d325ae1c4 in DoParse /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:477
    #12 0x558d325ae7c3 in ParseScripts() /home/manuel/src/gzdoom-g3.3.1/src/scripting/zscript/zcc_parser.cpp:503
    #13 0x558d323bcf75 in LoadActors() /home/manuel/src/gzdoom-g3.3.1/src/scripting/thingdef.cpp:387
    #14 0x558d31ae10d4 in PClassActor::StaticInit() /home/manuel/src/gzdoom-g3.3.1/src/info.cpp:263
    #15 0x558d31a08472 in D_DoomMain() /home/manuel/src/gzdoom-g3.3.1/src/d_main.cpp:2533
    #16 0x558d30de9c37 in main /home/manuel/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
    #17 0x7f06c25cd1c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)

Indirect leak of 6944 byte(s) in 2 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a71589ec  (<unknown module>)

Indirect leak of 4800 byte(s) in 150 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a4030ae9  (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x17ae9)

Indirect leak of 4320 byte(s) in 36 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a4030d8d in new_fluid_hashtable_full (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x17d8d)

Indirect leak of 3344 byte(s) in 38 object(s) allocated from:
    #0 0x7f06c43aed38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f06a4030dcd in new_fluid_hashtable_full (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x17dcd)

Indirect leak of 3312 byte(s) in 18 object(s) allocated from:
    #0 0x7f06c43aed38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f06a46e10ab  (<unknown module>)

Indirect leak of 2688 byte(s) in 48 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a4032236  (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x19236)

Indirect leak of 2080 byte(s) in 52 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a4032831 in fluid_settings_register_int (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x19831)

Indirect leak of 1632 byte(s) in 102 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a40317cd in new_fluid_list (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x187cd)

Indirect leak of 1078 byte(s) in 114 object(s) allocated from:
    #0 0x7f06c4347a98 in __interceptor___strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77a98)
    #1 0x7f06a4032104  (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x19104)

Indirect leak of 896 byte(s) in 14 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a403262b in fluid_settings_register_num (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x1962b)

Indirect leak of 576 byte(s) in 36 object(s) allocated from:
    #0 0x7f06c43aeb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f06a4032083  (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x19083)

Indirect leak of 482 byte(s) in 102 object(s) allocated from:
    #0 0x7f06c4347a98 in __interceptor___strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77a98)
    #1 0x7f06a40335d8 in fluid_settings_add_option (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x1a5d8)

Indirect leak of 320 byte(s) in 48 object(s) allocated from:
    #0 0x7f06c4347a98 in __interceptor___strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77a98)
    #1 0x7f06a4032253  (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x19253)

Indirect leak of 320 byte(s) in 48 object(s) allocated from:
    #0 0x7f06c4347a98 in __interceptor___strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77a98)
    #1 0x7f06a4032264  (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x19264)

Indirect leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c43aef40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x7f06a46d92ed  (<unknown module>)

Indirect leak of 226 byte(s) in 36 object(s) allocated from:
    #0 0x7f06c4347a98 in __interceptor___strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77a98)
    #1 0x7f06a4032076  (/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1+0x19076)

Indirect leak of 15 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c4347538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7f06a46ee87f  (<unknown module>)

Indirect leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x7f06c4347538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7f06a46e8c29  (<unknown module>)

SUMMARY: AddressSanitizer: 100461 byte(s) leaked in 2672 allocation(s).


I don't see any mentions to SDL2 or KMSDRM beyond normal GZDoom initialization.
So, no crashes with ASAN... how can it be?

Re: [LINUX/ARM] Segfault on exit

by _mental_ » Wed Apr 04, 2018 2:16 am

It doesn't crash for me on Ubuntu 16.04 VM. According to logs driver is selected correctly

Code: Select all

Using video driver KMSDRM
Address sanitizer reported a few leaks on exit but it didn't abort execution like in case of memory related errors.
I suggest you to try with -DWITH_ASAN yourself.

Re: [LINUX/ARM] Segfault on exit

by vanfanel » Tue Apr 03, 2018 9:56 am

@_mental_: I have some "funny" news. I tried the following combinations:

-Downgraded to SDL2 2.0.4 on the Pi. That implies going back to the BCRM video driver, instead of the modern KMSDRM driver I was using on SDL2 2.0.8 (There's no KMSDRM driver on SDL 2.0.4). No more crashes on exit with latest GZDoom 3.3.1.
-Built and installed latest stable SDL2 2.0.8 on the Pi with BCRM video driver instead of KMSDRM/VC4. No more crashes on exit with latest GZDoom 3.3.1.

Conclussion of this part: On the Raspberry Pi, crashes the on exit only happen with SDL 2.0.8 + KMSDRM.

Then went to X86_64. Latest GZDoom 3.3.1 sources.

-No crashes on exit with default SDL2 2.0.6 installed on Ubuntu 17.10, which runs on X11 driver.
-No chasres on exit with latest stable SDL2 2.0.8 manually built and installed on the same system, running on the X11 driver.
-Crashes EXACTLY the same as the Pi does when running on latest stable SDL2 2.0.8 on the KMSDRM driver.

Final conclussion for now: It's the KMSDRM driver that's making a difference. I am not saying it's the cause, but it's making GZDoom (and ZDoom in fact) crash in every GZDoom/ZDoom version I have tried.
It crashes the same on the Pi or in a X86_64 setup.

Now the funny part is, I did part of the KMSDRM driver myself time ago (it was mostly the work of Sigmaris), and sent it to the SDL2 mailing list to be merged as the only way to have X-less accelerated graphics in SDL2 games, like ZDoom.
But I can't find or start to understand what is going on here. Looking at this GDB session I just did:

Code: Select all

Thread 1 "gzdoom" received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x76ba3794 <main_arena>) at malloc.c:4202
4202	malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x76ba3794 <main_arena>) at malloc.c:4202
#1  0x76ad72e4 in _int_malloc (av=av@entry=0x76ba3794 <main_arena>, bytes=bytes@entry=896) at malloc.c:3488
#2  0x76ad9370 in __GI___libc_malloc (bytes=bytes@entry=896) at malloc.c:2928
#3  0x76ad9d64 in __GI___libc_realloc (oldmem=0x0, bytes=896) at malloc.c:3011
#4  0x00b82c00 in M_Realloc_Dbg (memblock=0x0, size=896, file=0x12605f8 "/home/pi/src/gzdoom-g3.3.1/src/./tarray.h", lineno=470)
    at /home/pi/src/gzdoom-g3.3.1/src/m_alloc.cpp:152
#5  0x00cdf528 in TArray<FSectorPortal, FSectorPortal>::DoResize (this=0x13f16e8 <level+232>)
    at /home/pi/src/gzdoom-g3.3.1/src/./tarray.h:470
#6  0x00cdf31c in TArray<FSectorPortal, FSectorPortal>::Grow (this=0x13f16e8 <level+232>, amount=2)
    at /home/pi/src/gzdoom-g3.3.1/src/./tarray.h:381
#7  0x00cdecdc in TArray<FSectorPortal, FSectorPortal>::Resize (this=0x13f16e8 <level+232>, amount=2)
    at /home/pi/src/gzdoom-g3.3.1/src/./tarray.h:390
#8  0x00d5b6ac in P_ClearPortals () at /home/pi/src/gzdoom-g3.3.1/src/portal.cpp:516
#9  0x00d04f80 in P_FreeLevelData () at /home/pi/src/gzdoom-g3.3.1/src/p_setup.cpp:3527
#10 0x00d0750c in P_Shutdown () at /home/pi/src/gzdoom-g3.3.1/src/p_setup.cpp:4267
#11 0x006da8d0 in call_terms () at /home/pi/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:131
#12 0x76a95dd4 in __run_exit_handlers (status=0, listp=0x76ba34ac <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, 
    run_dtors=run_dtors@entry=true) at exit.c:83
#13 0x76a95e34 in __GI_exit (status=<optimized out>) at exit.c:105
#14 0x006e0e44 in ST_Endoom () at /home/pi/src/gzdoom-g3.3.1/src/posix/sdl/st_start.cpp:353
#15 0x00ec105c in <lambda()>::operator()(void) const (__closure=0x0) at /home/pi/src/gzdoom-g3.3.1/src/menu/messagebox.cpp:119
#16 0x00ec108c in <lambda()>::_FUN(void) () at /home/pi/src/gzdoom-g3.3.1/src/menu/messagebox.cpp:120
#17 0x00ec0cf0 in AF_DMessageBoxMenu_CallHandler (param=0x1cecae0, defaultparam=..., numparam=1, ret=0x7effda40, numret=0)
    at /home/pi/src/gzdoom-g3.3.1/src/menu/messagebox.cpp:57
#18 0x01003374 in VMExec_Checked::Exec (stack=0x76ff44c8, pc=0x1b526b8, ret=0x7effded0, numret=0)
    at /home/pi/src/gzdoom-g3.3.1/src/scripting/vm/vmexec.h:702
#19 0x0100341c in VMExec_Checked::Exec (stack=0x76ff44c8, pc=0x1b529b0, ret=0x7effe3cc, numret=1)
    at /home/pi/src/gzdoom-g3.3.1/src/scripting/vm/vmexec.h:721
#20 0x0101d988 in VMCall (func=0x26ad25c, params=0x7effe398, numparams=3, results=0x7effe3cc, numresults=1)
    at /home/pi/src/gzdoom-g3.3.1/src/scripting/vm/vmframe.cpp:463
---Type <return> to continue, or q <return> to quit---
#21 0x00eb0b08 in DMenu::CallMenuEvent (this=0x2bfc9b0, mkey=6, fromcontroller=false)
    at /home/pi/src/gzdoom-g3.3.1/src/menu/menu.cpp:219
#22 0x00eb2f14 in M_Responder (ev=0x13e1b10 <events+96>) at /home/pi/src/gzdoom-g3.3.1/src/menu/menu.cpp:690
#23 0x00b01b6c in D_ProcessEvents () at /home/pi/src/gzdoom-g3.3.1/src/d_main.cpp:304
#24 0x00b11b00 in NetUpdate () at /home/pi/src/gzdoom-g3.3.1/src/d_net.cpp:986
#25 0x00b14db8 in TryRunTics () at /home/pi/src/gzdoom-g3.3.1/src/d_net.cpp:1841
#26 0x00b04124 in D_DoomLoop () at /home/pi/src/gzdoom-g3.3.1/src/d_main.cpp:1066
#27 0x00b09a88 in D_DoomMain () at /home/pi/src/gzdoom-g3.3.1/src/d_main.cpp:2757
#28 0x006db168 in main (argc=3, argv=0x7efff754) at /home/pi/src/gzdoom-g3.3.1/src/posix/sdl/i_main.cpp:263
(gdb) q
...It seems that the segfault is taking place somewhere into the network code. The segfault happens inside the "real" Doom main loop, not in the SDL2 graphics code. How can it be related to the KMSDRM driver in SDL2, I don't know even how to think about it.

I can see I_ShutdownGraphics in src/posix/sdl/hardware.cpp returns with no problems at all, as do all it's subsequent SDL2 calls. I_ShutdownGraphics causes two calls on the SDL2 KMSDRM driver quitting functions: KMSDRM_DestroyWindow and SDL_EGL_DeleteContext. These internal SDL2 KMSDRM functions also return with no problems.
To summarize, I added some simple printfs to those functions beggining and ending:

Code: Select all

***ENTERING I_ShutdownGraphics 
****************ENTERING SDL_DeleteContext
****************ENTERING SDL_EGL_DeleteContext
****************SDL_EGL_DeleteContext COMPLETED OK!!!!!!!!
****************SDL_DeleteContext COMPLETED OK!!!!
****************ENTERING SDL_DestroyWindown
****************ENTERING KMSDRM_DestroyWindow
****************KMSDRM_DestroyWindow COMPLETED OK!!!!!
****************SDL_DestroyWindow COMPLETED OK!!!!
***I_ShutdownGraphics COMPLETED OK!!!!!!

I would like to have this fixed, as it's the only way to low-latency ZDoom on low-end systems. Other SDL2 games, except ECWolf, seem to work fine with this SDL2 driver.

Can you please try to build SDL2 2.0.8 with the KMSDRM driver? The errors on quit DO appear on X86_64 as well, as I concluded. It's as easy as doing:

Code: Select all

./configure --enable-video-kmsdrm

Re: [LINUX/ARM] Segfault on exit

by _mental_ » Mon Apr 02, 2018 12:50 pm

Just out of curiosity, can you downgrade SDL to 2.0.4 or something like that?

Also, you can try to build ZDoom 2.8 because it was the first stable version after switching to SDL2.
Have no idea about status of SDL1 on Pi.

Re: [LINUX/ARM] Segfault on exit

by vanfanel » Mon Apr 02, 2018 9:47 am

I have gone as far as to build the last ZDoom sources from git:
https://github.com/rheit/zdoom.git

..and it also crashes on quit with latest stable SDL 2.0.8 on the Pi.

Re: [LINUX/ARM] Segfault on exit

by Rachael » Mon Apr 02, 2018 9:06 am

GZDoom had no ARM support for a very long time, the bisect would have to go back onto ZDoom's repository instead, or at least use ZDoom-specific commit numbers.

Re: [LINUX/ARM] Segfault on exit

by _mental_ » Mon Apr 02, 2018 8:51 am

The problem is that a potential memory overwrite may lead to arbitrary number of other crashes.
Please do no alter source code in any way because we are really interested to find out the cause of the first segfault.

And I'm not quite sure what was the first version with ARM support.
I would suggest to try it first in order to exclude bugs in third-party libraries.

Re: [LINUX/ARM] Segfault on exit

by vanfanel » Mon Apr 02, 2018 8:40 am

@_mental_: I have been doing precissely that, but it takes ~30 min to build on a Pi3 with -j6.
Also, noticed that with latest stable SDL2 (2.0.8) crashes at exit happen with every version back to 3.2.0...

Re: [LINUX/ARM] Segfault on exit

by _mental_ » Mon Apr 02, 2018 8:16 am

If you can reliably reproduce the problem with the recent code but it wasn't there before, could you please find the stable version when it began?
Ideally, you can do git bisect to find a faulty commit. Although, I suspect this will require a lot of time.
Are you building on Pi itself? Cross-compilation on multi-core desktop PC should be much faster. I'm not 100% sure that it works at the moment though.

Re: [LINUX/ARM] Segfault on exit

by Rachael » Sun Apr 01, 2018 2:30 pm

That's fine.

A little trick I've learned is to Ctrl-Z out of the app while in the affected terminal, and then do "kill -9 %1" to kill it.

Re: [LINUX/ARM] Segfault on exit

by vanfanel » Sun Apr 01, 2018 8:29 am

@Rachael: I have also tried QZDoom and I have the same problems on quit (I think that's your sourceport).
I believe I'll have to stick to old versions then... or use the old ZDoom or Chocolate Doom. The real problem with these segfaults on exit is that they block the Pi in practice, since SDL2 is in control of the TTY keyboard and when the game crashes on exit it doesn't free up the keyboard.

Re: [LINUX/ARM] Segfault on exit

by Rachael » Sat Mar 31, 2018 1:17 pm

Yes I am the one compiling the official builds, but my skills with debugging are nowhere near on par with _mental_'s or I would have looked into this issue myself.

I do not know what the problem is - and I suspect the sound code is related but I do not know if it's the actual cause.

Top