"***Fatal error***" with legacy branch

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

"***Fatal error***" with legacy branch

Post by vanfanel »

Hi there,

I am building drfrag's legacy branch on my X86_64 desktop GNU/Linux system against latest SDL2 running on Xorg+OpenGL/GLES, and I get this on exit, and the GZdoom process gets stuck there, it never gets to quit unless I manually kill it:

Code: Select all

*** Fatal Error ***
The game runs fine, this error is happening on quit only.

I have noticed that it only happens with SDL2 when it's built without desktop OpenGL support, wich forces SDL2 to use the "opengles2" or "opengles" renderers (note I am talking about the SDL2 renderer, not the GZDoom one).
Since GZDoom should not care about what renderer is SDL2 using, my guess is that it's trying to free something on quit that shouldn't be freed in GLES but only on desktop OpenGL.

Strangely enough, forcing a GLES renderer on an SDL2 built with desktop OpenGL support using this:

Code: Select all

SDL_HINT_RENDER_DRIVER="opengles2" ./gzdoom
does not cause the **Fatal Error**.

Building SDL2 without OpenGL support is as easy as configuring with:

Code: Select all

./configure --enable-video-opengles --disable-video-opengl
Why is this bug important to me? Because it happens on both SDL2 running on generic X86_64 Xorg, but also on SDL2 running on X-less enviroments (X86, ARM), where GLES is the only option available.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: "***Fatal error***" with legacy branch

Post by _mental_ »

Run GZDoom in gdb and when the process hangs, do Ctrl+C and bt in the debugger. This may give some clues what's going on.
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

Re: "***Fatal error***" with legacy branch

Post by vanfanel »

@_mental_: Backtrace is different each time... I think whatever is wrong, its causing a memory corruption that has different consequences each time:

Execution 1:

Code: Select all

(gdb) bt
#0  0x00007ffff6159804 in _int_free (av=0x7ffff64a9c20 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:4328
#1  0x00007ffff615e44e in __GI___libc_free (mem=<optimized out>) at malloc.c:3145
#2  0x00005555559d209c in PClass::StaticShutdown() ()
#3  0x0000555555749256 in call_terms() ()
#4  0x00007ffff610aec0 in __run_exit_handlers (status=0, listp=0x7ffff64a96f8 <__exit_funcs>, 
    run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:83
#5  0x00007ffff610af1a in __GI_exit (status=<optimized out>) at exit.c:105
#6  0x000055555574c910 in ST_Endoom() ()
#7  0x0000555555bef680 in ?? ()
#8  0x0000555555bef516 in ?? ()
#9  0x0000555555cb0f2f in VMExec_Unchecked::Exec(VMFrameStack*, VMOP const*, VMReturn*, int) ()
#10 0x0000555555cb2317 in VMExec_Unchecked::Exec(VMFrameStack*, VMOP const*, VMReturn*, int) ()
#11 0x0000555555cbe941 in VMCall(VMFunction*, VMValue*, int, VMReturn*, int) ()
#12 0x0000555555be23da in DMenu::CallMenuEvent(int, bool) ()
#13 0x0000555555be4141 in M_Responder(event_t*) ()
#14 0x00005555559b62e8 in D_ProcessEvents() ()
#15 0x00005555559beaaa in NetUpdate() ()
#16 0x00005555559bf906 in TryRunTics() ()
#17 0x00005555559b8cb9 in D_DoomLoop() ()
#18 0x00005555559ba737 in D_DoomMain() ()
#19 0x000055555572d6ef in main ()

Execution 2:

Code: Select all

(gdb) bt
#0  0x00007ffff6158086 in malloc_consolidate (av=av@entry=0x7ffff64a9c20 <main_arena>) at malloc.c:4506
#1  0x00007ffff6159e08 in _int_free (av=0x7ffff64a9c20 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:4398
#2  0x00007ffff615e44e in __GI___libc_free (mem=<optimized out>) at malloc.c:3145
#3  0x0000555555c5d6e5 in PSymbolTable::ReleaseSymbols() ()
#4  0x0000555555c5d769 in PSymbolTable::~PSymbolTable() ()
#5  0x0000555555c63e5a in FTypeTable::Clear() ()
#6  0x00005555559d21b9 in PClass::StaticShutdown() ()
#7  0x0000555555749256 in call_terms() ()
#8  0x00007ffff610aec0 in __run_exit_handlers (status=0, listp=0x7ffff64a96f8 <__exit_funcs>, 
    run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:83
