[Can't fix] Crash with thinkers on exit

Bugs that have been investigated and resolved somehow.

Moderator: Developers

Crash with thinkers on exit

Postby Major Cooke » Tue Feb 13, 2018 8:47 am

I'm sending a mod out to select developers. Yes, it is a large file, and unfortunately I've not had any luck whatsoever trying to replicate this on its own.

  • Go to map 3SEWER and let the game run for at least a tic.
  • Quit the game.

The game crashes (I'm using Windows 10 so it gives the 'GZDoom.exe has stopped working' crash), making it quite frustrating since any changes to any properties are lost.

However I've narrowed it down to SmileHeartBeat actor inside of ZSuper/Entities/Smile.txt being the culprit. Even after commenting out all of the code involved and leaving the Init function with nothing in it, it still crashes.

Image of the stack trace in VS2015

EDIT: If you "remove Smile" in console, the crash doesn't occur since Smile will destroy the thinker.
User avatar
Major Cooke
Slaughterer of Sewers
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Crash with thinkers on exit

Postby _mental_ » Tue Feb 13, 2018 9:45 am

The problem is that file indeed, at line 277
Code: Select allExpand view
override void OnDestroy()
{
   players[0].mo.A_SetInventory("SmileHard",0);
   // ...

players[0].mo is null but there is no check for this case.

At the moment I cannot say why the exception wasn't handled by the engine.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Crash with thinkers on exit

Postby Graf Zahl » Tue Feb 13, 2018 11:47 am

It probably was but as it happens during exiting it may just cause some problems down the line.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Crash with thinkers on exit

Postby Major Cooke » Tue Feb 13, 2018 12:51 pm

Ah hell. Okay. Yep, just adding a check for players[0].mo fixed that.
User avatar
Major Cooke
Slaughterer of Sewers
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Crash with thinkers on exit

Postby _mental_ » Tue Feb 13, 2018 4:07 pm

C++ Reference about std::atexit() wrote:If a function exits via an exception, std::terminate is called.

Looks like it’s our case. But even if this works there are still a few issues with graceful shutdown when exception is thrown during exiting.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Crash with thinkers on exit

Postby _mental_ » Thu Mar 01, 2018 4:14 am

With the current implementation is impossible to report errors to user during shutdown.
There are two options: to ignore exception silently and to leave everything as is.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Crash with thinkers on exit

Postby Graf Zahl » Thu Mar 01, 2018 8:11 am

In that case I'd leave everything as it is. At least the crash provides some info that'd otherwise got lost.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest