intergrate my_project frome 0.11.0 to 0.12.0 crash at CCPoolManager vector push_back?

We know that 0.12.0 fix the bug when using dynamic_cast cocos is unstable on android. I occur that problem so I intergrate my project to 0.12.0 hopeful for fix the problem.
However when I launch the game , it crashed at once.
Following the logcat:

03-07 10:48:43.097: I/DEBUG(16108): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-07 10:48:43.097: I/DEBUG(16108): Build fingerprint: 'google/passion/passion:2.3.3/GRI40/102588:user/release-keys'
03-07 10:48:43.097: I/DEBUG(16108): pid: 17561, tid: 17561  >>> com.netm.game <<<
03-07 10:48:43.097: I/DEBUG(16108): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000018
03-07 10:48:43.097: I/DEBUG(16108):  r0 00000014  r1 beab2fb0  r2 00000014  r3 00000014
03-07 10:48:43.097: I/DEBUG(16108):  r4 002999b0  r5 00000000  r6 00000004  r7 000aafa5
03-07 10:48:43.097: I/DEBUG(16108):  r8 00000000  r9 0000ce60  10 beab3144  fp 00000001
03-07 10:48:43.097: I/DEBUG(16108):  ip 00000000  sp beab2fa0  lr 808ffeb7  pc 809005b6  cpsr 80000030
03-07 10:48:43.097: I/DEBUG(16108):  d0  3835353531353034  d1  2f656d61672e6d6d
03-07 10:48:43.097: I/DEBUG(16108):  d2  0063002f00610065  d3  006e002e006d002e
03-07 10:48:43.097: I/DEBUG(16108):  d4  002e006d00740065  d5  0065006d00610067
03-07 10:48:43.097: I/DEBUG(16108):  d6  00620069006c002f  d7  00620069006c002f
03-07 10:48:43.097: I/DEBUG(16108):  d8  0000000000000000  d9  0000000000000000
03-07 10:48:43.097: I/DEBUG(16108):  d10 0000000000000000  d11 0000000000000000
03-07 10:48:43.097: I/DEBUG(16108):  d12 0000000000000000  d13 0000000000000000
03-07 10:48:43.097: I/DEBUG(16108):  d14 0000000000000000  d15 0000000000000000
03-07 10:48:43.097: I/DEBUG(16108):  d16 adec503840010540  d17 3fe999999999999a
03-07 10:48:43.097: I/DEBUG(16108):  d18 42eccefa43de3400  d19 3fbc71c71c71c71c
03-07 10:48:43.097: I/DEBUG(16108):  d20 4008000000000000  d21 3fd99a27ad32ddf5
03-07 10:48:43.097: I/DEBUG(16108):  d22 3fd24998d6307188  d23 3fcc7288e957b53b
03-07 10:48:43.097: I/DEBUG(16108):  d24 3fc74721cad6b0ed  d25 3fc39a09d078c69f
03-07 10:48:43.097: I/DEBUG(16108):  d26 0000000000000000  d27 0000000000000000
03-07 10:48:43.097: I/DEBUG(16108):  d28 0000000000000000  d29 0000000000000000
03-07 10:48:43.097: I/DEBUG(16108):  d30 0000000000000000  d31 0000000000000000
03-07 10:48:43.097: I/DEBUG(16108):  scr 60000012
03-07 10:48:43.127: I/DEBUG(16108):          #00  pc 001005b6  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.127: I/DEBUG(16108):          #01  pc 000ffeb2  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.127: I/DEBUG(16108):          #02  pc 000ff85a  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.127: I/DEBUG(16108):          #03  pc 000ff942  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.127: I/DEBUG(16108):          #04  pc 000ff91c  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.127: I/DEBUG(16108):          #05  pc 00102e1a  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.127: I/DEBUG(16108):          #06  pc 001406dc  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108):          #07  pc 000cb4c2  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108):          #08  pc 000cb386  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108):          #09  pc 000cc2f8  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108):          #10  pc 000cc34c  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108): code around pc:
03-07 10:48:43.137: I/DEBUG(16108): 80900594 fb50f000 1c189b03 bd00b005 9001b082 
03-07 10:48:43.137: I/DEBUG(16108): 809005a4 1c189b01 4770b002 b083b500 91009001 
03-07 10:48:43.137: I/DEBUG(16108): 809005b4 685a9b01 689b9b01 d00f429a 1c199b01 
03-07 10:48:43.137: I/DEBUG(16108): 809005c4 685a9b01 1c089b00 1c1a1c11 fb6af000 
03-07 10:48:43.137: I/DEBUG(16108): 809005d4 685b9b01 9b011d1a e00b605a 1c189b01 
03-07 10:48:43.137: I/DEBUG(16108): code around lr:
03-07 10:48:43.137: I/DEBUG(16108): 808ffe94 91009001 2b009b00 9b00d00c f0021c18 
03-07 10:48:43.137: I/DEBUG(16108): 808ffea4 9b01ff91 32141c1a 1c10466b f0001c19 
03-07 10:48:43.137: I/DEBUG(16108): 808ffeb4 e000fb7b b00346c0 46c0bd00 b083b500 
03-07 10:48:43.137: I/DEBUG(16108): 808ffec4 91009001 1c189b01 ff86f7ff 9b001c02 
03-07 10:48:43.137: I/DEBUG(16108): 808ffed4 d80b429a 447b4b13 4b131c19 1c1a447b 
03-07 10:48:43.137: I/DEBUG(16108): stack:
03-07 10:48:43.137: I/DEBUG(16108):     beab2f60  0000002b  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f64  002999e4  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f68  00000004  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f6c  80900e63  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108):     beab2f70  00000000  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f74  002999e4  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f78  beab3144  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f7c  8090063b  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108):     beab2f80  80a3888c  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f84  002999e4  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f88  00000004  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f8c  808fff43  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.137: I/DEBUG(16108):     beab2f90  00000000  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f94  002999e4  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f98  df002777  
03-07 10:48:43.137: I/DEBUG(16108):     beab2f9c  e3a070ad  
03-07 10:48:43.137: I/DEBUG(16108): #00 beab2fa0  beab2fb0  
03-07 10:48:43.137: I/DEBUG(16108):     beab2fa4  00000014  
03-07 10:48:43.137: I/DEBUG(16108):     beab2fa8  002999d0  
03-07 10:48:43.137: I/DEBUG(16108):     beab2fac  808ffeb7  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.147: I/DEBUG(16108): #01 beab2fb0  002999b0  
03-07 10:48:43.147: I/DEBUG(16108):     beab2fb4  00000000  
03-07 10:48:43.147: I/DEBUG(16108):     beab2fb8  002999b0  
03-07 10:48:43.147: I/DEBUG(16108):     beab2fbc  808ff85f  /data/data/com.netm.game/lib/libgame.so
03-07 10:48:43.397: I/BootReceiver(210): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)

