mpr*_*net 6 c linux gdb openssl raspberry-pi
尝试使用gdb调试程序时,它无法在OPENSSL_cpuid_setup中报告SIGILL.
使用这个简单的代码我有相同的行为:
#include <openssl/ssl.h>
int main()
{
SSL_library_init();
}
Run Code Online (Sandbox Code Playgroud)
它编译并运行良好,但从跟踪回溯后的gdb报告开始
Program received signal SIGILL, Illegal instruction.
0xb6b2eb40 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) where
#0 0xb6b2eb40 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#1 0xb6b2b404 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#2 0xb6fdf058 in call_init (l=<optimized out>, argc=1, argv=0xbefff7d4, env=0xbefff7dc) at dl-init.c:78
#3 0xb6fdf134 in _dl_init (main_map=0xb6fff958, argc=1, argv=0xbefff7d4, env=0xbefff7dc) at dl-init.c:126
#4 0xb6fcfda4 in _dl_start_user () from /lib/ld-linux-armhf.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Run Code Online (Sandbox Code Playgroud)
如何在gdb下运行这样的程序?
jww*_*jww 12
SSL_library_init在gdb下运行时导致SIGILL ...
它实际上一直在做,而不仅仅是在GDB下.这是启动代码中的正常行为,因为库测试处理器功能.您可以通过发布安全地忽略它handle SIGILL nostop.
有关详细信息,请参阅OpenSSL FAQ中的第17项:调试时,我在OpenSSL初始化期间观察SIGILL:为什么?.