[Fixed] BrutalDoom crashes at (seemingly) random points on GZDoom

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

BrutalDoom crashes at (seemingly) random points on GZDoom

Postby Christsnatcher » Tue May 21, 2019 8:53 am

Hello guys,

I first posted about the issues I experience in the Brutal Doom topic on mod.db (https://www.moddb.com/mods/brutal-doom), but was advised to use the GZDoom forums, so here I am (https://i.gyazo.com/a67a1ef059072ac0229 ... 55dadc.png). The embedded link in my original post shows the actual error message: https://i.gyazo.com/02e85a239f353bf01f2 ... 6e73f0.jpg

This happens on all GZDoom builds from 3.7.2 if I'm not mistaken, both in x64 and x86 mode (yes, I was wrong about that in my mod.db post) and with all BrutalDoom builds up from RC7. The crashes are, as mentioned in the title, just seemingly random, as some of them (like the one I described) are 100% reproducible, e.g. picking up the single armor item in the little bathroom in Extermination Day when playing with BrutalDoom on GZDoom.

Many thanks in advance for looking into "my" issue, if you need any kind of additional data, just tell me.

Cheers!
Christsnatcher
 
Joined: 16 Dec 2017
Discord: Christsnatcher#0665

Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby _mental_ » Tue May 21, 2019 9:09 am

Please describe how to reproduce this reliably. We need exact steps to be able to investigate this.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby Matt » Tue May 21, 2019 12:35 pm

Here's line 457 of the current GZDoom master inventory.zs, last updated March 3-4.

I'm guessing TryPickup is somehow being called with a null toucher defined, or the toucher being referred to is destroyed just before that call, but if that had been the case I would expect to see at least one reference to some ZS in BD itself.

picking up the single armor item in the little bathroom in Extermination Day when playing with BrutalDoom on GZDoom.
Would you be able to link to the exact files that you were using?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby Christsnatcher » Tue May 21, 2019 6:38 pm

Hello,

thank you very much for looking into the issue I'm experiencing. Ok, I've zipped my basic GZDoom setup (gzdoom-bin-4-1-2b-x64 + audiopack v3 + BrutalDoom v21 Release build) and uploaded it to MEGA for you to check:

https://mega.nz/#!cNIF0YwA!XbmY4wkUMvNf ... rnbETVhDJM

I did not include DOOM.WAD due to obvious copyright issues, but I'm using the official "The Ultimate DOOM v1.9" .wad. I also added a basic launcher.bat solely for testing purposes as I usually run all source ports with mods via ZDL v3.2.2.3 beta.

To reproduce an exemplary crash the easiest way just run the .bat, choose E4 and "Hurt me plenty". When ingame, select the grenades and grab the shotgun right before you to make the troopers spawn. Now step back and throw a few grenades, you can be sure that the game will crash on a certain explosion, showing me the attached error messages.

If this doesn't help you and you need to investigate further, I'll try to 100% reproduce the Extermination Day armor item pickup crashing event and send you the data.

Cheers,

Christsnatcher
Attachments
Base Profile Screenshot 2019.05.22 - 01.19.26.93.7z
Error messages
(240.46 KiB) Downloaded 24 times
Christsnatcher
 
Joined: 16 Dec 2017
Discord: Christsnatcher#0665

Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby _mental_ » Wed May 22, 2019 8:00 am

DLevelScript::activator (that has TObjPtr<AActor*> type) does not invoke GC read barrier when it's passed to ellipsis function like ScriptUtil::Exec().
The problem was introduced with this commit with removal of internal GiveInventory() function.
Nulls are no longer assigned to condemned objects, and pointer to such destroyed actors may be passed to script functions.
Sooner or later, a read barrier will be triggered. The exact location where VM abort exception will be thrown depends on particular code path.

Here is how I propose to fix it.

Alternatively, we can cast activator to AActor* when needed to insert read barriers implicitly.
This will reduce the number of changed lines, but will make things not so obvious as well.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby Graf Zahl » Wed May 22, 2019 8:48 am

In that case a different solution is needed. The TObjPtr should never be passed to a vararg function at all, the pointer must be extracted beforehand.
And for most other places this change is totally unnecessary.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby _mental_ » Wed May 22, 2019 8:57 am

OK, it's the alternative solution I mentioned, with explicit cast for TObjPtr<> instances. There is no designated member function (which is not overloaded operator) to extract a pointer.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby Graf Zahl » Wed May 22, 2019 9:01 am

Then such a function should be added.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Re: BrutalDoom crashes at (seemingly) random points on GZDoo

Postby Christsnatcher » Thu May 23, 2019 5:52 pm

Thank you very much guys, awesome support!!!
Christsnatcher
 
Joined: 16 Dec 2017
Discord: Christsnatcher#0665


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests