核心转储地址未字节对齐 [英] core dump addresses not byte aligned

查看:23
本文介绍了核心转储地址未字节对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在检查 Android 上的一些 ARM 崩溃,并意识到一些内存地址位置不是 2 字节对齐的(THUMB/ARM),但有些是.有谁知道为什么会这样?这是一个墓碑示例:

I was examining some ARM crashes on Android and realised some memory addresses positions are not 2-byte aligned (THUMB/ARM) but some are. Does any one know why is that so? Here is an example tombstone:

Stack frame #00 pc 00072c9a /system/lib/libdvm.so (dvmAbort+170)
Stack frame #01 pc 00050f6b /system/lib/libdvm.so (ScopedCheck::checkInstanceFieldID(_jobject*, _jfieldID*)+379)
Stack frame #02 pc 0005db56 /system/lib/libdvm.so (Check_SetBooleanField(_JNIEnv*, _jobject*, _jfieldID*, unsigned char)+150)
Stack frame #03 pc 00003a93 /system/lib/libmytestt.so (Java_com_test_jni_MyLibWrapper_getMonitorSample+259)
Stack frame #04 pc 0002d850 /system/lib/libdvm.so (dvmPlatformInvoke+80)
Stack frame #05 pc 00085b48 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+648)
Stack frame #06 pc 000505db /system/lib/libdvm.so (dvmCheckCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+59)
Stack frame #07 pc 0008b96d /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+317)
Stack frame #08 pc 00170ff1 /system/lib/libdvm.so

可以看到#00、#02 是2 字节对齐的,而#01 和#03 不是.任何解释为什么会这样?谢谢.

One can see that #00, #02 are 2 byte aligned while #01 and #03 are not. Any explanation of why is it so? Thanks.

推荐答案

我猜奇数地址表示这些函数处于 THUMB 模式,而偶数地址表示这些函数处于 ARM 模式.当从带有 bx lr 的函数返回时,处理器会根据地址的最低位从 ARM 模式切换到 THUMB 模式,反之亦然,所以我猜这就是你最终看到的回溯也是如此.

I would guess that the odd addresses indicate that those functions are in THUMB mode, while the even addresses are in ARM mode. When returning from a function with bx lr, the processor will switch from ARM mode to THUMB or vice versa depending on the lowest bit of the address, so I'd guess this is what you end up seeing in the backtrace as well.

这篇关于核心转储地址未字节对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