Something in map20 of Community Chest 4 is causing a crash.

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Something in map20 of Community Chest 4 is causing a cra

Post by Graf Zahl »

I cannot remember why I moved it but there must have been some reason for it. At the very least, P_FreeLevelData needs to clear spechit as well because whatever is in there at that point will inevitably become invalid.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Something in map20 of Community Chest 4 is causing a cra

Post by _mental_ »

Graf Zahl wrote:P_FreeLevelData needs to clear spechit as well because whatever is in there at that point will inevitably become invalid.
I was thinking about the same. I fear that it may hide an issue when spechit should be cleared in other cases, not on the first tick.
Anyway, clearing temporary data between maps seems reasonable.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Something in map20 of Community Chest 4 is causing a cra

Post by Graf Zahl »

I'll have a closer look this evening. Right now I cannot say anything more.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Something in map20 of Community Chest 4 is causing a cra

Post by Graf Zahl »

Looking through the code I think I remember what was the problem: PIT_CheckThing is doing a lot of stuff it shouldn't, if it had been cleanly implemented. Unfortunately it is so full of side effects and bad behavior that it can easily result in a recursive call of P_CheckPosition and leave a filled spechit array behind. And this can turn nasty if there is a portal in the set.
Moving the two array clears below the BlockThingsIterator loop was supposed to clear this residual garbage. Unfortunately this does not account for the exit conditions above and still leaves some garbage behind in other cases.

I wish this could be solved the clean way, i.e. by making the spechit array local to the current function call. Sadly with all the side effects that need to be considered here this is not possible. For example, when something along the way results in a teleport this needs to clear spechit of the current P_CheckPosition call.
This entire code is a mess beyond hope that cannot be fixed because it's one cornerstone of how Doom works.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Something in map20 of Community Chest 4 is causing a cra

Post by Major Cooke »

Meaning that in order to fix it, one would have to carve out at least half of the entire source code potentially?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Something in map20 of Community Chest 4 is causing a cra

Post by Graf Zahl »

To fix the movement code you'd have to write a new engine. The original Doom code was so poorly conceived that most attempts at sanitizing it are doomed to fail because they'd break the very essence of it.
Post Reply

Return to “Closed Bugs [GZDoom]”