Dworkin
Posts: 13
Joined: Thu Aug 06, 2015 7:39 pm

Illegal instruction?

Sat Aug 08, 2015 8:11 pm

Hello everybody,
today, I have succefully compile a personnal program on my Raspberry Pi 2, but after two succeffull run, it has been automatically killed.
I have relaunched it with GDB, the program has been automaticly killed very quickly, and I have a very strange error :

Code: Select all

Program received signal SIGILL, Illegal instruction.
0x768fa608 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) bt
#0  0x768fa608 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
Cannot access memory at address 0x0
#1  0x768f7004 in OPENSSL_cpuid_setup ()
   from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#2  0x76fdf058 in ?? () from /lib/ld-linux-armhf.so.3
#3  0x7efff6c2 in ?? ()
#4  0x7efff6c2 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Do you think my raspberry have a problem?
Or my micro-sd memory card?

User avatar
PeterO
Posts: 6218
Joined: Sun Jul 22, 2012 4:14 pm

Re: Illegal instruction?

Sat Aug 08, 2015 8:28 pm

viewtopic.php?f=33&t=15132#p155379

Libcrypto tries to work out the fastest way to do things, and if it tries to use an instruction that the PI's cpu doesn't support it recieves a SIGILL (SIGnal of ILLegal instruction) from the kernal. Libcrypto normally handles this correctly, but gdb will handle this unless you tell it otherwise (as detailed in the referenced post above).

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PICO,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Dworkin
Posts: 13
Joined: Thu Aug 06, 2015 7:39 pm

Re: Illegal instruction?

Sat Aug 08, 2015 9:30 pm

That work :-)
Thank you. :-)
But it seems always strange for me : why Libcrypto do Illegal instruction?
It seems more clever to choose which instruction to send at compilation phase instead of try instruction and intercept signal, no?
Is it the Debian package which is badly build?
Or is there programming problem with Libcrypto?
Or is there something I don't understand?

W. H. Heydt
Posts: 16352
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Illegal instruction?

Sun Aug 09, 2015 3:38 am

Dworkin wrote: It seems more clever to choose which instruction to send at compilation phase instead of try instruction and intercept signal, no?
Suppose you compiled the program on a Pi2B (ARMv7) and then ran it on a B+ (ARMv6)....

Dworkin
Posts: 13
Joined: Thu Aug 06, 2015 7:39 pm

Re: Illegal instruction?

Sun Aug 09, 2015 9:07 am

Suppose you compiled the program on a Pi2B (ARMv7) and then ran it on a B+ (ARMv6)....
I have totally forgot that Raspbian is used in different Raspberry with different processor :s
Thank you for the response :-)

Return to “Beginners”