What exactly is Stackoverflow?
What exactly is Stackoverflow?
I am having trouble with Stack overflow and I dont know where to look for the problem.
Thing is, I made a build of my game, and it works fine when i test it. However, another who tried it said that he gets Stack Overflow during the game.
First time at level 3, and then after that he have started getting it at levels 1 and 2 already, not getting even to the 3 anymore.
That would sound like something stays even after the program have crash exited already.
Thing is, I made a build of my game, and it works fine when i test it. However, another who tried it said that he gets Stack Overflow during the game.
First time at level 3, and then after that he have started getting it at levels 1 and 2 already, not getting even to the 3 anymore.
That would sound like something stays even after the program have crash exited already.
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: What exactly is Stackoverflow?
What is the stack size set to in the icon info?
I'm on registered MorphOS using FlowStudio.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: What exactly is Stackoverflow?
I guess he means a stack overflow within Hollywood's virtual machine. It happens when the stack overflows, i.e. when there are too many elements on the stack, e.g. during a function that repeatedly recurses and pushes parameters on the stack.
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: What exactly is Stackoverflow?
Sorry, I gave you the solution without first answering the question. The stack is where all local variables and function return addresses are stored.
Also, if you run your Hollywood script from a CLI, the script gets the CLI stack allocation size set by the AmigaDOS stack command. If you run from Workbench it allocates a new stack set by the size listed in the icon. If that weren't complex enough, AmigaOS 4.x can use a "stack cookie" to replace the other approaches.
Also, if you run your Hollywood script from a CLI, the script gets the CLI stack allocation size set by the AmigaDOS stack command. If you run from Workbench it allocates a new stack set by the size listed in the icon. If that weren't complex enough, AmigaOS 4.x can use a "stack cookie" to replace the other approaches.
I'm on registered MorphOS using FlowStudio.
Re: What exactly is Stackoverflow?
Okay, thanks, this helps.
My best case is it has to do with my big table that has functions and other parts of the same table stored in it, it is a terrible mess. I just made a version which keeps loading pieces from files, maybe that corrects it.
My best case is it has to do with my big table that has functions and other parts of the same table stored in it, it is a terrible mess. I just made a version which keeps loading pieces from files, maybe that corrects it.
Re: What exactly is Stackoverflow?
I Got error produced by that other user and StackOverflow happens on following 3 lines:
Error indicates it would be the first line of those three, hence I am suspecting it is caused by ListItems command.
Strange thing is, that the Table it is doing the List Items should be about following: (I checked this with debugprint, but of course cant be exactly sure what he did, but this should be it based upon where it crashes)
Code: Select all
For n = 0 To ListItems(T_Code)-1
If HaveItem(T_Code[n], "text") And T_Code[n].text = Labelname Then foundn = n
Next
Strange thing is, that the Table it is doing the List Items should be about following: (I checked this with debugprint, but of course cant be exactly sure what he did, but this should be it based upon where it crashes)
Code: Select all
T_Code = {random = 0, CurrentLine=unknown number,
[0] = {command="GO TO", text="Go To <MAIN>", Indent=" "}
[1] = {command="Move Forward", text="Move Forward", indent=" "}
[2] = {command="Add Label", text="MAIN", indent=""}
}
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: What exactly is Stackoverflow?
It's very likely a bug in your code, like some recursion gone wrong.
Re: What exactly is Stackoverflow?
By the way, i changed the ListItems() command to TableItems() and he got stackoverflow on different place and only once anymore.
So it seems it really has to do with the listitems command somehow.
Dont know if issue got fixed now that i recompiled it using 7.1 as the one who was playing it, already got through the game, so i doubt he will be using the newly compiled version.
So it seems it really has to do with the listitems command somehow.
Dont know if issue got fixed now that i recompiled it using 7.1 as the one who was playing it, already got through the game, so i doubt he will be using the newly compiled version.
Re: What exactly is Stackoverflow?
Are you sure you're not calling some functions recursively "deeper and deeper" without them returning first?
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: What exactly is Stackoverflow?
As an off topic aside note, it's quicker to use a reverse lookup table to indicate which item in T_Code is indicated. Linear searches are more expensive.
I'm on registered MorphOS using FlowStudio.