1

I have been running and testing my android native app for weeks now in debug mode without issues. Today, I decided to test it in release mode by selecting "debuggable" as "false" in the android manifest and using ant release install to build.

However, when I attempt to run my app, I get an error message like:

I/DEBUG ( 264): signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 5c27f389

which I assume is a data alignment error (according to google). But as soon as I turn debuggable on, the app no longer crashes.

What could've caused this error? I'm not even sure where to start to look because the crash only occurs when I turn debuggable off.

4

1 回答 1

0

SIGBUS 与 SIGSEGV 的相似之处在于它是由非法内存访问引起的。当调试打开时,使用更大的内存块使这些问题不那么明显。这并不意味着调试版本中不存在该错误,它只是意味着它没有导致崩溃。相反,您可能会遇到严重的内存损坏。

您正在发生崩溃,因此您正在获得崩溃转储。在故障转储中,您将获得地址和 .so 文件的调用堆栈。

您可以通过使用地址和模块调用 addr2line 来找到地址正在使用的函数。如果你想要一个完整的反汇编 objdump 可以使用。您要么必须安装这些程序的 arm 版本,要么使用 android NDK 中的那些。

于 2013-07-04T16:07:44.380 回答