Crash test

Previous topic - Next topic

bigsofty

I don't think there should be a great need for a large stack size in the demo, the recursion is mainly used in the parent child relationship within the entity tree(which is basically quaternions and matrices). As the demo does not use any child entities, I am at a bit of a loss. Still, I see no harm in looking for a stack command line option to try it any-ways.

Thanks for everyone's help and suggestions.

Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Slydog

You could add a STATIC recursion count variable in the function to limit how deep it goes.
(Add 1 when enter function, subtract 1 when exit function, if > 30 then . . .)
May not work for a release, but may let you know that is the problem.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

bigsofty

Thanks for the tip. I'll add that to my testing.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Ian Price

Crashed after about 1min on Win7 64bit.
I came. I saw. I played.

bigsofty

OK, this is really strange. I cut code down to almost nothing and I am still getting the same error.

What I have here is a simple IMPORTed call to a C function(which does nothing). A main loop that calls it many times. Its basically a cut down version of how the main project runs.

Yet, if you run Task Manager, there is a memory leak and eventually the same crash occurs as in the larger project.

I can't see the problem, I think my limited C knowledge may be failing me here.  :noggin:

Any-ways, if you could download this project, run it with Task Manger visible, to observe the memory leak and wait for the crash.

Oh, you will need to change the include path in the 'cmp' command line option within the project options (Currently -I"C:\Users\Dad\Desktop\test2\src").

Thanks for your help.

[attachment deleted by admin]
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

MrTAToad

From my tests, I think SHOWSCREEN is leaking for some reason - I've emailed Gernot about it...

bigsofty

I don't think it's SHOWSCREEN as I used my own GL 'flip' as part of the debug process and it had the same result. I believe the problem may lay with the IMPORT command itself leaking. Possibly pushing double return addresses onto the stack before calling?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

MrTAToad

#22
Yes, quite possible

I presume the calling convention is correct ?

Kitty Hello

your C functions are not declared as "__stdcall", so remove that from the IMPORT or add it to the C functions.

bigsofty

Aha, I had assumed that the default calling convention was stdcall, this was a mistake.

Thanks to Gernot and everyone who helped me in this thread.  :good:

Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)