[Addressed] Strange access violation crash in GZDoom (version 4.2.4)...

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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

Postby DoomKrakken » Wed Nov 20, 2019 3:01 am

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 4 times
User avatar
DoomKrakken
All but inactive here on the forums. Contact me on Discord for quicker replies.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

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

Postby _mental_ » Wed Nov 20, 2019 3:50 am

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
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby DoomKrakken » Wed Nov 20, 2019 4:42 am

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/
User avatar
DoomKrakken
All but inactive here on the forums. Contact me on Discord for quicker replies.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

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

Postby _mental_ » Wed Nov 20, 2019 4:56 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby DoomKrakken » Wed Nov 20, 2019 11:37 am

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. ;)
User avatar
DoomKrakken
All but inactive here on the forums. Contact me on Discord for quicker replies.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

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

Postby _mental_ » Thu Nov 21, 2019 5:14 am

EOA Code.pk3:ZScript/EOA/Base.txt
Code: Select allExpand view
Class EOA_BaseWeapon : DoomWeapon
{
   // ...
   Int SpeedCounter;
   // ...
   Void SetSpeedCounter(Int Amount)
   {
      SpeedCounter = Amount;
   }
   // ...

EOA Code.pk3:Decorate/Weapons/Chaingun.txt
Code: Select allExpand view
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_
 
 
 
Joined: 07 Aug 2011

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

Postby _mental_ » Thu Nov 21, 2019 10:02 am

Missing checks are fixed in cf8c05c. This means that code with such issues will fail to compile.
Spoiler: Errors reported with this fix
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby DoomKrakken » Thu Nov 21, 2019 11:33 pm

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
User avatar
DoomKrakken
All but inactive here on the forums. Contact me on Discord for quicker replies.
 
Joined: 19 Oct 2014
Location: Plahnit Urff
Discord: DoomKrakken#2719

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

Postby _mental_ » Fri Nov 22, 2019 1:08 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest