Crash with thinkers on exit

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: Developers

Forum rules
Please, if you can include a wad demonstrating the problem, do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

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


Return to Bugs

Who is online

Users browsing this forum: No registered users and 4 guests