GLBasic forum

Main forum => GLBasic - en => Topic started by: AlienMenace on 2011-Nov-28

Title: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Nov-28
Okay, well this is rather fun. I have finished  my game, compiled it for HP Touchpad and tested (submitted to the store as well)... has never crashed on that platform once. Very stable. Compiled it for Kindle Fire... runs good... no crashes or anything like that. Tested on Android, a little slow but stable... no crashes. Now today I compile it for my iPad2 and it runs for a about 30 seconds then crashes each and every time. Same code, nothing has changed at all between my Touchpad (never crashes) build and my iPad build (crashes every time). XCode is kind enough to report back the following:

SPRCOLL:
0x00007630  <+0000>  push   {r4, r7, lr}
0x00007634  <+0004>  mov   r12, r0
0x00007638  <+0008>  ldr   r0, [pc, #60]   ; 0x767c <_ZN11__GLBASIC__7SPRCOLLEiiiiii+76>
0x0000763c  <+0012>  add   r7, sp, #4   ; 0x4
0x00007640  <+0016>  sub   sp, sp, #12   ; 0xc
0x00007644  <+0020>  add   lr, pc, r0
0x00007648  <+0024>  ldr   r0, [lr]
0x0000764c  <+0028>  mov   r4, r1
0x00007650  <+0032>  str   r2, [sp]
0x00007654  <+0036>  ldr   r1, [sp, #28]
0x00007658  <+0040>  ldr   r2, [sp, #24]
0x0000765c  <+0044>  str   r1, [sp, #8]
0x00007660  <+0048>  str   r2, [sp, #4]
0x00007664  <+0052>  mov   r1, r12
0x00007668  <+0056>  mov   r2, r3
0x0000766c  <+0060>  mov   r3, r4
0x00007670  <+0064>  bl   0x21ec4 <_ZN14OpenGLRainbows15SpriteCollisionEiiiiii>
0x00007674  <+0068>  sub   sp, r7, #4   ; 0x4
0x00007678  <+0072>  pop   {r4, r7, pc}
0x0000767c  <+0076>  andeq   r3, sp, r12, asr r7

I ran into this issue several months ago with a completely different build (I rewrote it to avoid using anim-to-nonanim sprite collisions checking) but have focused on porting over to Android and now I am back to iPad and am trying to build my game for submission to the appstore. Obviously, this is a show stopper.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Nov-28
I replaced all my calls to the built-in SPRCOLL with this routine:

Code (glbasic) Select

FUNCTION SPRITECOLL: id1#, x1#, y1#, id2#, x2#, y2#
LOCAL xw1, yh1, xw2, yh2
GETSPRITESIZE id1#, xw1, yh1
GETSPRITESIZE id2#, xw2, yh2

IF BOXCOLL(x1#, y1#, xw1, yh1, x2#, y2#, xw2, yh2)
RETURN 1
ELSE
RETURN 0
ENDIF

ENDFUNCTION


Not optimal as not all my objects are square but so far I was able to play an entire game (about 10 minutes or so) without any lock ups. More testing...
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: Kitty Hello on 2011-Nov-28
Can you post the console output, please?
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Nov-28
Not much information in there when it freezes but here you go:

Quote
[Session started at 2011-11-28 08:54:08 -0800.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Fri Oct 22 04:12:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys000
Loading program into debugger...
Program loaded.
target remote-mobile /tmp/.XcodeGDBRemote-2818-25
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running...
[Switching to thread 11779]
[Switching to thread 11779]
sharedlibrary apply-load-rules all
continue
2011-11-28 08:55:16.472 iPhone[1124:707] *** __NSAutoreleaseNoPool(): Object 0x409c10 of class NSCFString autoreleased with no pool in place - just leaking
init with frame.
Scaleing available: self.contentScaleFactor = 1.000000
desktop backing: 768 x 1024
mainScreen: 768x1024
slaunch ok
-applicationDidBecomeActive    -> unpause
timer
rbow
rbow init
Rbow::SetScreen( 768,1024)
get accurate timer - 1st call
flip - 1st call
BGRA ext supported
Texture size limit: 2048
init fbo
2D VP
OGRB init [OK]
Cptn
Network
Input
Window mode
Create DXin
reptr
getexe
cd
set cdir to: /var/mobile/Applications/176217F3-D56E-4C49-856F-E41140369D6B/iPhone.app
exepath=curdir= /var/mobile/Applications/176217F3-D56E-4C49-856F-E41140369D6B/iPhone.app
AudioStreamBasicDescription:  2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved
Init Finalized
Rbow::SetScreen( 768,1024)
set cdir to: Media
Error opening file: -43
Error opening file: -43
Error loading file info: -43
Error loading looping file info: -43
Can' init audio. Retcode: -43
request: fopen("/var/mobile/Applications/176217F3-D56E-4C49-856F-E41140369D6B/Documents/qx_prefs_an.dat", "rb") failed
Loading Music: sound/Track.mp3
[Switching to thread 13059]
Status: 0
[Switching to thread 13059]
Program received signal:  "EXC_BAD_ACCESS".
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3 (8F191)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: Kitty Hello on 2011-Nov-28
Make a very small project that crashes and send it to me :(
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: Omadan on 2011-Nov-28
Now that you are onto this I would like to add that the latter also happened to me. Any animcolls was crashing the program. I replaced allmy collisions with boxcolls and game had no problems at all. If I have time to compile something I will Gernot, anything to help you and your fabolous work :) Cheers

regards
- Joe
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Nov-29
Sent PM.

TY.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Nov-30
Well, since I haven't heard back from you I will just post the project here. This project is nothing fancy and pretty straight-forward. It locks up pretty much every time on my iPad2 after the first few seconds.

[attachment deleted by admin]
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: Kitty Hello on 2011-Nov-30
Found it last night. It's a bug. Update soon.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Nov-30
Sir... you are just full of surprises!  :)
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Dec-03
Add the Kindle Fire to this list as well... same exact issues as the iPad with collisions crashing. Replaced SPRCOLL cammands with my own BOXCOLL-based commands, now.. no more crashing. Any ETA on a fix?

Thank you.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: MrTAToad on 2011-Dec-03
Try the update
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: spicypixel on 2011-Dec-03
Oooh this sounds perfect I was getting crashes which I could only put down to collisions also so I'm hoping there is an update for when I webcheck :D
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Dec-13
Kindle Fire collisions still crashing, mouse coordinates still wrong and screen size still reports incorrect size.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: Kitty Hello on 2011-Dec-13
clean the project and rebuild it.
If it still crashes, give an example program. Or is it still the same one?
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Dec-15
Did that, the Kindle Fire has SERIOUS problems with GLB.

I am placing the marquee at a Y value of 0 at the top of the screen, the control panel at the bottom is placed at Y=screen height-(sprite height). Sometimes you run it, it looks fine but the mouse co-ords read low, then at other times, the top sprite that is placed at Y=0 is pushed up and pixels are cut off (it thinks 0 is like -10 or something). When this happens, the mouse co-ords read high.

The sprites collisions still cause crashes... I have only noticed this on Kindle Fire, not my other android tablets and the iPad now seems fine after the update.

Lastly, the sound is still jacked up on all my Andoid tablets.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: Wampus on 2011-Dec-15
Quote from: AlienMenace on 2011-Dec-13
screen size still reports incorrect size.

In your AndroidManifest.xml file, have you tried changing android:anyDensity to true? This should launch any app in the native resolution. It might help.

I'm not sure what you mean by the sound is jacked up. I notice from the error report you posted that you were trying to play an MP3 file. Is that what you mean? In case you're still trying to do that, use OGG file format instead and you should be OK.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: AlienMenace on 2011-Dec-16
No, I think it may still be a sound buffer issue. The sounds are choppy and seem to cause a bit of a program delay when too many are played at once. Already tried the anydensity setting. There is a 11-pixel bar at the bottom of the screen for the pop-up menu, possibly this is interfering. The Thrive also has a toolbar across the bottom but screens and mouse co-ords are fine on that device.
Title: Re: GLB SPRCOLL collision causes iPad to crash...
Post by: Kitty Hello on 2011-Dec-16
what sample format are you loading? Try 44KHz, 16 bit (mono/stereo).