GZDoom crashes when hitting User State keys with my mod.

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
JohnnyBGetgoode
Posts: 39
Joined: Tue Jul 10, 2018 9:29 am
Location: East Coast USA
Contact:

GZDoom crashes when hitting User State keys with my mod.

Post by JohnnyBGetgoode »

I'm currently developing a mod for GZDoom, which requires the use of the user states keys to change states on a weapon. But when I attempt to do so, the game crashes to desktop.

Attached is the crash report, along with a demo Wad that should show it happening. Lemme know if you need anything else.

I'd like to finish this mod, so any help or workarounds would be appreciated.
Attachments
ModCrash.wad
Here's the Wad
(1.85 KiB) Downloaded 22 times
CrashReport.zip
Here's the report.
(23.17 KiB) Downloaded 24 times
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: GZDoom crashes when hitting User State keys with my mod.

Post by wildweasel »

I don't know if it's because the upload has failed or what, but I can't open this WAD - it appears to be corrupt. (And only 1.85 KB, at that.) Could you upload it somewhere like Dropbox or Google Drive?
User avatar
JohnnyBGetgoode
Posts: 39
Joined: Tue Jul 10, 2018 9:29 am
Location: East Coast USA
Contact:

Re: GZDoom crashes when hitting User State keys with my mod.

Post by JohnnyBGetgoode »

wildweasel wrote:I don't know if it's because the upload has failed or what, but I can't open this WAD - it appears to be corrupt. (And only 1.85 KB, at that.) Could you upload it somewhere like Dropbox or Google Drive?
Honestly, I'm just having trouble with using ZDoom's demo record. I'll probably just upload a gif or something.

Is there anything that can be gleaned from the crash report at least?

EDIT:
https://gfycat.com/gifs/detail/UnkemptTornHoneyeater

That's what I'm seeing whenever I try to hit states keys with my mod.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: GZDoom crashes when hitting User State keys with my mod.

Post by wildweasel »

Well, the crash is occurring within gzdoom.exe, which means this is either a bug with it, or a bug with your code - I'd like to look at your code, and I can't do so without a functional, non-corrupted copy of your WAD file. So could you upload it to Dropbox or Google Drive or some such place?
User avatar
JohnnyBGetgoode
Posts: 39
Joined: Tue Jul 10, 2018 9:29 am
Location: East Coast USA
Contact:

Re: GZDoom crashes when hitting User State keys with my mod.

Post by JohnnyBGetgoode »

oooooh, you needed my mod code...

*smacks head* Forgive me, for I am teh stupid.

https://drive.google.com/drive/folders/ ... Amod5QyGn0

Here you go.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: GZDoom crashes when hitting User State keys with my mod.

Post by _mental_ »

The crash was partly fixed in modern branch. In fact there are two related issues in the engine.
With the mentioned fix it no longer crashes the game but aborts VM instead

Code: Select all

VM execution aborted: tried to read from address zero.
Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1259
In this function player.mo becomes null after the following line

Code: Select all

player.mo.TickPSprites();
I cannot say what's wrong with it at the moment. Most likely a missing state was set on player pawn which could explain its premature destruction.
User avatar
JohnnyBGetgoode
Posts: 39
Joined: Tue Jul 10, 2018 9:29 am
Location: East Coast USA
Contact:

Re: GZDoom crashes when hitting User State keys with my mod.

Post by JohnnyBGetgoode »

_mental_ wrote:The crash was partly fixed in modern branch. In fact there are two related issues in the engine.
With the mentioned fix it no longer crashes the game but aborts VM instead

Code: Select all

VM execution aborted: tried to read from address zero.
Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1259
In this function player.mo becomes null after the following line

Code: Select all

player.mo.TickPSprites();
I cannot say what's wrong with it at the moment. Most likely a missing state was set on player pawn which could explain its premature destruction.
Well, that's disappointing.

Perhaps there's a workaround. I may not need a custom thinker class to do what I'm doing. I just need some kind of variable that any Actor class can read and write to. I only did the thinker because the ZDoom wiki pointed me in that direction.

Any help in this endeavor would be appreciated. :)
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: GZDoom crashes when hitting User State keys with my mod.

Post by _mental_ »

BTW the second weapon causes VM abort too but with a different callstack

Code: Select all

VM execution aborted: tried to read from address zero.
Called from ChromaScissors.StateFunction.56 at Chromagun-v01.pk3:actors/chromascissors/chromascissors.txt, line 79
Called from PSprite.SetState [Native]
Called from Weapon.A_Raise at gzdoom.pk3:zscript/inventory/weapons.txt, line 230
Called from weapon state ChromaScissors.19 in ChromaScissors
Called from PSprite.SetState [Native]
Called from PSprite.Tick at gzdoom.pk3:zscript/shared/player.txt, line 1353
Called from PlayerPawn.TickPSprites at gzdoom.pk3:zscript/shared/player.txt, line 413
Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1248
Guest

Re: GZDoom crashes when hitting User State keys with my mod.

Post by Guest »

EUREKA! I'VE FIXED IT!

Cheers on the log data for the weapon state calls, mental! That was the exact issue. I rewrote the weapon states for the starting gun, and presto, it works as intended!

Now to fix the second gun. Thanks a ton! You're a lifesaver!
User avatar
JohnnyBGetgoode
Posts: 39
Joined: Tue Jul 10, 2018 9:29 am
Location: East Coast USA
Contact:

Re: GZDoom crashes when hitting User State keys with my mod.

Post by JohnnyBGetgoode »

Fixed it!

Cheers on finding the state label call. That was the exact issue. I rewrote my state code, and now my mod works as intended!

Thanks mental, you're a lifesaver!
Post Reply

Return to “Closed Bugs [GZDoom]”