SSL_library_init calls SIGILL when working under gdb

Trying to debug a program using gdb, it does not report SIGILL to OPENSSL_cpuid_setup.
With this simple code, I have the same behavior:

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

It compiles and works well, but starting with a gdb report after backtrace

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?)

How to run such a program under gdb?

+4
source share
3 answers

SSL_library_init calls SIGILL when launched under gdb ...

This is actually all the time, and not just under GDB. This is normal behavior in the startup code, since the library is testing processor functions. You can safely ignore it by releasing handle SIGILL nostop.

. 17 FAQ OpenSSL : SIGILL OpenSSL: ?.

+7

GDB , SIGILLs GDB :

handle SIGILL nostop
0

I got a similar situation in BBB. However, if I ignore the signal and continue, the process continues normally. I'm not sure why, but it seems that in this situation the signal can be ignored.

-1
source

All Articles