[Won't change] [?-3.7 and 3.8] square1.pk3 tntcrate VM abort

Bugs that have been investigated and resolved somehow.

Moderator: Developers

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

Postby Edward-san » Sun Jan 13, 2019 6:24 am

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 allExpand view
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 allExpand view
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 6:57 am, edited 1 time in total.
Edward-san
Mathematics is the language with which God has written the universe. (Galilei)
 
Joined: 17 Oct 2009

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

Postby Graf Zahl » Sun Jan 13, 2019 6:53 am

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Xaser » Sun Jan 13, 2019 1:14 pm

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
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

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

Postby Graf Zahl » Sun Jan 13, 2019 1:19 pm

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Xaser » Sun Jan 13, 2019 7:24 pm

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
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests