views:

76

answers:

2

I've got an app that I'm trying to get working again after wiping my system and installing Snow Leopard. I installed Ruby 1.9 from Macports (now a later version) and the dev server starts up just fine, but then dies on the first request, only telling me "Illegal instruction". I have no idea what's causing this or even how to go about debugging it. Does anyone have any ideas?

+2  A: 

"Illegal instruction" is usually an error message from the CPU meaning some piece of binary code you tried to run contained an instruction that is not implemented on that particular CPU.

This can have multiple reasons:

  • The binary was compiled with optimization settings for the wrong CPU. The CPU vendors add new instructions all the time, if the compiler optimizes for a CPU that is newer than the one you have, it might have emitted an instruction that your CPU doesn't understand.
  • The compiler is broken.
  • The binary is corrupted.
  • The code you are compiling contains assembly code or intrinsics containing instructions that your CPU doesn't have.
Jörg W Mittag
A: 

Got it! Appropriately enough, the error was caused by a stack overflow.