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

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

问题描述

我正在研究在Android上某些ARM崩溃,并实现了部分内存地址位置不是2字节对齐(经​​验/ 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是而#01和#03都没有2字节对齐的。为什么任何解释会这样呢?谢谢你。

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模式切换到拇指或反之亦然根据地址的最低位,所以我想这是你最终在回溯看为好。

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天全站免登陆