[ACC 135] Possible Stack Management Problem

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
MartinHowe
Posts: 2056
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

[ACC 135] Possible Stack Management Problem

Post by MartinHowe »

In a WAD that I am making, there is a function that maintains part of the map state; it runs every second or so by delaying and restarting.

If the subfunctions it uses are left as functions, the bug manifests - local variables get trashed, including for-loop control variables (leading to a "runaway script" error). If I manually inline the functions and change the variable names to be unique, the bug does not manifest. The attachment includes a text file with a more detailed description.

Has anybody seen this before?

EDIT: Happens with 2.1 as well as 96.
User avatar
MartinHowe
Posts: 2056
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Post by MartinHowe »

I've had a look at the generated code in one of the problem areas, by using the debug file option of ACC, and it doesn't look like it is doing anything it should not. Of course, it could be somewhere else, but could it be a problem somewhere in ZDoom, rather than in ACC?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

If it is a stack problem it is not in ACC. That is done entirely in ZDoom.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Fixed. The problem was caused by having one function call another function for its result. The VM miscalculated the address of the first function's local variables after it returned from the second function. To reiterate what Graf said, this is a problem with ZDoom and not with ACC.
User avatar
MartinHowe
Posts: 2056
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Post by MartinHowe »

At last! Now I can go back and re-modularise my code :)

Thanx, Randy
Post Reply

Return to “Closed Bugs [GZDoom]”