#9  0x00007ffff610af1a in __GI_exit (status=<optimized out>) at exit.c:105
#10 0x000055555574c910 in ST_Endoom() ()
#11 0x0000555555bef680 in ?? ()
#12 0x0000555555bef516 in ?? ()
#13 0x0000555555cb0f2f in VMExec_Unchecked::Exec(VMFrameStack*, VMOP const*, VMReturn*, int) ()
#14 0x0000555555cb2317 in VMExec_Unchecked::Exec(VMFrameStack*, VMOP const*, VMReturn*, int) ()
#15 0x0000555555cbe941 in VMCall(VMFunction*, VMValue*, int, VMReturn*, int) ()
#16 0x0000555555be23da in DMenu::CallMenuEvent(int, bool) ()
#17 0x0000555555be4141 in M_Responder(event_t*) ()
#18 0x00005555559b62e8 in D_ProcessEvents() ()
#19 0x00005555559beaaa in NetUpdate() ()
#20 0x00005555559bf906 in TryRunTics() ()
#21 0x00005555559b8cb9 in D_DoomLoop() ()
#22 0x00005555559ba737 in D_DoomMain() ()
#23 0x000055555572d6ef in main ()
(gdb) 


Execution 3:

Code: Select all

(gdb) bt
#0  0x00007ffff6159804 in _int_free (av=0x7ffff64a9c20 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:4328
#1  0x00007ffff615e44e in __GI___libc_free (mem=<optimized out>) at malloc.c:3145
#2  0x00005555559d209c in PClass::StaticShutdown() ()
#3  0x0000555555749256 in call_terms() ()
#4  0x00007ffff610aec0 in __run_exit_handlers (status=0, listp=0x7ffff64a96f8 <__exit_funcs>, 
    run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:83
#5  0x00007ffff610af1a in __GI_exit (status=<optimized out>) at exit.c:105
#6  0x000055555574c910 in ST_Endoom() ()
#7  0x0000555555bef680 in ?? ()
#8  0x0000555555bef516 in ?? ()
#9  0x0000555555cb0f2f in VMExec_Unchecked::Exec(VMFrameStack*, VMOP const*, VMReturn*, int) ()
#10 0x0000555555cb2317 in VMExec_Unchecked::Exec(VMFrameStack*, VMOP const*, VMReturn*, int) ()
#11 0x0000555555cbe941 in VMCall(VMFunction*, VMValue*, int, VMReturn*, int) ()
#12 0x0000555555be23da in DMenu::CallMenuEvent(int, bool) ()
#13 0x0000555555be4141 in M_Responder(event_t*) ()
#14 0x00005555559b62e8 in D_ProcessEvents() ()
#15 0x00005555559beaaa in NetUpdate() ()
#16 0x00005555559bf906 in TryRunTics() ()
#17 0x00005555559b8cb9 in D_DoomLoop() ()
#18 0x00005555559ba737 in D_DoomMain() ()
#19 0x000055555572d6ef in main ()
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: "***Fatal error***" with legacy branch

Post by drfrag »

But you already got a crash on exit with 3.3.0:
viewtopic.php?f=2&t=60020#p1047163
Have you tried with 3.3.2? Do you get the crash with vid_renderer 0 in the legacy branch?
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

Re: "***Fatal error***" with legacy branch

Post by vanfanel »

@drfrag: That was on the Pi3. I am now getting it on the X86_64 laptop, GNU/Linux system running X11, and SDL2 running on X11, not KMSDRM or BCRM. In other words, I am now on "standard" Linux/X11 stuff, and I have found out that the cause for this ***Fatal Error*** seems to be using SDL2 built without OpenGL support.
Can you please build SDL2 without OpenGL and test?

Code: Select all

./configure --enable-video-opengles --disable-video-opengl
Also, I did clone your repository like this:

Code: Select all

git clone --depth 1 -b g3.3mgw https://github.com/drfrag666/gzdoom.git
So I am testing 3.4.1 version of the legacy branch, not 3.2.0 anymore.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: "***Fatal error***" with legacy branch

Post by drfrag »

No sorry. AFAIK there were a couple of SDL related commits since 3.3.0: 'Merged list of video modes for Cocoa and SDL backends' and 'skip rendering when application is not active'. None of the two seem related to your issue.
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

Re: "***Fatal error***" with legacy branch

Post by vanfanel »

