Re: illegal instruction

David E. Fox (
Mon, 17 Aug 1998 21:03:12 -0700

On Tue, 18 Aug 1998, Aaron Walker wrote:

>... (usual gdb intro)
>Program terminated with signal 4, Illegal Instruction.
>find_solib: Can't read pathname for load map: Input/output error
>#0 0xbffffa5a in ?? ()

If you possess the source for it, recompile it with -g. This will let
you see the source where it dumped core. If it was inside a library,
you wouldn't be able to see its source lest you had it also compiled
with -g.

You probably also want to use 'bt' in gdb to get an idea what functions
were called and roughly how far the program got before it died.

>Does anyone know what an "Illegal Instruction" is and what causes it?

Well, an illegal instruction is just that -- illegal. (Penalties for
executing one are usually not too harsh) :).

It's an opcode sequence that isn't defined as such. Since gcc wouldn't
(we hope) emit such an opcode sequence, the most likely cause is that
some pointer got wild and somehow the instruction pointer got
misplaced, and started executing garbage, or data, rather than

Lots of things can cause this -- an improperly initialized function
pointer, for instance.

David E. Fox                 Tax              Thanks for letting me   the              change magnetic patterns      churches         on your hard disk.

  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES! /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail with 
                       "unsubscribe" as the Subject.