some test sample crash

Some test sample for iOS will crash in 0.9.1, e.g. particletest.
and both simulator and device.
However, It was fine in win32 and the old 0.9.0.
I found it may crashed due to CCLabelAtlas.
Any ideas?

Hi, red clow,
I’m very certain that all test cases were passed before version release (but only in my environment), and I run all particle tests again in 4.3 simulator just now, they work well on my machine.
My environment is
* Lion v10.7
* Xcode 4.1 build 4B110
* iOS SDK & Simulator 4.3

Do I miss anything to reproduce the crashes? Can you tell me which test cases in ParticleTest crash? And for more info in require, e.g, your ios sdk version, xcode version, ios device type & firmware version?

Thank you for your reply.

My environment :
MacBook5,2
Mac OS X Snow Leopard 10.6.8
Xcode 3.2.5
iOS SDK 4.2
iPod Touch 4 (iOS 4.3.5 8L1)

I just download the zip from google code, decompress, open test project and build it.
It works fine for all samples in the 0.9.0, but not in 0.9.1.
In 0.9.1, most samples would works, but only a few samples would crash.
It’s crash when tap the menu item of samples (e.g.ParticleTest).
The original ParticleTest sameple of Cocos2D-iPhone 1.0.1 also works fine for me.

This is the console log when running crash on my device:

Assertion failed: (0), function copyWithZone, file /Users/RC/_GameDev/Tools/Cocos2D-X/cocos2d-1.0.1-x-0.9.1/tests/test.ios/…/…/cocos2dx/cocoa/CCObject.cpp, line 34.
Program received signal: “SIGABRT”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.5 (8L1)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
kill
quit

The Debugger has exited with status 0.(gdb)

There’re many test cases in particle test, for example, “Particle Florwer”, “Particle Galaxy”, “Phoenix”, “SpookyPeas”, which case you crash in?

Oh, a strange point, unable to read symbols for libXcodeDebuggerSupport.dylib (file not found)
I check my file list in my /Developer/…./usr/lib/, and cannot find libXcodeDebuggerSupport.dylib, too. Without this file, the particle tests run well. I
m not sure whether it is a problem caused by the backward-compatibility of xcode4 to xcode3?

I can’t enter any ParticleTest example.
It’s crash when tap the main menu item.
And after I comment these lines below in ParticleDemo constructor:

CCLabelAtlas* labelAtlas = CCLabelAtlas::labelWithString(“0000”, “fonts/fps_images.png”, 16, 24, ‘.’);
addChild(labelAtlas, 100, kTagLabelAtlas);
labelAtlas~~>setPosition );
I can enter the example screen but crash soon.
I need comment these lines below in void DemoFlower::onEnter:
m_emitter = CCParticleFlower::node;
m_emitter~~>retain();
m_background~~>addChild;
m_emitter~~>setTexture( CCTextureCache::sharedTextureCache()->addImage(s_stars1) );
setEmitterPosition();

The example would works including the scrolling background but no any particle effect.
And if I tap the any button on the screen bottom.
It’s also crash.

Maybe I found why it crash.
I trace the code and found the fps_images.png load failed.
Then I compared the product file “iphone.app” between 0.9.0 and 0.9.1.
And I notice that there is no “fonts” folder in the iphone.app that built by 0.9.1.
All the fonts assets are in the root of the iphone.app.
And not just font assets, there are some .pvr and other images files in the root.
So, The problem is the file references of the project Resources.
The solution is delete all files references in the Resources folder of xcode project.
Then re-add all of them from Res folder and set “Create folder references for any added folders”.
Now the particletest works fine.

However, the “MotionStreakTest” would crash on my device.
And the font style of “FontTest” does not works at all.
But it can fixed by add the “fonts/” before every fonts name in fontList[].
I recommend double check the file references of resources.

The MotionStreakTest crash at:
bool CCMotionStreak::initWithFade(float fade, float seg, const char *imagePath, float width, float length, ccColor4B color)
{

this->schedule(schedule_selector(CCMotionStreak::update), 0); // Crash, at line 62

}

May be the function name can not be update. You can change it to other name, such as myUpdate. Somebody has resolved it by this way.

Wow, Thanks to Zhang.
The MotionStreak works now.