Native crash at /system/lib/libc.so in /system/lib/libc.so (tgkill+12), /system/lib/libc.so (pthread_kill+48)

(build using 2014.2511)

I’m getting a large number of these error reports over the last few days with one of my new app builds, and i’m wondering if anyone has any clues what might be the cause (any general direction would help). The only thing i can be sure of is that it only happens in android kitkat4.4 as no other user bug reports about this are coming in from users using other android versions.

Native crash at /system/lib/libc.so

in /system/lib/libc.so (tgkill+12), /system/lib/libc.so (pthread_kill+48)

 

signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------

Abort message: ‘heap corruption detected by dlfree’
r0 00000000 r1 0000611a r2 00000006 r3 00000000
r4 00000006 r5 00000016 r6 0000611a r7 0000010c
r8 00000003 r9 61089204 sl 658feda8 fp 60ce6f10
ip 00000000 sp 6118c2f8 lr 4003f11d pc 4004e310 cpsr 080f0010
d0 65746564206e6f64 d1 207962206465746c
d2 0000000000000066 d3 3fe0000000000072
d4 3fe0b04be457e000 d5 3fde9f6837504000
d6 0000000000000000 d7 3ce3624dd2f1a9fc
d8 0000000000000000 d9 3f80000042700000
d10 000000003f7fffec d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 3f4bf08eb0000000 d17 3f4bf08eb0000000
d18 42a2309ce5400000 d19 be5ae5e447ee2cb8
d20 3ff589374bc6a7f0 d21 4095080000000000
d22 3fa6fbd73f2431d0 d23 3f6e8dae4711acad
d24 3f35f1dca40e02ac d25 3fb33dc34566b9dc
d26 4095080000000000 d27 3ff921fb54442d18
d28 3fb6fbd4c687ac7c d29 bfc53cd13f6568de
d30 3f9b8bf7c9ddfe85 d31 4000000000000000
scr 28000018

backtrace:
#00 pc 00022310 /system/lib/libc.so (tgkill+12)
#01 pc 00013119 /system/lib/libc.so (pthread_kill+48)
#02 pc 0001332d /system/lib/libc.so (raise+10)
#03 pc 00012061 /system/lib/libc.so
#04 pc 00021bc4 /system/lib/libc.so (abort+4)
#05 pc 00012b49 /system/lib/libc.so
#06 pc 0000f26d /system/lib/libc.so
#07 pc 0001182b /system/lib/libc.so (dlfree+1222)
#08 pc 0000dd47 /system/lib/libc.so (free+10)
#09 pc 000763ec /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#10 pc 000691e8 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#11 pc 00069210 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#12 pc 000a1a64 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#13 pc 0009f6f0 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#14 pc 00076f70 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#15 pc 00076214 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#16 pc 0008a618 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#17 pc 00078378 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#18 pc 00078168 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#19 pc 0007e6ec /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#20 pc 0009f070 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#21 pc 0009f4d0 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#22 pc 000c7048 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#23 pc 000c1a60 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#24 pc 0000cae4 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#25 pc 0000cea8 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#26 pc 0001bb6c /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#27 pc 0001cd48 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#28 pc 0000cef4 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#29 pc 0000c228 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#30 pc 0000d06c /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#31 pc 000053f4 /data/app-lib/com.vanderveergames.wotz-5/liblua.so (lua_pcall+76)

…and this is a similar one…

signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: ‘heap corruption detected by dlfree’
r0 00000000 r1 00001aa6 r2 00000006 r3 00000000
r4 00000006 r5 00000016 r6 00001aa6 r7 0000010c
r8 00000021 r9 00000001 sl 620bde30 fp 620fea30
ip 00000000 sp 6118e7f8 lr 4003f11d pc 4004e310 cpsr 080b0010
d0 65746564206e6f64 d1 207962206465746c
d2 32223a2264695f66 d3 6332356464356472
d4 3535626262626166 d5 0000000133396234
d6 4024000000000000 d7 41d521b922c00000
d8 0000000000000000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 3feffe85ad6a0000 d17 4023ffe85ad6a000
d18 42a2309ce5400000 d19 0000000000000000
d20 3ff6b0a367a3a83b d21 4274a2ecfe828000
d22 3fca9cab3ea5addb d23 3dea39ef35793c76
d24 3fd1b10853a79915 d25 3fd554fa9ca0567a
d26 4274a2ecfe828000 d27 3fe33333332d4313
d28 3ff0000000000000 d29 0000000000000001
d30 fff0000000000000 d31 4000000000000000
scr 28000018

