Hi,
I am having a strange issue. I recently did some updates to my application and submitted to the appstore a new version of the app. The core stuff of my app was not changes I just added social stuff (facebook twitter) and a new screen that I build with cocosbuilder. Before submitting my app I did a full test on my test group of devices (iphone 3g, 4s, ipad) everything works. I submitted my app it got approved and the update rolled out. Now I updated the application and I find out that it crashes right on my splash screen which is a ccbi file.Here is the device crash log:
0 Color-Shift 0x000dd71c cocos2d::extension::CCBReader::readFloat() (CCBReader.cpp:422)
1 Color-Shift 0x000dde52 cocos2d::extension::CCBReader::readKeyframe(int) (CCBReader.cpp:648)
2 Color-Shift 0x000dd9ae cocos2d::extension::CCBReader::readNodeGraph(cocos2d::CCNode*) (CCBReader.cpp:509)
3 Color-Shift 0x000ddc20 cocos2d::extension::CCBReader::readNodeGraph(cocos2d::CCNode*) (CCBReader.cpp:586)
4 Color-Shift 0x000dd342 cocos2d::extension::CCBReader::readFileWithCleanUp(bool) (CCBReader.cpp:689)
5 Color-Shift 0x000dd2ec cocos2d::extension::CCBReader::readNodeGraphFromData(cocos2d::extension::CCData*, cocos2d::CCObject*, cocos2d::CCSize const&, cocos2d::extension::CCBAnimationManager**) (CCBReader.cpp:230)
6 Color-Shift 0x000dd1aa cocos2d::extension::CCBReader::readNodeGraphFromFile(char const*, cocos2d::CCObject*, cocos2d::CCSize const&, cocos2d::extension::CCBAnimationManager**) (CCBReader.cpp:213)
7 Color-Shift 0x000dd0a4 cocos2d::extension::CCBReader::readNodeGraphFromFile(char const*, cocos2d::CCObject*) (CCBReader.cpp:192)
8 Color-Shift 0x000fdb50 IntroScene::init() (IntroScene.cpp:55)
Now googling I found that there was a memory alignment issue that was fixed in the branch on git. So I copy and pasted this:
float * pF = (float*)(this->mBytes + this->mCurrentByte);
float f = 0;
// N.B - in order to avoid an unaligned memory access crash on 'memcpy()' the the (void*) casts of the source and
// destination pointers are EXTREMELY important for the ARM compiler.
//
// Without a (void*) cast, the ARM compiler makes the assumption that the float* pointer is naturally aligned
// according to it's type size (aligned along 4 byte boundaries) and thus tries to call a more optimized
// version of memcpy() which makes this alignment assumption also. When reading back from a file of course our pointers
// may not be aligned, hence we need to avoid the compiler making this assumption. The (void*) cast serves this purpose,
// and causes the ARM compiler to choose the slower, more generalized (unaligned) version of memcpy()
//
// For more about this compiler behavior, see:
// http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3934.html
memcpy((void*) &f, (const void*) pF, sizeof(float));
this->mCurrentByte += sizeof(float);
return f;
And compiled tested and resubmitted to apple with a request to expedite to fix the runtime crash. And guess what the app got approved processed and when I download the app still crashes:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: EXC_ARM_DA_ALIGN at 0x1f0807c9
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 Color-Shift 0x000f971c cocos2d::extension::CCBReader::readFloat() (CCBReader.cpp:422)
1 Color-Shift 0x000f9e52 cocos2d::extension::CCBReader::readKeyframe(int) (CCBReader.cpp:648)
2 Color-Shift 0x000f99ae cocos2d::extension::CCBReader::readNodeGraph(cocos2d::CCNode*) (CCBReader.cpp:509)
3 Color-Shift 0x000f9c20 cocos2d::extension::CCBReader::readNodeGraph(cocos2d::CCNode*) (CCBReader.cpp:586)
4 Color-Shift 0x000f9342 cocos2d::extension::CCBReader::readFileWithCleanUp(bool) (CCBReader.cpp:689)
5 Color-Shift 0x000f92ec cocos2d::extension::CCBReader::readNodeGraphFromData(cocos2d::extension::CCData*, cocos2d::CCObject*, cocos2d::CCSize const&, cocos2d::extension::CCBAnimationManager**) (CCBReader.cpp:230)
6 Color-Shift 0x000f91aa cocos2d::extension::CCBReader::readNodeGraphFromFile(char const*, cocos2d::CCObject*, cocos2d::CCSize const&, cocos2d::extension::CCBAnimationManager**) (CCBReader.cpp:213)
7 Color-Shift 0x000f90a4 cocos2d::extension::CCBReader::readNodeGraphFromFile(char const*, cocos2d::CCObject*) (CCBReader.cpp:192)
8 Color-Shift 0x00119b50 IntroScene::init() (IntroScene.cpp:55)
Any ideas what I should do? Anyone else recently submitted an app using cocos2d-2.0-x-2.0.4?
Thanks