[Resolved] iOS EXC_BAD_ACCESS (SIGBUS) crashes on orientation change

Howdy all!

I’ve been developing an application for few months now, and all this time I’ve been using an Android phone to test it on. I recently got an apple dev license, and this is the first time I’ve been able to build for iOS.

The game uses the accelerometer and the orientation is locked on landscapeRight.

When I build for iOS, the app crashes with a sigbus error EXC_BAD_ACCESS (SIGBUS) and quits out to the menu whenever there is an orientation change of the device. This is also occurs on the Xcode iOS simulator.

This is ONLY on a change of orientation - and it only happens on iOS (doesn’t crash on Android) - and it only happens after I load in a level from the level select screen (so if I tilt the device around in the menu screens, nothing happens - but if I tilt the device around during a level OR after I’ve returned to the level select after playing a level, it crashes).

I saw thread http://developer.coronalabs.com/forum/2012/05/02/excbadaccess-sigbus-crash - and, as such, I have ascertained that it must be something going wrong with the code related to the actual gameplay (as the crash doesn’t occur when you’re in menus before gameplay begins). I did a lot of testing to try to figure out where in my code the crash was happening, and I have ascertained this:

-The game crashes after an orient event is triggered and finishes execution. After that event is triggered and the listener returns, the game crashes before the enterFrame update loop is called again.

It also worthy to note that if I leave the ipad flat on the table, I can rotate it around full 360 degrees without the game crashing (I can play every level, at a smashingly solid framerate without any memory leaks) - but as I pick it up and alter the Z axis, it crashes!

Anyone got any ideas…? [import]uid: 144339 topic_id: 30837 reply_id: 330837[/import]

This sounds like a possible bug, would you be able to file a report and let me know the number so I can bring it up in our next meeting, please? [import]uid: 52491 topic_id: 30837 reply_id: 123486[/import]

Hey Peach

I was able to resolve this issue after digging around my code for a bit.

Turns out, it was the inneractive ads that were crashing the game on an orientation change.
I’m using build 840.

I’ve read this inneractive glitch was fixed in the next build; but I’d totally recommend adding a message to the docs page or something notifying of the glitch - becaue it was pretty obscure to me the whole time! [import]uid: 144339 topic_id: 30837 reply_id: 123748[/import]

Glad to hear that; at this stage because we have a new stable out I’m not sure which way we’ll go with notes but will totally mention it in next meeting :slight_smile: Thanks. [import]uid: 52491 topic_id: 30837 reply_id: 123842[/import]

This sounds like a possible bug, would you be able to file a report and let me know the number so I can bring it up in our next meeting, please? [import]uid: 52491 topic_id: 30837 reply_id: 123486[/import]

Hey Peach

I was able to resolve this issue after digging around my code for a bit.

Turns out, it was the inneractive ads that were crashing the game on an orientation change.
I’m using build 840.

I’ve read this inneractive glitch was fixed in the next build; but I’d totally recommend adding a message to the docs page or something notifying of the glitch - becaue it was pretty obscure to me the whole time! [import]uid: 144339 topic_id: 30837 reply_id: 123748[/import]

Glad to hear that; at this stage because we have a new stable out I’m not sure which way we’ll go with notes but will totally mention it in next meeting :slight_smile: Thanks. [import]uid: 52491 topic_id: 30837 reply_id: 123842[/import]