drfrag wrote:No sorry. AFAIK there were a couple of SDL related commits since 3.3.0: 'Merged list of video modes for Cocoa and SDL backends' and 'skip rendering when application is not active'. None of the two seem related to your issue.
I don't quite understand your answer: the "No sorry" part. Does that mean I have to clone a different branch? Will you do the test and try to replicate the issue? (It's specially funny because I believe we are both from Spain)
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: "***Fatal error***" with legacy branch

Post by drfrag »

You believe? So you're not sure if you're from Spain... :)
I don't have my new linux computer up and running yet so i haven't even built a linux version myself and about building SDL2... :roll:
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

Re: "***Fatal error***" with legacy branch

Post by vanfanel »

drfrag wrote:You believe? So you're not sure if you're from Spain... :)
I don't have my new linux computer up and running yet so i haven't even built a linux version myself and about building SDL2... :roll:
Yes, I am sure I'm from Spain (living in a small village in Cáceres now :lol: but my english is a bit strange sometimes).
The building process on X86 GNU/Linux is very easy: I can help you with step-by-step instructions if you want. I will assume you're using some debian-derivative such as Ubuntu/Lubuntu... or Debian itself.

-Install libopenal, which is used by GZDoom for audio:

Code: Select all

sudo apt-get install libopenal-dev
-Remove your distro's SDL2 installation. Since most distros have SDL2 as a dependency for desktop enviroments, you can remove it manually and then reinstall it after you finish the experiments:

Code: Select all

sudo rm /usr/lib/x86_64-linux-gnu/libSDL2*
-Get the latest stable SDL2 sources, uncompress them, build them and install them:

Code: Select all

wget https://www.libsdl.org/release/SDL2-2.0.8.tar.gz
tax xvzpf SDL2-2.0.8.tar.gz
cd SDL2-2.0.8
 ./configure --prefix=/usr --enable-video-x11 --disable-video-mir --disable-diskaudio --disable-oss --disable-pulseaudio --disable-dummyaudio --disable-video-dummy --enable-video-opengles --disable-video-opengl
make -j6
sudo make install
Now let's go for your GZDoom branch:

-Clone your sources:

Code: Select all

git clone --depth 1 -b g3.3mgw https://github.com/drfrag666/gzdoom.git
-cd into the clone repo, create a building dir, and configure using cmake:

Code: Select all

cd gzdoom
mkdir b3
cd b3
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j6

...And that's pretty much it!
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: "***Fatal error***" with legacy branch

Post by drfrag »

So you're the guy from the ZX-One forum? That dondiego guy from Granada is in TestingZone? (ZDP) and we both could be the same person (or not). :) In any case as i said before i still don't have a working linux computer right now.
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

Re: "***Fatal error***" with legacy branch

Post by vanfanel »

@drfrag: Yes! I am Vanfanel on the great ZX-UNO forum, and an inconditional FPGA retro-computing lover. I don't know who dondiego is, I am not in Zona de Pruebas. Totally offtopic: do you have a ZX-UNO too?
And about the thread... do you have any idea on what could be happening? Does GZDoom dynamically load/unload GLES/OpenGL libs somewhere? I can't find such a thing, but the problem seems to be related to that.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: "***Fatal error***" with legacy branch

Post by drfrag »

Yeah ZX-Uno is great but i'm a very poor guy so i couldn't afford one, i can live with the ZesarUX emulator tough.
No idea but you should really try 3.3.2 to find if the problem is related to a later change (unlikely).
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

Re: "***Fatal error***" with legacy branch

Post by vanfanel »

@drfrag: No luck.... On every version I try, if I use SDL2 with the "opengles2" or "opengles" videodriver and no opengl support built-in (--disable-video-opengl) I get the same fatal error. GZDoom is assuming something about opengl on SDL2 that shouldn't be assumed...
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: "***Fatal error***" with legacy branch

Post by drfrag »

Sorry but i'm afraid i cannot be of any help here, it's not a recent change and it's not something specific to my legacy branch. It seems OpenGL is still required even if you use GLES. But does it work now on the Pi? Should be the same as 3.3.x.
vanfanel
Posts: 97
Joined: Thu Mar 24, 2016 6:04 pm

Re: "***Fatal error***" with legacy branch

Post by vanfanel »

drfrag wrote:Sorry but i'm afraid i cannot be of any help here, it's not a recent change and it's not something specific to my legacy branch. It seems OpenGL is still required even if you use GLES. But does it work now on the Pi? Should be the same as 3.3.x.
The game DOES work: the **Fatal Error** happens on quit only!

Return to “Technical Issues”