I'm currently developing a game that makes use of SoundPool and OpenGL for 
rendering 2D sprites. I just encountered for the first time a native 
library crash while testing it for a bit. The log looks like as follows:

02-22 17:04:28.105: I/DEBUG(86): *** *** *** *** *** *** *** *** *** *** 
> *** *** *** *** *** ***
> 02-22 17:04:28.105: I/DEBUG(86): Build fingerprint: 
> 'samsung/GT-I9000/GT-I9000:2.3.5/GINGERBREAD/XXJVS:user/release-keys'
> 02-22 17:04:28.105: I/DEBUG(86): pid: 2839, tid: 6296  >>> 
> com.nobu_games.android.zoolicious <<<
> 02-22 17:04:28.105: I/DEBUG(86): signal 11 (SIGSEGV), code 1 
> (SEGV_MAPERR), fault addr deadbaad
> 02-22 17:04:28.105: I/DEBUG(86):  r0 00000027  r1 deadbaad  r2 a0000000  
> r3 00000000
> 02-22 17:04:28.105: I/DEBUG(86):  r4 00000001  r5 00000000  r6 00000000  
> r7 083a1ffc
> 02-22 17:04:28.105: I/DEBUG(86):  r8 476ad9c4  r9 476ad91c  10 00000003  
> fp 00000000
> 02-22 17:04:28.105: I/DEBUG(86):  ip afd46688  sp 476ad820  lr afd19241  
> pc afd15d04  cpsr 60000030
> 02-22 17:04:28.105: I/DEBUG(86):  d0  3ff921fb3f800000  d1  
> 00000004000003e0
> 02-22 17:04:28.105: I/DEBUG(86):  d2  0000003c476ada9f  d3  
> 003c216000000046
> 02-22 17:04:28.105: I/DEBUG(86):  d4  00410049002e0061  d5  
> 006f006900640075
> 02-22 17:04:28.105: I/DEBUG(86):  d6  00015888006c0046  d7  
> 0000000000000000
> 02-22 17:04:28.105: I/DEBUG(86):  d8  3dcccccd40000000  d9  
> 3e580af8bf800000
> 02-22 17:04:28.105: I/DEBUG(86):  d10 451c40003e580af8  d11 
> 37381cb13d888888
> 02-22 17:04:28.109: I/DEBUG(86):  d12 3f6f4f4e3f74bfa7  d13 
> 0000000000000000
> 02-22 17:04:28.109: I/DEBUG(86):  d14 0000000000000000  d15 
> 0000000000000000
> 02-22 17:04:28.109: I/DEBUG(86):  d16 3fe0000000000000  d17 
> 3f8996b5e5285903
> 02-22 17:04:28.109: I/DEBUG(86):  d18 bf56a8cadc65ad5a  d19 
> 3fab91938da65ac6
> 02-22 17:04:28.109: I/DEBUG(86):  d20 3fa55553e1053a42  d21 
> 3f11560beb56dc27
> 02-22 17:04:28.109: I/DEBUG(86):  d22 bebbbca9f71c732b  d23 
> 3ef99342e0ee5069
> 02-22 17:04:28.109: I/DEBUG(86):  d24 3e66376972bea4d0  d25 
> 3fd17460a91d4101
> 02-22 17:04:28.109: I/DEBUG(86):  d26 3ff0000000000000  d27 
> bf5bddcbada9b0e3
> 02-22 17:04:28.109: I/DEBUG(86):  d28 bfff15aeeed843f8  d29 
> 3fad93040d6c79e9
> 02-22 17:04:28.109: I/DEBUG(86):  d30 bc22eadd8918d9a8  d31 
> 3e5077113d200000
> 02-22 17:04:28.109: I/DEBUG(86):  scr 80000012
> 02-22 17:04:28.254: I/DEBUG(86):          #00  pc 00015d04  
> /system/lib/libc.so
> 02-22 17:04:28.254: I/DEBUG(86):          #01  pc 00013e68  
> /system/lib/libc.so
> 02-22 17:04:28.254: I/DEBUG(86):          #02  pc 0001451e  
> /system/lib/libc.so
> 02-22 17:04:28.254: I/DEBUG(86):          #03  pc 0001ac6a  
> /system/lib/libbinder.so
> 02-22 17:04:28.258: I/DEBUG(86):          #04  pc 0001ad64  
> /system/lib/libbinder.so
> 02-22 17:04:28.258: I/DEBUG(86):          #05  pc 0001ad90  
> /system/lib/libbinder.so
> 02-22 17:04:28.258: I/DEBUG(86):          #06  pc 0001ada6  
> /system/lib/libbinder.so
> 02-22 17:04:28.258: I/DEBUG(86):          #07  pc 0001af48  
> /system/lib/libbinder.so
> 02-22 17:04:28.262: I/DEBUG(86):          #08  pc 00032348  
> /system/lib/libmedia.so
> 02-22 17:04:28.262: I/DEBUG(86):          #09  pc 0002f454  
> /system/lib/libmedia.so
> 02-22 17:04:28.262: I/DEBUG(86):          #10  pc 0002fe2a  
> /system/lib/libmedia.so
> 02-22 17:04:28.266: I/DEBUG(86):          #11  pc 0002ffae  
> /system/lib/libmedia.so
> 02-22 17:04:28.266: I/DEBUG(86):          #12  pc 00004764  
> /system/lib/libsoundpool.so
> 02-22 17:04:28.266: I/DEBUG(86): code around pc:
> 02-22 17:04:28.266: I/DEBUG(86): afd15ce4 2c006824 e028d1fb b13368db 
> c064f8df 
> 02-22 17:04:28.266: I/DEBUG(86): afd15cf4 44fc2401 4000f8cc 49124798 
> 25002027 
> 02-22 17:04:28.266: I/DEBUG(86): afd15d04 f7f57008 2106ec64 edd8f7f6 
> 460aa901 
> 02-22 17:04:28.266: I/DEBUG(86): afd15d14 f04f2006 95015380 95029303 
> e93ef7f6 
> 02-22 17:04:28.266: I/DEBUG(86): afd15d24 462aa905 f7f62002 f7f5e94a 
> 2106ec50 
> 02-22 17:04:28.266: I/DEBUG(86): code around lr:
> 02-22 17:04:28.266: I/DEBUG(86): afd19220 4a0e4b0d e92d447b 589c41f0 
> 26004680 
> 02-22 17:04:28.266: I/DEBUG(86): afd19230 686768a5 f9b5e006 b113300c 
> 47c04628 
> 02-22 17:04:28.266: I/DEBUG(86): afd19240 35544306 37fff117 6824d5f5 
> d1ef2c00 
> 02-22 17:04:28.269: I/DEBUG(86): afd19250 e8bd4630 bf0081f0 000282fc 
> ffffff88 
> 02-22 17:04:28.269: I/DEBUG(86): afd19260 b086b570 f602fb01 9004460c 
> a804a901 
> 02-22 17:04:28.269: I/DEBUG(86): stack:
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7e0  afd42684  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7e4  000a0798  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7e8  00000015  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7ec  afd18309  
> /system/lib/libc.so
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7f0  afd4272c  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7f4  afd426d8  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7f8  00000000  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad7fc  afd19241  
> /system/lib/libc.so
> 02-22 17:04:28.269: I/DEBUG(86):     476ad800  00000001  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad804  476ad834  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad808  00000000  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad80c  083a1ffc  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad810  476ad9c4  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad814  afd18563  
> /system/lib/libc.so
> 02-22 17:04:28.269: I/DEBUG(86):     476ad818  df002777  
> 02-22 17:04:28.269: I/DEBUG(86):     476ad81c  e3a070ad  
> 02-22 17:04:28.269: I/DEBUG(86): #00 476ad820  a8223204  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad824  00000000  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad828  00000006  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad82c  afd46470  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad830  00000000  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad834  fffffbdf  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad838  476ad9c4  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad83c  00403120  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad840  0000003b  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad844  afd13e6d  
> /system/lib/libc.so
> 02-22 17:04:28.273: I/DEBUG(86): #01 476ad848  476ad91c  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad84c  00000006  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad850  00000000  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad854  00000b17  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad858  476ad9c4  
> 02-22 17:04:28.273: I/DEBUG(86):     476ad85c  afd14521  
> /system/lib/libc.so
> 02-22 17:04:29.367: I/BootReceiver(324): Copying 
> /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
> 02-22 17:04:29.375: I/DEBUG(86): dumpstate 
> /data/log/dumpstate_app_native.txt
>
The device is a Samsung Galaxy S running Android 2.3.5 and it looks like 
the native counterpart of SoundPool caused that crash. As far as I know you 
get that kind of crash when memory allocation notices heap memory 
corruption on the native side. However, my game is written in pure Java so 
far and and it does not allocate any native heap memory directly. Only 
indirectly by decoding Bitmaps for creating textures and loading short 
sound samples into SoundPool.

My game has currently 16 sound samples loaded in memory. I guess it's a bit 
too much and I will change that soon. A few of these sounds do not need to 
be in memory all the time. On the OpenGL-end there are between 60 up to 70 
textures at an average resolution of 256x256 loaded. The original bitmaps 
are not kept in memory. It's a lot but I need to render bitmap animation 
sequences. And so far my phone did not complain. Performance is also pretty 
good.

I bet that this crash will occur much more often out in the wild and I'm a 
bit concerned about that because users will hold me responsible for that. I 
just want to ask you folks about your experience with SoundPool and game 
development. What am I doing wrong? How to get around this problem?

Thanks!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to