专注计算机技术: Linux Android 云计算 虚拟化 网络
分类: Android平台
2015-03-28 07:39:59
On Feb 11, 7:07 am, Mike Edenfield <kut...@kutulu.org> wrote:
A fault address of deadbaad is a signal that your problem is a corrupt
memory heap. The error's going to come from libc, but that's just
because libc's memory management routines are what ultimately triggered
the fault, not because libc itself is buggy. The most likely cause is
somewhere in your code that you're calling free() or delete on something
you don't own, or have already released. That's causing heap corruption
that breaks things later on down the road.
Actually, deadbaad is what the libc abort() function uses to kill the
process. 99% of the time the code calling abort() is in malloc/free,
but it's certainly possible that something else could be calling it.
My recommendation to anyone doing native development is to make sure
CheckJNI is enabled (it's on by default in the emulator, and you can
turn it on with "setprop dalvik.vm.checkjni true ; stop ; start" on a
rooted device). You can also try some of the enhanced memory checking
modes. "setprop libc.debug.malloc 10" will turn on some native heap
malloc guards, and "setprop dalvik.vm.jniopts forcecopy" will add some
memory buffer protection to CheckJNI.
在android系统中,有一些初始化的配置文件,例如:
/init.rc
/default.prop
/system/build.prop
文件里面里面配置了开机设置的系统属性值,
这些属性值,可以通过getprop获取,setprop设置,
它的格式如下:
getprop [key]
获取指定key的配置值,如果不带参数,只是getprop则是显示系统所有的配置值。
[dalvik.vm.heapsize]: [24m]
[curlockscreen]: [1]
[ro.sf.hwrotation]: [0]
[ro.config.notification_sound]: [OnTheHunt.ogg]
[ro.config.alarm_alert]: [Alarm_Classic.ogg]