backtrace:
#00 pc 00022310 /system/lib/libc.so (tgkill+12)
#01 pc 00013119 /system/lib/libc.so (pthread_kill+48)
#02 pc 0001332d /system/lib/libc.so (raise+10)
#03 pc 00012061 /system/lib/libc.so
#04 pc 00021bc4 /system/lib/libc.so (abort+4)
#05 pc 00012b49 /system/lib/libc.so
#06 pc 0000f26d /system/lib/libc.so
#07 pc 0001182b /system/lib/libc.so (dlfree+1222)
#08 pc 0000dd47 /system/lib/libc.so (free+10)
#09 pc 000b2e94 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#10 pc 00011c00 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#11 pc 0000e560 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#12 pc 0000e8cc /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#13 pc 0000ed94 /data/app-lib/com.vanderveergames.wotz-5/liblua.so
#14 pc 00005588 /data/app-lib/com.vanderveergames.wotz-5/liblua.so (lua_gc+108)
#15 pc 000b3428 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#16 pc 0007df3c /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#17 pc 000acee0 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#18 pc 000d4c70 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#19 pc 000cdcec /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#20 pc 00046e14 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#21 pc 00046fcc /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#22 pc 0004a59c /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#23 pc 000d0ad0 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#24 pc 0007bb34 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#25 pc 000d4bf0 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#26 pc 00070160 /data/app-lib/com.vanderveergames.wotz-5/libcorona.so
#27 pc 0001e98c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#28 pc 0004ee6b /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
#29 pc 00027da0 /system/lib/libdvm.so
#30 pc 0002ed48 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#31 pc 0002c3f4 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)

not sure if this has anything to do with a device running out of memory (texture memory?)

any help from you guys is much appreciated,

Jacques

For anyone interested, I’m not sure if this solved this issue on Android (seems to only affect kitkat4.4) but after removing all “multiply” & “screen” blend modes as well as changing all sound files to 48000 sample rate, so far I have not seen any new reports of this crash.

Corona does mention that those 2 blendmodes do not work properly on all android devices, as to the mp3 sample rate, I have no idea if that causes any issues (but ADM did show it was changing 44100 > 48000 sometimes), so if you do come across this crash report you can always try removing/changing those things I mentioned above.

44khz files should be fine.  It’s a standard bit rate.  However, some audio clips could have errors when they were encoded to begin with that could cause errors.

Rob

Thanks Rob, not sure exactly which audio clips (quite a few of my clips are converted from .wav files) that the android device was indicating in the ADM console but at least now don’t have any mention of the device trying to change them to 48000. I would like to ask though what would be the most common reason for getting a heap corruption crash, could a standard bug in the corona lua code cause this or is a heap corruption related more to audio errors, or graphic errors or out-of memory errors?

Well the blend modes are surely suspect if your GPU is under rated.  As we noted the don’t work all on all devices.

As for the Audio, Android is almost like Windows PC’s.  There are many hardware makers and many different device drivers to bridge between Android and the device.  On top of that is the codec (coder-decoder) which is software that decodes the format into the binary data for the hardware layer.  These codec’s typically vary with the hardware involved.   Unlike Apple who manages the hardware and software from end to end, you end up with a system where not all hardware-software configurations are equal.  So an iffy/corrupt sound file could easily trigger some bad code in the codec that triggers a crash.

Rob

Appreciate the extra details Rob, yes I use a samsung tabs 8.4 and never came across a heap corruption crash but perhaps some of the other users were lower end devices, one user in particular who kept getting heap corruption crashes after only a few minutes each time was using an Samsung SGH-T399N which i assume is considered a lower end device? Is there anyway to know if a sound file is corrupt? Secondly, is it advisable to use .ogg audio files instead of .mp3 files for android devices, are .ogg less likely to get corrupted when playing them in an app? Lastly, if it’s not too much trouble, why do these heap corruption crashes only seem to be happening in kitkat4.4? I’ve been reading online that many dev are experience this issue with users of kitkat4.4. Appreciate your extra time :slight_smile:

OOG vs. MP3:  Neither are more or less likely to be corrupt.  MP3 has some patent encumbrance that OOG doesn’t have.  There could be one day the folks who old the MP3 patent may crack down on it but they’ve not shown signs that they are going to.  OOG has fewer patents in the way.

