[Shadow Warrior] [0.4.0] Crash with the Heart weapon

Moderator: Raze 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.
User avatar
Dynamo
Posts: 1044
Joined: Sat Jun 07, 2008 5:58 am
Location: Industrial District

[Shadow Warrior] [0.4.0] Crash with the Heart weapon

Post by Dynamo »

Using Last Warrior again, if I go down into the arena, use the ripper heart and then fight the monster and die, the game crashes.

Here is the save file.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Shadow Warrior] [0.4.0] Crash with the Heart weapon

Post by Graf Zahl »

Same cause as all the other SW crashes I saw so far: When the player dies, some associated data gets invalidated and filled with garbage values but all references to this invalidated data is retained - and when it gets accessed later the game crashes. In this case things are made worse by the inability to check for the data being invalid.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Shadow Warrior] [0.4.0] Crash with the Heart weapon

Post by Graf Zahl »

Found the place where I could hook in. This simply did not invalidate pointers to a deleted sprite and later could access stale data. I added code to clean out these pointers, so now they are null. This most likely means it will crash more often now, because instead of reading invalid data and making bogus decisions based on it, it will now outright crash in the place where the invalid access takes place, making them easier to fix.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [Shadow Warrior] [0.4.0] Crash with the Heart weapon

Post by sinisterseed »

So essentially breaking first in order to fix? I like this :D.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Shadow Warrior] [0.4.0] Crash with the Heart weapon

Post by Graf Zahl »

No, making the existing breakage show itself more clearly.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [Shadow Warrior] [0.4.0] Crash with the Heart weapon

Post by sinisterseed »

Ah, I got it backwards I guess.

I wonder what other causes for crashes are there, because they can occur under other circumstances too - see my other Random Crash topic for instance, that one was a crash I experienced while warping between levels.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Shadow Warrior] [0.4.0] Crash with the Heart weapon

Post by Graf Zahl »

Probably the same thing. The general problem here was that when the player died, the enemies' target pointers to it weren't cleared and pointed to invalid data, so depending on what that data contained it could randomly crash a lot later.

Return to “Closed Bugs [Raze]”