I dumped the libgame.so. And I found the stack of the crash :

0x001005b6:_ZNSt6vectorIPN7cocos2d17CCAutoreleasePoolESaIS2_EE9push_backERKS2_ + 0x000a
0x000ffeb2:_ZN7cocos2d14CCMutableArrayIPNS_17CCAutoreleasePoolEE9addObjectES2_ + 0x0022
0x000ff85a:_ZN7cocos2d13CCPoolManager4pushEv + 0x002a
0x000ff942:_ZN7cocos2d13CCPoolManager17getCurReleasePoolEv + 0x0012
0x000ff91c:_ZN7cocos2d13CCPoolManager9addObjectEPNS_8CCObjectE + 0x000c
0x00102e1a:_ZN7cocos2d8CCObject11autoreleaseEv + 0x0012
0x001406dc:_ZN7cocos2d7CCArray17arrayWithCapacityEj + 0x0040
0x000cb4c2:     _ZN11GameProfile8initGameEv + 0x00b2
0x000cb386:            _ZN11GameProfileC1Ev + 0x000a
0x000cc2f8:           _ZSt3maxIfERKT_S2_S2_ + 0x0098
0x000cc34c:           _ZSt3maxIfERKT_S2_S2_ + 0x00ec

so I found that it was vector::push_back that caused the crash. It make me slient.
Anyone who can explain would be appreciated!

