Trashed stack + Random Errors

BlitzMax Forums/BlitzMax Programming/Trashed stack + Random Errors

Damien Sturdy(Posted 2007) [#1]
Hi All...

Due to the nature of the problem and the project involved, it's difficult to post any code showing the problem- forgive me for that! I'm posting now so any ideas you have can be looked at when I get back home to the code.

What I am experiencing is random crashes inside blitzmax. Debuglog confirms that these crashes are indeed happening where the debugger says (I used to have issues whereby it would hilight the wrong line...)

What can cause this to start happening?

I'm talking about max crashing out on a line as simple as;

"Writeline Out,"moooo"

Whereby Out is valid and the previous line, also a writeline, succeeded.

If i re-run, i'll get the crash at a completely different line somewhere in my main loop, run a third time and it doesn't even open the file to start writing, a fourth, something completely different..

I'll work on trying to get sample code later- its going to be difficult :)

Any ideas? The stack seems to be getting trashed to me....


tonyg(Posted 2007) [#2]
Could it be a memory overlay or corruption issue? The random nature suggests Bmax is reading from memory which has been blatted by someone else OR Blitzmax is looking in the wrong place for somethinh. Not sure what you do about that exept check what else is running and/or check it out on another system.


Paposo(Posted 2007) [#3]
Hello.

You manage pointers in app?


Damien Sturdy(Posted 2007) [#4]
Pointers and C++ are both in use, though have not changed recently. I simply added a few more "WriteLine" functions to the sourcecode and the whole thing started falling apart. This code has been thoroughly tested.

of course, once I find the point in code where everything starts breaking, solving the issue will be a little easier.

It certainly sounds like an incorrect pointer being opperated on at the moment...?


Paposo(Posted 2007) [#5]
Yes. It sounds like an incorrect pointer.

Revise the writes in any memory position, the length of allocated memory and increments or decrements of pointers.
Test any code with pointers are very hard and not sure.

Bye,
Paposo


Damien Sturdy(Posted 2007) [#6]
I tracked the problem down.

There was a destructor getting called when it shouldn't have, and the problem was caused by a "getname()" function haha.

Strange behavior! Problem solved :)