Program just quits

Blitz3D Forums/Blitz3D Programming/Program just quits

cyberyoyo(Posted 2007) [#1]
Hi
It's me again with one of my strange bugs.
Now the program just quits to window without error message or anything, this happens even if I put debug on. And it happens fairly often I'm wondering if it's not a memory problem.
I'm not going to ask you if you have an idea what's causing this but if you know some way to track the error or problem, maybe there are some debug options that I don't know or maybe another IDE that could help me fix that?(I'm using the default IDE)


Stevie G(Posted 2007) [#2]
I'm guessing you're exiting the program prematurely.

Can you show us a cut down version of the code where the problem still exists.


MadJack(Posted 2007) [#3]
wWhat sort of stress are you putting on your graphics card when it quits?


Rob Farley(Posted 2007) [#4]
Remove the line:

If Rand(0,10000) = 0 Then End

This should solve your problem.

Alternatively post up some code so we might actually have some idea of where the problem lays.


Shambler(Posted 2007) [#5]
I sometimes put breakpoints in key areas of the program e.g.

text 0,0,"BreakPoint 1 reached OK"
flip
waitkey()



cyberyoyo(Posted 2007) [#6]
It's now a 6000+ lines framework and the problem could occur practically anywhere in the code so I can't really post some code.
I tediously checked all the code for possible "End " statements that I could have forgotten during a particular test, but there are none.
I'll try the breakpoint thing, but it's a bit useless if the program quits. It would be much better if I could save a logfile following the run of the program does that exist? If not someone could create a library that enables this, it would be very useful


slenkar(Posted 2007) [#7]
the same problem used to happen to me, but I found out it was the fault of the power supply unit for the PC


Gabriel(Posted 2007) [#8]
If it only happens in debugmode and it quits without an error, it's probably a stack overflow, and it's probably caused by debuglog'ing in an infinite or recursive loop.


Stevie G(Posted 2007) [#9]
What I do sometimes is send a relevant message to the debug log every time you call some of the less frequent functions and from there you can see where it stops and where to start looking.

Going back to a previous working version should have been an option here. If you don't have some form of version control then it's worth considering for the future.

Stevie


jfk EO-11110(Posted 2007) [#10]
And make sure you're not using more vram than you got. Although theoreticly this should be emulated AFAIK, I also had straight crashes this way.


cyberyoyo(Posted 2007) [#11]
Okay I feel stupid now :(
I found out I had left a "End " statement in a minor include file, I forgot to check.
Anyway it would still be interesting if we could write to a log file.


Matty(Posted 2007) [#12]
You can write to a log file, you just need to do it yourself.


jfk EO-11110(Posted 2007) [#13]
those include files again.. An IDE should allow to auomaticly open all include files with the project, as well as to search across all files. Then again, "End" is hard to find since there is also endif, end function etc. Maybe you should use

End ; (really!)

instead ^^