[iminib3d] crash under OS 3.1.3

BlitzMax Forums/MiniB3D Module/[iminib3d] crash under OS 3.1.3

ima747(Posted 2010) [#1]
I have a project that works fine on OS 4, and 3.2 on ipad, and the simulators. When I try to run it on my first get iphone with 3.1.3 it crashes at startup with EXEC_BAD_INSTRUCTION saying:

Current language: auto; currently objective-c++
Warning: the current language does not match this frame.
Program received signal: “EXC_BAD_INSTRUCTION”.

the debugger points to the ending curly brace in CompareEntityOrder in global.mm which doesn't make any sense... and the thread is
0 _statuc_initialization_and_destruction_0
1 global contructors keyed to _ZN6Global5widthE
2 ??

which also doesn't make any sense...

and to top it off the demos seem to run fine... but my project is based off of a direct copy of the the project and source files used for the demos, so my settings are virtually identical... and as I mention it works fine on OS 4 and 3.2...

Quite confused, can't find any info through official or un-offical apple channels...


jhocking(Posted 2010) [#2]
I purposely haven't upgraded my phone to iOS4 and my game works fine. It's not a first gen phone though, it's a 3Gs. That means your issue is less to do with the OS version and more to do with the hardware. Do first gen phones even support 3.1.3? Are you sure you built iminib3d against that version? I sometimes forget to rebuild iminib3d along with the actual game.

One subtle change I had to make on one project was checking "Build Active Architecture Only" at the top of the target's build settings. Until I adjusted that builds on my phone were working but not builds sent to another person. The error was in LoadB3d not CompareEntityOrder however so I don't know if this has anything to do with what you're encountering.


ima747(Posted 2010) [#3]
Yea, first gen just can't get 4.0, it's 3.1.3 until it dies.

As I mentioned the example programs build and run on it fine so it's not the hardware, or OS version as such...

However my project doesn't. My project is using properly re-compuled iminib3d etc, it runs fine on my ipad, and my iphone 4, and actually now that I think of it my GF's 3GS (also OS 4...). I suspect It's a build setting causing things not to link properly on my specific project, but I have no idea what it could be specifically as I've gone through them comparing to the demos which run and can't find anything to explain it...

And the compare entity point I suspect is a result of the linking somehow being off, as it crashes before the app even fully loads, which is well before iminib3d gets inited, let alone actually starts to run... and it's not minib3d exacly, or my code since they both run fine on simulator and other devices...

It happens if I build with a target of 4.0 or 3.2 (can't drop target lower any more which is anoying...) and a base of 3.0 through 3.1.3 (tried every one recompiling the lib and it's targets as well as my project)... really confused. I don't really NEED support < 3.2/4.0 but I'm just bothered that I can't get it working and therefore miss out on a lot of potential users despite not (yet) using any 3.2/4.0 specific code/frameworks/etc.

Mainly I just want to benchmark performance on my first gen since the slower it runs the easier it is to find out where to focus to optimize...


simonh(Posted 2010) [#4]
It might be an EntityParent bug that I recently squashed. It seems to only cause a crash on a 3G.


Robert Cummings(Posted 2010) [#5]
Try building a hello world example with a sphere, then add another sphere and use entityparent to confirm the bug...


ima747(Posted 2010) [#6]
It crashes before the program even begins to run. By crashes at startup I mean it happens before any code begins to run, even the application delegate start. Maybe there's some init in the minib3d lib before that but it's before I do any parenting etc. as it's before I even init the minib3d graphics... I suspect some sort of a linker problem with the project since, as I said, the examples work, but I have no idea where to look as I've gone through all the project and target settings and can't find anything out of sorts....