My app crash

Previous topic - Next topic

ampos

Strange, my current app just crash. I am running it and the Win app close with system error; GLB debugger dont get it. The app just crash and the Windows screen shows a msg saying "that program has crashed!" (I promise to take a screen shoot next time)

The strange is that in Windows mode I got the crash 1 out of 20 times I run it, but the iOS version crash to desktop 1 out of... 5 perhaps.

I have no idea how to replicate it, as I can not see any error in GLB and also I dont see any pattern on app crashes. Once it crashed when XCode was on, and a error did show (not remember what, but was not very explicit).

Any idea how to trace it?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Slydog

#1
I hate crashes without errors!
Could be an array bounds issue, I think some of my crashes traced back to those.

Could try putting in a start of function log (and maybe an end of function log) to determine which function is crashing, like:

Code (glbasic) Select
FUNCTION Start:
  LOG(">Start")
  NextFunction()
...
  LOG("<Start")
ENDFUNCTION

FUNCTION NextFunction:
  LOG(">NextFunction")
...
  LOG("<NextFunction")
ENDFUNCTION

FUNCTION LOG: string$, b_crlf% = TRUE, b_time% = TRUE
STATIC datetime% = -1
LOCAL elapsed#
IF datetime <0  THEN datetime = GETTIMERALL()
IF string$ = "RESET" THEN datetime = GETTIMERALL()
elapsed = (GETTIMERALL() - datetime) / 1000.0
?IFDEF WIN32
IF b_time = TRUE THEN DEBUG "[" + FORMAT$(8, 3, elapsed) + "] "
DEBUG string$
IF b_crlf = TRUE THEN DEBUG "\n"
?ELSE
INLINE
STDOUT(string_Str);
ENDINLINE
?ENDIF
ENDFUNCTION


Then run your program and check your debug window or iDevice logs to see the last entry, which should be the crashing function. 
The LOG() function could also be used to check your timing if needed.

[Edit]
Forgot to add, then when you find the function, use the LOG() again to further narrow down the function's commands to see how far you get inside the function.

[Edit 2]
Also, I think I had crashes when using TYPES and not referencing the member properly or something, but just the parent type.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

ampos

What really bugs me is that I can run the game for minutes with no crashes or just seconds...

I am going to change completly my ball2brick collision system, as it seems to be something related  to this. This, or touching at (almost) the same time 2 bricks and playing 2 sounds at (almost) the same time.

Also, my on-my-mind new collision system seems better instead of current (more efficient and more clean).

If the error persist, I will use your log function. Thanks anyway.
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Slydog

#3
Hmm, I don't think it would crash if you tried playing the same sound twice at the same time, without enough buffers allocated, it should just either ignore the 2nd request, or replace the 1st sound.  But if you don't have more than one buffer allocated, you could try more.
Code (glbasic) Select
LOADSOUND file$, num%, buffers%

Or, do you delete your bricks from an array when they are hit, or just unflag them as 'active' in a TYPE somewhere?
I wonder, if you are deleting them, and two are being hit at the same time / frame, that somehow your array delete handling has a bug where the 2nd delete is using the wrong array position because the 1st delete changed the array dimensions.  Just a thought.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

ampos

Nah, it is lad
  • [y].brick where .brick=0 if there is no brick. That's why I don't understand what is happening.
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE