Stack Overflow

BlitzMax Forums/BlitzMax Programming/Stack Overflow

_Skully(Posted 2010) [#1]
I've obviously coded a bug into TileMax thats causing a Stack Overflow. but thats the only error I get. No debug information what-so-ever. The compiler is in debug mode as well.

What conditions will cause a Stack Overflow... I would assume thats an unhandled exception?


Brucey(Posted 2010) [#2]
Inifinite recursion?


Brucey(Posted 2010) [#3]
If you run it on Mac, you'd get a pretty crash log/backtrace from the OS.

If you run it on Windows, you can use GDB to debug. It might give you a hint to the location of the problem. (it might not).


_Skully(Posted 2010) [#4]
Oh thank mother of god for backups... fwew.

All I did was a convert two methods to functions in the main encapsulation type so that it wouldn't need to be instantiated... but then I had also progressed some other areas of code that I didn't want to undo.

Why changing the methods to functions caused this error I don't know... yet. But since there is no reference to self or fields within those methods so I thought it would be safe.

Thanks for the suggestions Brucey... appreciated it.


Otus(Posted 2010) [#5]
Method calls should require slightly *more* stack space to pass the Self reference. If that was the change that triggered an overflow, there is probably something else wrong too.


_Skully(Posted 2010) [#6]
This must have been an anomalous error. I've re-converted the methods one by one and have restored all the code I created after the fact and no Stack Overflow.. eh..


Tommo(Posted 2010) [#7]
I encountered a stack overflow weeks ago, it seems impossible to find where the bug is, so I had to make a hack into debugger code to dump the calling route.
That was a nightmare. :(