Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes signal 'SIGILL'?

I'm porting some C++ code to Android using NDK and GCC. The code basically runs. At one point, when debugging in Eclipse, the call

Dabbler::Android::Factory* pFactory = new Dabbler::Android::Factory;

causes this error:

Thread [1] (Suspended: Signal 'SIGILL' received. Description: Illegal instruction.) 
    1 <symbol is not available> 0x812feb44

What does that mean? Has the compiler generated illegal code for some reason? I have a breakpoint in the constructor (which does nothing), and it's not hit. I have already done a full rebuild.

What could I be doing wrong to cause this problem?

like image 301
Dabbler Avatar asked Oct 26 '11 11:10

Dabbler


2 Answers

Make sure that all functions with non-void return type have a return statement.

While some compilers automatically provide a default return value, others will send a SIGILL or SIGTRAP at runtime when trying to leave a function without a return value.

like image 189
Max Klint Avatar answered Nov 12 '22 02:11

Max Klint


It means the CPU attempted to execute an instruction it didn't understand. This could be caused by corruption I guess, or maybe it's been compiled for the wrong architecture (in which case I would have thought the O/S would refuse to run the executable). Not entirely sure what the root issue is.

like image 34
trojanfoe Avatar answered Nov 12 '22 03:11

trojanfoe