[?-3.7 and 3.8] square1.pk3 tntcrate VM abort

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
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

[?-3.7 and 3.8] square1.pk3 tntcrate VM abort

Post by Edward-san »

When you 'use' the tnt crate, you will pick it up, and then with 'attack' you'll drop it. Since some time (maybe since VM?), the drop will result in this vm abort error:

(vm_jit 1 version)

Code: Select all

VM execution aborted:  Weapon.A_Lower called without valid caller. Weapon expected
Called from PlayerPawn.FireWeapon at gzdoom.pk3:zscript/shared/player.txt, line 357
Called from PlayerPawn.CheckWeaponFire at gzdoom.pk3:zscript/shared/player.txt, line 425
Called from PlayerPawn.TickPSprites at gzdoom.pk3:zscript/shared/player.txt, line 513
Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1642
Called from state CrateWeapon.18
Called from PlayerInfo.SetPSprite [Native]
(vm_jit 0 version, appears a bit different)

Code: Select all

VM execution aborted:  Weapon.A_Lower called without valid caller. Weapon expected
Called from state CrateWeapon.18
Called from PlayerInfo.SetPSprite [Native]
Called from PlayerPawn.FireWeapon at gzdoom.pk3:zscript/shared/player.txt, line 291
Called from PlayerPawn.CheckWeaponFire at gzdoom.pk3:zscript/shared/player.txt, line 359
Called from PlayerPawn.TickPSprites at gzdoom.pk3:zscript/shared/player.txt, line 447
Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1449
To test this fast, you can use 'summon tntcrate' on the first map.

Note: I could test +vm_jit 0 only on 3.7 branch because of an assertion error on the master branch (reported here).
Last edited by Edward-san on Sun Jan 13, 2019 5:57 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [?-3.7 and 3.8] square1.pk3 tntcrate VM abort

Post by Graf Zahl »

This is actually a mod bug that just didn't get reported before 3.7.

What happens here is that the mod takes away the weapon and then calls action functions referring to the weapon. This has plain and simply been undefined behavior and this just got caught in it when the error condition was actually started to be checked for.

IIRC this would outright crash the JIT code if left unchecked.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: [?-3.7 and 3.8] square1.pk3 tntcrate VM abort

Post by Xaser »

Fun timing -- I just fixed this in Square last night. :P

But yeah, those A_Lower's should have never been there. Just something that slipped through the cracks, I guess.

Square's a bit overdue for a patch for modern GZDooms anyway. Not sure what the ETA is just yet but I'm giving it a playthrough to see if anything else seems wonky -- so far so good now that the crates are taken care of.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [?-3.7 and 3.8] square1.pk3 tntcrate VM abort

Post by Graf Zahl »

Thanks, I wouldn't have liked having to disable this check because this can really cause bad crashes if the function being called actually does something with the weapon. A_Lower only changes the sprite's coordinates but with the JIT the rules are a bit different than before and things that went through undiscovered would just crash it.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: [?-3.7 and 3.8] square1.pk3 tntcrate VM abort

Post by Xaser »

No worries -- a VM abort is definitely the right thing to do here. Now I can catch the mistake when I inevitably make it again. :P
Post Reply

Return to “Closed Bugs [GZDoom]”