AndEngine と Box2D を使用して、Android OS 用のゲームを作成しています。私は最も奇妙なエラーを受け取りました.私の人生では、何が原因であるかを理解することはできません. それが発生するときは比較的ランダムですが (コードのどこで発生するかはランダムではありません)、LogCat でこれだけでゲームがクラッシュすることは避けられません:
07-06 09:56:56.383: V/AndEngine(14907): org.andengine.input.touch.TouchEvent$TouchEventPool<TouchEvent> was exhausted, with 1 item not yet recycled. Allocated 1 more.
07-06 09:56:56.391: V/AndEngine(14907): org.andengine.util.adt.pool.PoolUpdateHandler$1<TouchEventRunnablePoolItem> was exhausted, with 1 item not yet recycled. Allocated 1 more.
07-06 09:56:56.462: V/AndEngine(14907): org.andengine.input.touch.TouchEvent$TouchEventPool<TouchEvent> was exhausted, with 2 item not yet recycled. Allocated 1 more.
07-06 09:56:56.465: V/AndEngine(14907): org.andengine.util.adt.pool.PoolUpdateHandler$1<TouchEventRunnablePoolItem> was exhausted, with 2 item not yet recycled. Allocated 1 more.
07-06 09:56:56.524: V/AndEngine(14907): org.andengine.input.touch.TouchEvent$TouchEventPool<TouchEvent> was exhausted, with 3 item not yet recycled. Allocated 1 more.
07-06 09:56:56.524: V/AndEngine(14907): org.andengine.util.adt.pool.PoolUpdateHandler$1<TouchEventRunnablePoolItem> was exhausted, with 3 item not yet recycled. Allocated 1 more.
07-06 09:56:56.567: V/AndEngine(14907): org.andengine.input.touch.TouchEvent$TouchEventPool<TouchEvent> was exhausted, with 4 item not yet recycled. Allocated 1 more.
07-06 09:56:56.567: V/AndEngine(14907): org.andengine.util.adt.pool.PoolUpdateHandler$1<TouchEventRunnablePoolItem> was exhausted, with 4 item not yet recycled. Allocated 1 more.
07-06 09:57:00.700: I/dalvikvm(14907): threadid=3: reacting to signal 3
07-06 09:57:00.715: I/dalvikvm(14907): Wrote stack traces to '/data/anr/traces.txt'
ちなみに traces.txt は存在しません。このメソッドを実行した直後にコードがクラッシュする場所は次のとおりです。
private void destroyFiller(){ //Deletes filler
if(filler[fillerNum].active){
Log.e("destroyFiller","Destroying filler");
filler[fillerNum].body.setActive(false);
scene.detachChild(filler[fillerNum].sprite);
filler[fillerNum].active=false;
fillerCount--;
fillersLeftText.setText("Balls left: "+Integer.toString(fillerCount));
if(fillerCount==0)
gameOver();
Log.e("destroyFiller","Destroyed");
}
}
そして、そのメソッドはここから呼び出されます:
private ContactListener createContactListener() {
ContactListener contactListener = new ContactListener()
{
@Override
public void beginContact(Contact contact) {
if(fillerNum>-1 && contact.getFixtureA().getBody().getUserData()!=null && contact.getFixtureB().getBody().getUserData()!=null){
String x1 = (String) contact.getFixtureA().getBody().getUserData();
String x2 = (String) contact.getFixtureB().getBody().getUserData();
if((x1.equals("fill")&&!x2.equals("dest"))||(x2.equals("fill"))&&!x1.equals("dest")){ //If a filler hits a stationary
createStationaryFiller();
}
if((x1.equals("dest")&&x2.equals("fill"))||(x1.equals("fill")&&x2.equals("dest"))){ //If a destroyer hits a filler
destroyFiller();
}
}
}
何が原因でクラッシュするのかわかりません。問題がどこにでもあることはわかっていますが、500 行のコードではすべてを投稿することはできません。アイデアや提案、または見たいコードの一部を持っている人はいますか?
フィルタリングされていない LogCat を確認したところ、これが見つかりました。誰にとっても意味がありますか?
07-06 11:21:23.696: V/WindowManager(2480): Dsptch > Window{486f5230 com.prattia.webs.testgfx5/com.prattia.webs.testgfx5.TestGFX5Activity paused=false}
07-06 11:21:23.696: V/InputDevice(2480): ID[0]=0(0) Up(1=>0)
07-06 11:21:23.696: I/PowerManagerService(2480): Ulight 3->7|0
07-06 11:21:23.794: I/DEBUG(10312): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-06 11:21:23.794: I/DEBUG(10312): Build fingerprint: 'TMOUS/SGH-T959V/SGH-T959V/SGH-T959V:2.2.1/FROYO/VUVKD1:user/release-keys'
07-06 11:21:23.794: I/DEBUG(10312): pid: 17226, tid: 17256 >>> com.prattia.webs.testgfx5 <<<
07-06 11:21:23.797: I/DEBUG(10312): signal 11 (SIGSEGV), fault addr deadbaad
07-06 11:21:23.797: I/DEBUG(10312): r0 00000000 r1 afd14921 r2 00000027 r3 00000070
07-06 11:21:23.797: I/DEBUG(10312): r4 afd42328 r5 00000000 r6 00000000 r7 43095e58
07-06 11:21:23.797: I/DEBUG(10312): r8 447d7b7c r9 43095e44 10 43095e2c fp 00000064
07-06 11:21:23.801: I/DEBUG(10312): ip 00001730 sp 447d7a60 lr deadbaad pc afd11f74 cpsr 60000030
07-06 11:21:23.801: I/DEBUG(10312): d0 643a64696f72646e d1 6472656767756265
07-06 11:21:23.801: I/DEBUG(10312): d2 65473a3a6565726e d3 4242414174614673
07-06 11:21:23.801: I/DEBUG(10312): d4 6e412f73656e6967 d5 2f656e69676e4564
07-06 11:21:23.801: I/DEBUG(10312): d6 6e69676e45646e41 d7 7363697379685065
07-06 11:21:23.801: I/DEBUG(10312): d8 43f0000043988ca5 d9 431d03c843988ca5
07-06 11:21:23.801: I/DEBUG(10312): d10 408ee46043cf0f5e d11 408ee4603f800000
07-06 11:21:23.805: I/DEBUG(10312): d12 408ee46000000000 d13 3f80000000000000
07-06 11:21:23.809: I/DEBUG(10312): d14 0000000000000000 d15 3faebd1440000000
07-06 11:21:23.809: I/DEBUG(10312): d16 447d777843f00000 d17 3f78b8603e39a634
07-06 11:21:23.813: I/DEBUG(10312): d18 3f78fea6d7751d87 d19 3fd5561e206f6f3e
07-06 11:21:23.813: I/DEBUG(10312): d20 bfc99ad1f3789aec d21 3fc24a24221605f5
07-06 11:21:23.817: I/DEBUG(10312): d22 bfbc737776d3846a d23 3fb7474448cda1bc
07-06 11:21:23.817: I/DEBUG(10312): d24 bfb3b23aa8f96cd7 d25 3fb10e7e68f17086
07-06 11:21:23.821: I/DEBUG(10312): d26 bfaddfc803465b60 d27 3fa97c023a66406c
07-06 11:21:23.821: I/DEBUG(10312): d28 bfa2b4442c6a6c2f d29 3ff0000000000000
07-06 11:21:23.825: I/DEBUG(10312): d30 0000000000000000 d31 3ff0000000000000
07-06 11:21:23.829: I/DEBUG(10312): scr 80000012
07-06 11:21:23.977: I/DEBUG(10312): #00 pc 00011f74 /system/lib/libc.so
07-06 11:21:23.977: I/DEBUG(10312): #01 pc 0001921e /system/lib/libc.so
07-06 11:21:23.981: I/DEBUG(10312): #02 pc 00023368 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:23.981: I/DEBUG(10312): #03 pc 000233d0 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:23.981: I/DEBUG(10312): #04 pc 000239cc /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:23.981: I/DEBUG(10312): #05 pc 000282c4 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:23.981: I/DEBUG(10312): #06 pc 00014940 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:23.985: I/DEBUG(10312): #07 pc 00016e34 /system/lib/libdvm.so
07-06 11:21:23.985: I/DEBUG(10312): code around pc:
07-06 11:21:23.985: I/DEBUG(10312): afd11f54 2d00682d e029d1fb b12b68db c05cf8df
07-06 11:21:23.985: I/DEBUG(10312): afd11f64 f8442001 4798000c e054f8df 26002227
07-06 11:21:23.985: I/DEBUG(10312): afd11f74 2000f88e eec2f7fb f7fc2106 f04feff8
07-06 11:21:23.985: I/DEBUG(10312): afd11f84 91035180 460aa901 96012006 f7fc9602
07-06 11:21:23.989: I/DEBUG(10312): afd11f94 a905eb7e 20024632 eb88f7fc eeaef7fb
07-06 11:21:23.989: I/DEBUG(10312): code around lr:
07-06 11:21:23.989: I/DEBUG(10312): deadba8c ffffffff ffffffff ffffffff ffffffff
07-06 11:21:23.989: I/DEBUG(10312): deadba9c ffffffff ffffffff ffffffff ffffffff
07-06 11:21:23.989: I/DEBUG(10312): deadbaac ffffffff ffffffff ffffffff ffffffff
07-06 11:21:23.989: I/DEBUG(10312): deadbabc ffffffff ffffffff ffffffff ffffffff
07-06 11:21:23.989: I/DEBUG(10312): deadbacc ffffffff ffffffff ffffffff ffffffff
07-06 11:21:23.989: I/DEBUG(10312): stack:
07-06 11:21:23.989: I/DEBUG(10312): 447d7a20 447d7a4c
07-06 11:21:23.993: I/DEBUG(10312): 447d7a24 00000000
07-06 11:21:23.993: I/DEBUG(10312): 447d7a28 afd425a0 /system/lib/libc.so
07-06 11:21:23.993: I/DEBUG(10312): 447d7a2c afd4254c /system/lib/libc.so
07-06 11:21:23.993: I/DEBUG(10312): 447d7a30 00000000
07-06 11:21:23.993: I/DEBUG(10312): 447d7a34 afd1596b /system/lib/libc.so
07-06 11:21:23.993: I/DEBUG(10312): 447d7a38 afd14921 /system/lib/libc.so
07-06 11:21:23.993: I/DEBUG(10312): 447d7a3c afd14921 /system/lib/libc.so
07-06 11:21:23.997: I/DEBUG(10312): 447d7a40 00000070
07-06 11:21:23.997: I/DEBUG(10312): 447d7a44 afd42328 /system/lib/libc.so
07-06 11:21:23.997: I/DEBUG(10312): 447d7a48 00000000
07-06 11:21:23.997: I/DEBUG(10312): 447d7a4c 447d7a74
07-06 11:21:23.997: I/DEBUG(10312): 447d7a50 43095e58
07-06 11:21:23.997: I/DEBUG(10312): 447d7a54 afd14bc3 /system/lib/libc.so
07-06 11:21:23.997: I/DEBUG(10312): 447d7a58 df002777
07-06 11:21:24.001: I/DEBUG(10312): 447d7a5c e3a070ad
07-06 11:21:24.001: I/DEBUG(10312): #00 447d7a60 00000000
07-06 11:21:24.001: I/DEBUG(10312): 447d7a64 43095e40
07-06 11:21:24.001: I/DEBUG(10312): 447d7a68 43095e58
07-06 11:21:24.001: I/DEBUG(10312): 447d7a6c afd14f29 /system/lib/libc.so
07-06 11:21:24.001: I/DEBUG(10312): 447d7a70 afd4254c /system/lib/libc.so
07-06 11:21:24.001: I/DEBUG(10312): 447d7a74 fffffbdf
07-06 11:21:24.004: I/DEBUG(10312): 447d7a78 0000008d
07-06 11:21:24.004: I/DEBUG(10312): 447d7a7c 00000000
07-06 11:21:24.004: I/DEBUG(10312): 447d7a80 43095e40
07-06 11:21:24.004: I/DEBUG(10312): 447d7a84 afd19223 /system/lib/libc.so
07-06 11:21:24.004: I/DEBUG(10312): #01 447d7a88 0000008d
07-06 11:21:24.004: I/DEBUG(10312): 447d7a8c 82140c18 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:24.004: I/DEBUG(10312): 447d7a90 82145aa8 /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:24.004: I/DEBUG(10312): 447d7a94 8212336c /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
07-06 11:21:24.563: I/BootReceiver(2480): Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
07-06 11:21:24.590: I/DEBUG(10312): dumpstate /data/log/dumpstate_app_native.txt
07-06 11:21:24.614: I/dumpstate(17307): begin
07-06 11:21:24.622: I/dalvikvm(2480): threadid=3: reacting to signal 3
07-06 11:21:24.688: D/dalvikvm(2480): GC_FOR_MALLOC freed 1289 objects / 326416 bytes in 122ms
07-06 11:21:24.688: D/dalvikvm(15145): GC_EXPLICIT freed 43 objects / 1608 bytes in 826ms
07-06 11:21:24.739: I/dalvikvm(2480): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.747: I/dalvikvm(2604): threadid=3: reacting to signal 3
07-06 11:21:24.747: I/dalvikvm(2604): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.754: I/dalvikvm(2610): threadid=3: reacting to signal 3
07-06 11:21:24.774: I/dalvikvm(2610): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.813: I/dalvikvm(2613): threadid=3: reacting to signal 3
07-06 11:21:24.817: I/dalvikvm(2613): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.821: I/dalvikvm(2621): threadid=3: reacting to signal 3
07-06 11:21:24.829: I/dalvikvm(2621): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.833: I/dalvikvm(2630): threadid=3: reacting to signal 3
07-06 11:21:24.836: I/dalvikvm(2630): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.840: I/dalvikvm(2636): threadid=3: reacting to signal 3
07-06 11:21:24.872: I/dalvikvm(2636): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.879: I/dalvikvm(2691): threadid=3: reacting to signal 3
07-06 11:21:24.883: I/dalvikvm(2691): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.915: I/dalvikvm(2744): threadid=3: reacting to signal 3
07-06 11:21:24.934: I/dalvikvm(2744): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.942: I/dalvikvm(2767): threadid=3: reacting to signal 3
07-06 11:21:24.946: I/dalvikvm(2767): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.954: I/dalvikvm(3339): threadid=3: reacting to signal 3
07-06 11:21:24.958: I/dalvikvm(3339): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:24.965: I/dalvikvm(5990): threadid=3: reacting to signal 3
07-06 11:21:24.969: I/dalvikvm(5990): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.004: I/dalvikvm(13294): threadid=3: reacting to signal 3
07-06 11:21:25.028: I/dalvikvm(13294): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.028: I/dalvikvm(13691): threadid=3: reacting to signal 3
07-06 11:21:25.040: I/dalvikvm(13691): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.051: I/dalvikvm(13737): threadid=3: reacting to signal 3
07-06 11:21:25.059: I/dalvikvm(13737): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.122: I/dalvikvm(13930): threadid=3: reacting to signal 3
07-06 11:21:25.133: I/dalvikvm(13930): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.137: I/dalvikvm(14722): threadid=3: reacting to signal 3
07-06 11:21:25.141: I/dalvikvm(14722): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.172: I/dalvikvm(15145): threadid=3: reacting to signal 3
07-06 11:21:25.176: I/dalvikvm(15145): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.180: I/dalvikvm(15266): threadid=3: reacting to signal 3
07-06 11:21:25.192: I/dalvikvm(15266): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.196: I/dalvikvm(15684): threadid=3: reacting to signal 3
07-06 11:21:25.196: I/dalvikvm(15684): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.200: I/dalvikvm(16472): threadid=3: reacting to signal 3
07-06 11:21:25.204: I/dalvikvm(16472): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.208: I/dalvikvm(16506): threadid=3: reacting to signal 3
07-06 11:21:25.211: I/dalvikvm(16506): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.239: I/dalvikvm(16523): threadid=3: reacting to signal 3
07-06 11:21:25.243: I/dalvikvm(16523): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.274: I/dalvikvm(16649): threadid=3: reacting to signal 3
07-06 11:21:25.278: I/dalvikvm(16649): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.278: I/dalvikvm(16695): threadid=3: reacting to signal 3
07-06 11:21:25.282: I/dalvikvm(16695): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.286: I/dalvikvm(16701): threadid=3: reacting to signal 3
07-06 11:21:25.290: I/dalvikvm(16701): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.290: I/dalvikvm(16711): threadid=3: reacting to signal 3
07-06 11:21:25.309: I/dalvikvm(16711): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.321: I/dalvikvm(16761): threadid=3: reacting to signal 3
07-06 11:21:25.321: I/dalvikvm(16761): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.325: I/dalvikvm(16767): threadid=3: reacting to signal 3
07-06 11:21:25.340: I/dalvikvm(16767): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.340: I/dalvikvm(16782): threadid=3: reacting to signal 3
07-06 11:21:25.344: I/dalvikvm(16782): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.348: I/dalvikvm(16791): threadid=3: reacting to signal 3
07-06 11:21:25.352: I/dalvikvm(16791): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.352: I/dalvikvm(16797): threadid=3: reacting to signal 3
07-06 11:21:25.360: I/dalvikvm(16797): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.364: I/dalvikvm(16817): threadid=3: reacting to signal 3
07-06 11:21:25.364: I/dalvikvm(16817): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.368: I/dalvikvm(16892): threadid=3: reacting to signal 3
07-06 11:21:25.376: I/dalvikvm(16892): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.379: I/dalvikvm(16926): threadid=3: reacting to signal 3
07-06 11:21:25.379: I/dalvikvm(16926): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:25.383: I/dalvikvm(17226): threadid=3: reacting to signal 3
07-06 11:21:25.387: I/dalvikvm(17226): Wrote stack traces to '/data/anr/traces.txt'
07-06 11:21:26.758: W/PowerManagerService(2480): Timer 0x7->0x3|0x3
07-06 11:21:26.758: I/PowerManagerService(2480): Ulight 7->3|0
07-06 11:21:28.895: D/dalvikvm(13930): GC_EXPLICIT freed 995 objects / 32992 bytes in 46ms