我无法在Raspberry Pi 3开发板(RPI3)上获得崩溃的后备跟踪。 RPI3是一款带有Broadcom SoC的低端ARMv8,具有CRC32扩展,但没有加密扩展。
该程序是Botan Crypto and TLS C++ library的测试套件。该程序使用以下标志构建。 --debug-mode
表示程序是使用符号(-g
)构建的,没有优化(没有-O
)。
./configure.py --cc=gcc --debug-mode --cpu=armv8-a --cc-abi-flags="-march=armv8-a+crc \
-mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -fno-omit-frame-pointer"
尝试对SIGABRT
进行回溯跟踪会产生以下结果:
...
DLIES XOR ran 12 tests all ok
[New Thread 0x765bf450 (LWP 3674)]
pure virtual method called
terminate called without an active exception
Thread 2 "botan-test" received signal SIGABRT, Aborted.
[Switching to Thread 0x765bf450 (LWP 3674)]
0x765fef70 in raise () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) bt full
#0 0x765fef70 in raise () from /lib/arm-linux-gnueabihf/libc.so.6
No symbol table info available.
#1 0x76600324 in abort () from /lib/arm-linux-gnueabihf/libc.so.6
No symbol table info available.
#2 0x00000020 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
已安装 libc6-dev
。我理解FP是帧指针(R11),SP是堆栈寄存器(R13),LR是链接寄存器(R14),PC是程序计数器(R15)。我不清楚GDB的上述消息是否意味着R11或R14是否已损坏,或者是否有其他事情发生。
如何恢复损坏后跟踪的帧指针并在损坏之前重新启动后跟踪?
根据ARM: link register and frame pointer的artless_noise,基本框架布局为:
fp[-0] saved pc, where we stored this frame.
fp[-1] saved lr, the return address for this function.
fp[-2] previous sp, before this function eats stack.
fp[-3] previous fp, the last stack frame.
many optional registers...
我不知道如何(1)发现一个好的帧指针,(2)将事物粘在一起,(3)重新启动后跟踪。
操作系统是32位Raspbian,可能与此问题有关,因为它是为具有硬浮动的ARMv7构建的。
据我所知,没有什么能阻止程序在此配置中使用ARMv8指令。实际上,其他测试程序在类似的配置中运行良好。但我不排除其他测试程序没有出现的ABI问题。