Hil,
Can anyone download this simple demo and let it run on your PC, it crashes after about 7 minutes on my system.
Please report back, with Windows version please and error details.
On my PC it takes 7 mins to crash. Win 7 64bit
2,4,8,6 on the keypad, controls the bird, 'W' for wireframe mode.
Thanks all.
P.S. It needs to be kept on top and hold focus.
[attachment deleted by admin]
win xp, about 5 minutes in, no error message.
Dont know if it helps but at the time the bird was flying into a mountain and it was struggling to find a path or angle round it
That's normal its only doing simple sliding collision.
Can you leave it running a longer please? 11 mins was the max I managed till it crashed, 7 mins usually though.
Crashed in under a minute for me.
Win 7 (32 bit)
Error message?
what I meant was mine crashed at 5 mins in, window closed, no error message
Ah I see, thank you, this error is proving to be a real pain to find. :S
Same here, no message just air.exe has stopped working. The budgie was under water at this point.
Weird, thanks for the test though. :)
Yes, crash after 5 minutes too - Windows 7 x64
as is usual, ntdll.dll is the faulting module.
Oops, too quick there. That's may'be invalid pointer, I think.
couple of seconds. STACK OVERFLOW. Are you recursively calling a function?
Yes, the entity system and the quaternion/matrix functions are all recursive. Strange thing though, if I do the same code, via FreeBasic there is no crash. Very strange indeed.
BTW: The bird is controlled by the keypad Ocean, still 10secs is pretty bad.
Deep recursive is not good in GLBasic sadly. I had some recursive code that kept crashing on different places on different computers. Rewrote without recursion and it works fine ever since.
Sounds like a small stack area... :)
Recursion does work okay - just need to make sure that it doesn't go too far...
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.
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.
Thanks for the tip. I'll add that to my testing.
Crashed after about 1min on Win7 64bit.
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]
From my tests, I think SHOWSCREEN is leaking for some reason - I've emailed Gernot about it...
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?
Yes, quite possible
I presume the calling convention is correct ?
your C functions are not declared as "__stdcall", so remove that from the IMPORT or add it to the C functions.
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: