Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 38 down vote accepted

It works now. For anyone else struggling with Android/NDK/GCC/Eclipse, here's how I solved it:

  1. Bury a dead cat at midnight when full moon
  2. Restart the Android device emulator

Haven't verified if both steps are really necessary, and if not, which one is redundant.

share|improve this answer
6  
I hope no cats were harmed in the making of this answer. :) –  TheCodeArtist Sep 25 '13 at 2:00
11  
Thanks will try this tonight –  Brandon Yates Nov 21 '13 at 21:55

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.

share|improve this answer
1  
Another cause of execing an invalid instruction is jumping to an address that isn't in the program area. –  Paul Nathan Jan 10 '12 at 16:56

It could be some un-initialized function pointer, in particular if you have corrupted memory (then the bogus vtable of C++ bad pointers to invalid objects might give that).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.