BrutalDoom crashes at (seemingly) random points on GZDoom

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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 Reply
Christsnatcher
Posts: 4
Joined: Sat Dec 16, 2017 11:36 pm

BrutalDoom crashes at (seemingly) random points on GZDoom

Post by Christsnatcher »

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!
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

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

Post by _mental_ »

Please describe how to reproduce this reliably. We need exact steps to be able to investigate this.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

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

Post by Matt »

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?
Christsnatcher
Posts: 4
Joined: Sat Dec 16, 2017 11:36 pm

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

Post by Christsnatcher »

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 87 times
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

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

Post by _mental_ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

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

Post by Graf Zahl »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

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

Post by _mental_ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

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

Post by Graf Zahl »

Then such a function should be added.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

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

Post by _mental_ »

Christsnatcher
Posts: 4
Joined: Sat Dec 16, 2017 11:36 pm

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

Post by Christsnatcher »

Thank you very much guys, awesome support!!!
Post Reply

Return to “Closed Bugs [GZDoom]”