You can use ndk-stack(refer NDK_ROOT/docs/NDK-STACK.html) to dump more readable stack information.

thanks for your reply.I get this message by your advice.

********** Crash dump: **********
Build fingerprint: 'google/passion/passion:2.3.3/GRI40/102588:user/release-keys'
pid: 17803, tid: 17803  >>> com.netm.game <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000018
Stack frame #00  pc 001005b6  /data/data/com.netm.game/lib/libgame.so: Routine push_back in C:/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/bits/stl_vector.h:751
Stack frame #01  pc 000ffeb2  /data/data/com.netm.game/lib/libgame.so: Routine addObject in jni/../../../cocos2dx/include/CCMutableArray.h:110
Stack frame #02  pc 000ff85a  /data/data/com.netm.game/lib/libgame.so: Routine push in jni/../../../cocos2dx/cocoa/CCAutoreleasePool.cpp:133
Stack frame #03  pc 000ff942  /data/data/com.netm.game/lib/libgame.so: Routine getCurReleasePool in jni/../../../cocos2dx/cocoa/CCAutoreleasePool.cpp:181
Stack frame #04  pc 000ff91c  /data/data/com.netm.game/lib/libgame.so: Routine addObject in jni/../../../cocos2dx/cocoa/CCAutoreleasePool.cpp:173
Stack frame #05  pc 00102e1a  /data/data/com.netm.game/lib/libgame.so: Routine autorelease in jni/../../../cocos2dx/cocoa/CCObject.cpp:93
Stack frame #06  pc 001406dc  /data/data/com.netm.game/lib/libgame.so: Routine arrayWithCapacity in jni/../../../cocos2dx/support/CCArray.cpp:53
Stack frame #07  pc 000cb4c2  /data/data/com.netm.game/lib/libgame.so: Routine initGame in jni/helloworld/../../../Classes/Menu/GameProfile.cpp:47
Stack frame #08  pc 000cb386  /data/data/com.netm.game/lib/libgame.so: Routine GameProfile in jni/helloworld/../../../Classes/Menu/GameProfile.cpp:13
Stack frame #09  pc 000cc2f8  /data/data/com.netm.game/lib/libgame.so: Routine __static_initialization_and_destruction_0 in jni/helloworld/../../../Classes/Menu/GameProfile.cpp:473
Stack frame #10  pc 000cc34c  /data/data/com.netm.game/lib/libgame.so: Routine _GLOBAL__I_GameProfile.cpp in jni/helloworld/../../../Classes/Menu/GameProfile.cpp:473

This makes the problem clearer.
But why does it crash at the vector::push_back.All right,I will check if the object which is pushed back is NULL.

well,I log the object addr . It seems that it’s OK. The value of addr is 0x002999b0. I don’t think it’s the cococ2dx cause this crash but the gnu_static lib.

CCMutableArray can only store element that inherits CCObject, this make sure it has retain() and release() functions.

I created another project.Yet when in this project I use the crash code in last project ,it runs fine! Why?! The same code. Besizes , when I use lower version cocos2dx,it doesn’t crash at once. Is that the problem of stl lib? What’s the difference between stlgnu and stlport?

I found that in the project which crashes at once has weird problem :it doesn’t construct the globe variant g_PoolManager. However in the new test project , I logged and found that it enter the construct func! why??

May be I know the problem.
Now cocos2dx in 0.12.0 is build as a static lib.
How do you use it?
Did you link libcocos2d.a to two or more .so?

sovle it! Cause my game use a globe variant which refer g_PoolManager in its construct func. g_PoolManager is constructed after my globe variant.So it crashes.
I change the globe variant to a pointer when used to init.It’s OK. But it still crashes because other reason. F! JavaVM* JniHelper::m_psJavaVM = NULL; Why 0.12.0 so many bugs!

ok!I can launch it after I found that I need to set VM in main.cpp ! It’s new and I don’t see it;

You should refer HelloWorld/android/jni/helloworld/main.cpp, you should set JavaVM.
Because cocos2dx is not a .so now, so it can not implement JNI_OnLoad to receive JavaVM.

It is not the matter of 0.12.0, it is the matter that you use old project and new engine code.
If you create project with new version of create-android-project.sh, you will not have these bugs.