Strange access violation crash in GZDoom (version 4.2.4)...

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
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Strange access violation crash in GZDoom (version 4.2.4)...

Post by DoomKrakken »

Not sure how to explain it, but it continues to happen occasionally in a mod I'm developing called "Embers Of Armageddon" (which attempts to faithfully recreate the weapons, items, combat mechanics, and upgrade systems of DOOM to Doom via GZDoom). It typically happens while a Haste powerup is active (doesn't seem to happen with other powerups in the mod, for whatever reason) while firing the Chaingun in certain areas (although sometimes it also happens just by spinning the Chaingun using the Gatling Rotator). It's a very rare bug, and doesn't always happen, so it's hard to find any place to recreate it.

The most recent place this bug occurred was in MAP12: Suburb in "Lost Civilization" by Jaska (joi_lstcv14.wad).

Here are some screenshots (had to upload them to some channel in Discord so that they can be viewed here):

The Haste item:
https://cdn.discordapp.com/attachments/ ... 231327.png

Firing the Chaingun into the alcove where the problem seems to occur:
https://cdn.discordapp.com/attachments/ ... 004252.png

Haste active:
https://cdn.discordapp.com/attachments/ ... 004305.png

I will PM you my mod upon request (please don't distribute).

I've also attached the crash report here.

What seems to be the problem? Will you need anything more from me?

Thank you for your time.
Attachments
CrashReport.zip
I have four others like this in my GZDoom folder.
(92.79 KiB) Downloaded 33 times
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by _mental_ »

Maybe with full memory dump it would be possible to figure out something. Minidump is mostly useless here.
In order to fix this, we need a reliable way to reproduce the problem.
Spoiler: Callstack
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by DoomKrakken »

I can PM you my mod, would you like that?

Also, you'll need to get joi_lstcv14.wad from here: https://www.doomworld.com/forum/topic/1 ... load-link/
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by _mental_ »

It depends on how much time I need to play in order to trigger the crash. Actually, you can PM me anyway, as I can try to change garbage collection setting in order to reproduce it faster.
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by DoomKrakken »

Alright, I will.

Shouldn't take long to play, if I also give you my save file. You'll spawn right in front of the Haste item, and you'll turn around and find that alcove past the Spider Mastermind and some permanent homing items. ;)
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by _mental_ »

EOA Code.pk3:ZScript/EOA/Base.txt

Code: Select all

Class EOA_BaseWeapon : DoomWeapon
{
	// ...
	Int SpeedCounter;
	// ...
	Void SetSpeedCounter(Int Amount)
	{
		SpeedCounter = Amount;
	}
	// ...
EOA Code.pk3:Decorate/Weapons/Chaingun.txt

Code: Select all

ACTOR EOA_Chaingun : EOA_Weapon 20008
{
	// ...
	States
	{
		// ...
	SpinAnim1:
		// ...
		"####" ABC 1
		{
			// ...
			SetSpeedCounter(0);
			// ...
The thing is self inside SetSpeedCounter() function will point to a player object and not to a weapon one.
Your mod is so lucky that the given member overwrites the lower half of dynamic array's internal pointer (for 64-bit version).
No surprise that this will crash the game sooner or later.

Engine should reject such code, and it does so for ZScript classes. A mix of Decorate and ZScript lacks such checks at the moment.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by _mental_ »

Missing checks are fixed in cf8c05c. This means that code with such issues will fail to compile.
Spoiler: Errors reported with this fix
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by DoomKrakken »

AWESOME!

Ah, so it had to do with the porting of speed counters over to ZScript, with an improper pointer.

Well, this will certainly help! Just fixed it, and now there are no crashes (thus far, but I'm confident I fixed it well).

I wonder why it happened in so few places, and didn't crash that often.

Thanks so much for your help! :D
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Strange access violation crash in GZDoom (version 4.2.4)

Post by _mental_ »

DoomKrakken wrote:I wonder why it happened in so few places, and didn't crash that often.
That’s the nature of a random memory overwrite. Depending on particular situation, it can be very easy to trigger a visible bug or may go unnoticed for years.
Post Reply

Return to “Closed Bugs [GZDoom]”