If heap corruptions seem to be more common in 4.4 then perhaps Google has an issue in 4.4 or how 4.4 integrates with certain hardware setups.

As for the Samsung SGH-T399N.   I did a quick google on it, and I didn’t find much useful info on it other than it’s considered a “Light” model, which tells me lower end hardware.  But there are other possibilities too.  Perhaps that user has a Rooted phone.   Perhaps they have a defective device with some memory errors.  All remote possibilities, but possibilities none the less.

Do you have the largeHeap setting turned on in your build.settings?  Could the user be running quite a few apps and not have a lot of memory?

Rob

Thanks for your time Rob, yes I do have largeHeap=true in build.settings which i guess could be another reason or at least creates another possible reason for the heap to get corrupted. I will post here in a few days and let everyone know whether any users still get heap corruption errors, as of now 1.5days after removing the blend modes there have been no crashes so hopefully this may be of use to others if they run into similar issues. Cheers.

For anyone interested, I’m not sure if this solved this issue on Android (seems to only affect kitkat4.4) but after removing all “multiply” & “screen” blend modes as well as changing all sound files to 48000 sample rate, so far I have not seen any new reports of this crash.

Corona does mention that those 2 blendmodes do not work properly on all android devices, as to the mp3 sample rate, I have no idea if that causes any issues (but ADM did show it was changing 44100 > 48000 sometimes), so if you do come across this crash report you can always try removing/changing those things I mentioned above.

44khz files should be fine.  It’s a standard bit rate.  However, some audio clips could have errors when they were encoded to begin with that could cause errors.

Rob

Thanks Rob, not sure exactly which audio clips (quite a few of my clips are converted from .wav files) that the android device was indicating in the ADM console but at least now don’t have any mention of the device trying to change them to 48000. I would like to ask though what would be the most common reason for getting a heap corruption crash, could a standard bug in the corona lua code cause this or is a heap corruption related more to audio errors, or graphic errors or out-of memory errors?

Well the blend modes are surely suspect if your GPU is under rated.  As we noted the don’t work all on all devices.

As for the Audio, Android is almost like Windows PC’s.  There are many hardware makers and many different device drivers to bridge between Android and the device.  On top of that is the codec (coder-decoder) which is software that decodes the format into the binary data for the hardware layer.  These codec’s typically vary with the hardware involved.   Unlike Apple who manages the hardware and software from end to end, you end up with a system where not all hardware-software configurations are equal.  So an iffy/corrupt sound file could easily trigger some bad code in the codec that triggers a crash.

Rob

Appreciate the extra details Rob, yes I use a samsung tabs 8.4 and never came across a heap corruption crash but perhaps some of the other users were lower end devices, one user in particular who kept getting heap corruption crashes after only a few minutes each time was using an Samsung SGH-T399N which i assume is considered a lower end device? Is there anyway to know if a sound file is corrupt? Secondly, is it advisable to use .ogg audio files instead of .mp3 files for android devices, are .ogg less likely to get corrupted when playing them in an app? Lastly, if it’s not too much trouble, why do these heap corruption crashes only seem to be happening in kitkat4.4? I’ve been reading online that many dev are experience this issue with users of kitkat4.4. Appreciate your extra time :slight_smile:

OOG vs. MP3:  Neither are more or less likely to be corrupt.  MP3 has some patent encumbrance that OOG doesn’t have.  There could be one day the folks who old the MP3 patent may crack down on it but they’ve not shown signs that they are going to.  OOG has fewer patents in the way.

If heap corruptions seem to be more common in 4.4 then perhaps Google has an issue in 4.4 or how 4.4 integrates with certain hardware setups.

As for the Samsung SGH-T399N.   I did a quick google on it, and I didn’t find much useful info on it other than it’s considered a “Light” model, which tells me lower end hardware.  But there are other possibilities too.  Perhaps that user has a Rooted phone.   Perhaps they have a defective device with some memory errors.  All remote possibilities, but possibilities none the less.

Do you have the largeHeap setting turned on in your build.settings?  Could the user be running quite a few apps and not have a lot of memory?

Rob

Thanks for your time Rob, yes I do have largeHeap=true in build.settings which i guess could be another reason or at least creates another possible reason for the heap to get corrupted. I will post here in a few days and let everyone know whether any users still get heap corruption errors, as of now 1.5days after removing the blend modes there have been no crashes so hopefully this may be of use to others if they run into similar issues. Cheers.