Crash with thinkers 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: Crash with thinkers on exit

Re: Crash with thinkers on exit

by Graf Zahl » Thu Mar 01, 2018 7:11 am

In that case I'd leave everything as it is. At least the crash provides some info that'd otherwise got lost.

Re: Crash with thinkers on exit

by _mental_ » Thu Mar 01, 2018 3: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.

Re: Crash with thinkers on exit

by _mental_ » Tue Feb 13, 2018 3: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.

Re: Crash with thinkers on exit

by Major Cooke » Tue Feb 13, 2018 11:51 am

Ah hell. Okay. Yep, just adding a check for players[0].mo fixed that.

Re: Crash with thinkers on exit

by Graf Zahl » Tue Feb 13, 2018 10:47 am

It probably was but as it happens during exiting it may just cause some problems down the line.

Re: Crash with thinkers on exit

by _mental_ » Tue Feb 13, 2018 8:45 am

The problem is that file indeed, at line 277

Code: Select all

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.

Crash with thinkers on exit

by Major Cooke » Tue Feb 13, 2018 7: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.

Top