Hello, I’m working on porting a game to cocos2dx on android, and have recently come to a crash I don’t know how to deal with.
The code crashes on:
@ public void onSurfaceCreated(GL10 gl, EGLConfig config) {
Log.v(“Ying”, “Renderer - onSurfaceCreated (” + Cocos2dxActivity.screenWidth + “,” + Cocos2dxActivity.screenHeight + “)” );
nativeInit(Cocos2dxActivity.screenWidth, Cocos2dxActivity.screenHeight);
Log.v(“Ying”, “Renderer - onSurfaceCreated2”);
last = System.nanoTime();
}@
As the log never outputs the “Renderer - onSurfaceCreated2” message. I found this by trial and error as the log doesn’t give any specific indications to where the bug is. Here is the logcat log for this problem.
D/AndroidRuntime(28731): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
>
D/AndroidRuntime(28731): CheckJNI is OFF
>
D/dalvikvm(28731): creating instr width table
>
D/AndroidRuntime(28731): Calling main entry com.android.commands.am.Am
>
I/ActivityManager( 96): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mutantgames.fvz/.FVZ_2_3 } from pid 28731
>
D/AndroidRuntime(28731): Shutting down VM
>
I/ActivityManager( 96): Start proc com.mutantgames.fvz for activity com.mutantgames.fvz/.FVZ_2_3: pid=28739 uid=10061 gids={1015}
>
D/dalvikvm(28731): GC_CONCURRENT freed 102K, 69 free 320K/1024K, external 0K/0K, paused 1ms+1msD/dalvikvm(28731): Debugger has detached; object registry had 1 entries
I/AndroidRuntime(28731): NOTE: attach of thread ‘Binder Thread #3’ failed
I/WindowManager( 96): Setting rotation to 1, animFlags=1
I/ActivityManager( 96): Config changed: { scale=1.0 imsi=214/1 loc=en_GB touch=3 keys=1/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=606}
V/RenderScript_jni( 179): surfaceDestroyed
D/dalvikvm(28739): Trying to load lib /data/data/com.mutantgames.fvz/lib/libcocos2d.so 0x40513af0
D/dalvikvm(28739): Added shared lib /data/data/com.mutantgames.fvz/lib/libcocos2d.so 0x40513af0
D/dalvikvm(28739): Trying to load lib /data/data/com.mutantgames.fvz/lib/libcocosdenshion.so 0x40513af0
D/dalvikvm(28739): Added shared lib /data/data/com.mutantgames.fvz/lib/libcocosdenshion.so 0x40513af0
D/dalvikvm(28739): Trying to load lib /data/data/com.mutantgames.fvz/lib/libchipmunk.so 0x40513af0
D/dalvikvm(28739): Added shared lib /data/data/com.mutantgames.fvz/lib/libchipmunk.so 0x40513af0
D/dalvikvm(28739): No JNI_OnLoad found in /data/data/com.mutantgames.fvz/lib/libchipmunk.so 0x40513af0, skipping init
D/dalvikvm(28739): Trying to load lib /data/data/com.mutantgames.fvz/lib/libgame.so 0x40513af0
D/dalvikvm(28739): Added shared lib /data/data/com.mutantgames.fvz/lib/libgame.so 0x40513af0
D/dalvikvm(28739): No JNI_OnLoad found in /data/data/com.mutantgames.fvz/lib/libgame.so 0x40513af0, skipping init
W/apk path(28739): /data/app/com.mutantgames.fvz-2.apk
I/ActivityManager( 96): Displayed com.mutantgames.fvz/.FVZ_2_3: +344ms
D/libEGL (28739): loaded /system/lib/egl/libGLES_android.so
D/libEGL (28739): loaded /system/lib/egl/libEGL_adreno200.so
D/libEGL (28739): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
D/libEGL (28739): loaded /system/lib/egl/libGLESv2_adreno200.so
V/Ying (28739): Renderer - onSurfaceCreated ( 800, 480)
W/IInputConnectionWrapper( 179): showStatusIcon on inactive InputConnection
I/DEBUG (28496): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG (28496): Build fingerprint: ‘google/passion/passion:2.3.6/GRK39F/189904:user/release-keys’
I/DEBUG (28496): pid: 28739, tid: 28750 >>> com.mutantgames.fvz <<<
I/DEBUG (28496): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
I/DEBUG (28496): r0 00000027 r1 deadbaad r2 a0000000 r3 00000000
I/DEBUG (28496): r4 00000001 r5 00000000 r6 00000150 r7 4483cf40
I/DEBUG (28496): r8 4493cb40 r9 4483cf38 10 4483cf24 fp 800a5368
I/DEBUG (28496): ip afd46668 sp 4493c958 lr afd191d9 pc afd15ca4 cpsr 60000030
I/DEBUG (28496): d0 656a624f43433a63 d1 6432736f636f6374
I/DEBUG (28496): d2 656c65533a3a642a d3 746f7250726f7429
I/DEBUG (28496): d4 2c2a65646f4e4343 d5 6432736f636f6320
I/DEBUG (28496): d6 7463656c65533a3a d7 636f746f7250726f
I/DEBUG (28496): d8 0000000000000000 d9 0000000000000000
I/DEBUG (28496): d10 0000000000000000 d11 0000000000000000
I/DEBUG (28496): d12 0000000000000000 d13 0000000000000000
I/DEBUG (28496): d14 0000000000000000 d15 0000000000000000
I/DEBUG (28496): d16 0000000000000001 d17 0000000000000000
I/DEBUG (28496): d18 3fe279a74be0ed66 d19 3fd7ac77a49a45b8
I/DEBUG (28496): d20 3f76cff5716b41da d21 3fb33dc61a93ea8e
I/DEBUG (28496): d22 3fd24998d6307188 d23 3fcc7288e957b53b
I/DEBUG (28496): d24 3fc74721cad6b0ed d25 3fc39a09d078c69f
I/DEBUG (28496): d26 0000000000000000 d27 0000000000000000
I/DEBUG (28496): d28 0000000000000000 d29 0000000000000000
I/DEBUG (28496): d30 0000000000000000 d31 0000000000000000
I/DEBUG (28496): scr 60000012
I/DEBUG (28496):
I/DEBUG (28496): #00 pc 00015ca4 /system/lib/libc.so
I/DEBUG (28496): #01 pc 0001c92c /system/lib/libc.so
I/DEBUG (28496): #02 pc 000dfb3a /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): #03 pc 000dfffc /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): #04 pc 000dfeae /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): #05 pc 000dfe52 /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): #06 pc 0004ab5e /data/data/com.mutantgames.fvz/lib/libgame.so
I/DEBUG (28496): #07 pc 0004aa7e /data/data/com.mutantgames.fvz/lib/libgame.so
I/DEBUG (28496): #08 pc 0004aada /data/data/com.mutantgames.fvz/lib/libgame.so
I/DEBUG (28496): #09 pc 0004a740 /data/data/com.mutantgames.fvz/lib/libgame.so
I/DEBUG (28496): #10 pc 000f808c /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): #11 pc 0004a524 /data/data/com.mutantgames.fvz/lib/libgame.so
I/DEBUG (28496): #12 pc 00017e34 /system/lib/libdvm.so
I/DEBUG (28496): #13 pc 00049646 /system/lib/libdvm.so
I/DEBUG (28496): #14 pc 0004ee62 /system/lib/libdvm.so
I/DEBUG (28496): #15 pc 0001d034 /system/lib/libdvm.so
I/DEBUG (28496): #16 pc 000220e4 /system/lib/libdvm.so
I/DEBUG (28496): #17 pc 00020fdc /system/lib/libdvm.so
I/DEBUG (28496): #18 pc 0005fc40 /system/lib/libdvm.so
I/DEBUG (28496): #19 pc 0005fe54 /system/lib/libdvm.so
I/DEBUG (28496): #20 pc 000541aa /system/lib/libdvm.so
I/DEBUG (28496): #21 pc 000118e4 /system/lib/libc.so
I/DEBUG (28496): #22 pc 000114b0 /system/lib/libc.so
I/DEBUG (28496):
I/DEBUG (28496): code around pc:
I/DEBUG (28496): afd15c84 2c006824 e028d1fb b13368db c064f8df
I/DEBUG (28496): afd15c94 44fc2401 4000f8cc 49124798 25002027
I/DEBUG (28496): afd15ca4 f7f57008 2106ec7c edd8f7f6 460aa901
I/DEBUG (28496): afd15cb4 f04f2006 95015380 95029303 e93ef7f6
I/DEBUG (28496): afd15cc4 462aa905 f7f62002 f7f5e94a 2106ec68
I/DEBUG (28496):
I/DEBUG (28496): code around lr:
I/DEBUG (28496): afd191b8 4a0e4b0d e92d447b 589c41f0 26004680
I/DEBUG (28496): afd191c8 686768a5 f9b5e006 b113300c 47c04628
I/DEBUG (28496): afd191d8 35544306 37fff117 6824d5f5 d1ef2c00
I/DEBUG (28496): afd191e8 e8bd4630 bf0081f0 00028344 ffffff88
I/DEBUG (28496): afd191f8 b086b570 f602fb01 9004460c a804a901
I/DEBUG (28496):
I/DEBUG (28496): stack:
I/DEBUG (28496): 4493c918 afd42664
I/DEBUG (28496): 4493c91c 000a7d18
I/DEBUG (28496): 4493c920 00000015
I/DEBUG (28496): 4493c924 afd182a1 /system/lib/libc.so
I/DEBUG (28496): 4493c928 afd4270c
I/DEBUG (28496): 4493c92c afd426b8
I/DEBUG (28496): 4493c930 00000000
I/DEBUG (28496): 4493c934 afd191d9 /system/lib/libc.so
I/DEBUG (28496): 4493c938 00000001
I/DEBUG (28496): 4493c93c 4493c96c
I/DEBUG (28496): 4493c940 00000150
I/DEBUG (28496): 4493c944 4483cf40
I/DEBUG (28496): 4493c948 4493cb40
I/DEBUG (28496): 4493c94c afd184fb /system/lib/libc.so
I/DEBUG (28496): 4493c950 df002777
I/DEBUG (28496): 4493c954 e3a070ad
I/DEBUG (28496): #00 4493c958 4483cf38
I/DEBUG (28496): 4493c95c 4483cf24
I/DEBUG (28496): 4493c960 800a5368
I/DEBUG (28496): 4493c964 afd18821 /system/lib/libc.so
I/DEBUG (28496): 4493c968 afd426b8
I/DEBUG (28496): 4493c96c fffffbdf
I/DEBUG (28496): 4493c970 afd1c92d /system/lib/libc.so
I/DEBUG (28496): 4493c974 afd3ade9 /system/lib/libc.so
I/DEBUG (28496): 4493c978 805862f8 /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): 4493c97c afd1c931 /system/lib/libc.so
I/DEBUG (28496): #01 4493c980 000001ea
I/DEBUG (28496): 4493c984 805864dc /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): 4493c988 805864dc /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): 4493c98c 805864dc /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/DEBUG (28496): 4493c990 00000000
I/DEBUG (28496): 4493c994 804dfb3d /data/data/com.mutantgames.fvz/lib/libcocos2d.so
I/BootReceiver( 96): Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
I/ActivityManager( 96): Process com.mutantgames.fvz (pid 28739) has died.
E/InputDispatcher( 96): channel ‘406ffd28 com.mutantgames.fvz/com.mutantgames.fvz.FVZ_2_3 (server)’ ~ Consumer closed input channel or an error occurred. events=0x8
E/InputDispatcher( 96): channel ‘406ffd28 com.mutantgames.fvz/com.mutantgames.fvz.FVZ_2_3 (server)’ ~ Channel is unrecoverably broken and will be disposed!
D/Zygote ( 67): Process 28739 terminated by signal (11)
I/WindowManager( 96): WIN DEATH: Window{406ffd28 com.mutantgames.fvz/com.mutantgames.fvz.FVZ_2_3 paused=false}
I/WindowManager( 96): WIN DEATH: Window{407b00f8 SurfaceView paused=false}
I/WindowManager( 96): WIN DEATH: Window{40ccbc38 com.mutantgames.fvz/com.mutantgames.fvz.FVZ_2_3 paused=false}
I/WindowManager( 96): WIN DEATH: Window{40951ba8 com.mutantgames.fvz/com.mutantgames.fvz.FVZ_2_3 paused=false}
D/dalvikvm( 96): GC_EXPLICIT freed 433K, 51 free 7573K/15303K, external 6014K/7511K, paused 82ms
>
I/WindowManager( 96): Setting rotation to 0, animFlags=1
>
I/ActivityManager( 96): Config changed: { scale=1.0 imsi=214/1 loc=en_GB touch=3 keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=607}
>
W/WindowManager( 96): Rebuild removed 10 windows but added 8
>
V/RenderScript_jni( 179): surfaceCreated
>
V/RenderScript_jni( 179): surfaceChanged
>
W/InputManagerService( 96): Got RemoteException sending setActive(false) notification to pid 28739 uid 10061
>
V/RenderScript_jni( 179): surfaceChanged
>
V/RenderScript_jni( 179): surfaceChanged
Any ideas / suggestions on where to look?