gpt4 book ai didi

c - SSL_library_init 在 gdb 下运行时导致 SIGILL

转载 作者:IT王子 更新时间:2023-10-29 00:43:31 25 4
gpt4 key购买 nike

尝试使用 gdb 调试程序时,它在 OPENSSL_cpuid_setup 中报告 SIGILL 失败。
使用这个简单的代码,我有相同的行为:

#include <openssl/ssl.h>
int main()
{
SSL_library_init();
}

它编译并运行良好,但在回溯之后以 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?)

如何在 gdb 下运行这样的程序?

最佳答案

SSL_library_init cause SIGILL when running under gdb...

它实际上一直在这样做,而不仅仅是在 GDB 下。这是启动代码中的正常行为,因为库会测试处理器功能。您可以通过发出 handle SIGILL nostop 安全地忽略它。

有关更多详细信息,请参阅 OpenSSL 常见问题解答中的第 17 项:When debugging I observe SIGILL during OpenSSL initialization: why? .

关于c - SSL_library_init 在 gdb 下运行时导致 SIGILL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25708907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com