Illegal instruction (core dumped) 
Author Message
 Illegal instruction (core dumped)

Quote:

> Hello, Anyone who know what is "Illegal instruction (core dumped)" ??
> When I compiled and Run a fortran files in UNIX, this error comes out.

It's a common problem in Unix, Windows, etc., and is most often caused by
programmer error, usually by exceeding the bounds of an array via an
invalid access. I've cross posted to comp.lang.fortran, a more appropriate
ng for Fortran-specific problems.

--
E&OE

HTH,
Gerry T.



Sat, 28 Oct 2006 13:19:27 GMT  
 Illegal instruction (core dumped)

Quote:

> > Hello, Anyone who know what is "Illegal instruction (core dumped)" ??
> > When I compiled and Run a fortran files in UNIX, this error comes out.
> It's a common problem in Unix, Windows, etc., and is most often caused by
> programmer error, usually by exceeding the bounds of an array via an
> invalid access. I've cross posted to comp.lang.fortran, a more appropriate
> ng for Fortran-specific problems.

It means that a machine-level instruction mnemonic was issued
that didn't correspond to any machine-level mnemonic known to
the current processor.  One way this could happen is that code
was compiled for a different processor than it was actually
run on, but most frequently some instructions would be placed
in the executable prolog that would result in a more user-
friendly diagnostic in this case.

More commonly an instruction was issued to the processor that
wasn't part of the compiled code either by:
1) overwriting the compiled code by writing to an invalid array
   index (although in many environments this would be trapped
   and you would get a segmentation fault or a bus error rather
   than surviving to issue an invalid instruction)
2) jumping to an unanticipated address by either
2a) associating a data actual argument with a procedure dummy
    argument or
2b) messing up the stack (kind of requires a compiler that
    has a callee cleans up the stack calling convention, in
    which case invoking a procedure with the wrong number of
    arguments or the wrong number of character arguments
    could do the trick.)

I would start off by trying to catch out of bounds array
accesses with a compiler switch.  If fixing these little
nightmares doesn't make your problems go away, I would
then try to pin down as near as possible where the error
happens by inserting some write statements.  Does it happen
right at some procedure call or return?  Compare actual
arguments with dummy arguments for the offending procedure.

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end



Sat, 28 Oct 2006 14:39:52 GMT  
 Illegal instruction (core dumped)
James Van Buskirk (aka Bruce) was almost, but not quite, entirely unlike tea:

Quote:



>> > Hello, Anyone who know what is "Illegal instruction (core dumped)" ??
>> > When I compiled and Run a fortran files in UNIX, this error comes out.
...
> More commonly an instruction was issued to the processor that
> wasn't part of the compiled code either by:
> 1) overwriting the compiled code by writing to an invalid array
>    index (although in many environments this would be trapped
>    and you would get a segmentation fault or a bus error rather
>    than surviving to issue an invalid instruction)
> 2) jumping to an unanticipated address by either
> 2a) associating a data actual argument with a procedure dummy
>     argument or
> 2b) messing up the stack (kind of requires a compiler that
>     has a callee cleans up the stack calling convention, in
>     which case invoking a procedure with the wrong number of
>     arguments or the wrong number of character arguments
>     could do the trick.)

Or more simply, and more likely in a lot of situations (assuming all
the run-time checks are turned on so one wouldn't get out of bounds
errors in the first place): Did you optimise your code for one
particular sub-family of CPUs, such as a P4, and are running it on a
lower class machine?

On ifc, turn off the (eg) -xW swtich, and try again.

--
TimC -- http://astronomy.swin.edu.au/staff/tconnors/
Yesterday, after years of trying, I finally managed to take a photo of a
subway train that said "INSTRUCTION CAR" just so that someday I can caption
it "...but where's the DATA CDR?" when I'm ready to make a joke that's
nerdy even by the standards of jokes about LISP.    -- James "Kibo" Perry



Sat, 28 Oct 2006 15:16:23 GMT  
 Illegal instruction (core dumped)

Quote:


> > Hello, Anyone who know what is "Illegal instruction (core dumped)" ??
> > When I compiled and Run a fortran files in UNIX, this error comes out.

> It's a common problem in Unix, Windows, etc., and is most often caused by
> programmer error, usually by exceeding the bounds of an array via an
> invalid access. I've cross posted to comp.lang.fortran, a more appropriate
> ng for Fortran-specific problems.

Other causes of such a symptoms with Fortran code include;

         a)   Calling a function or subroutine with less arguments than
                 the actual function or subroutine accepts --- particularly
                 if the argument in question gets modified.

         b)   Passing an argument of wrong type, particularly a type of
                 different physical type.  For example, passing an integer
                 when the called subprogram expects a double precision
                 or a string.

Such things are not specific to Fortran.  Such programming errors cause
similar errors in several programming languages (C, Pascal, etc).



Sat, 28 Oct 2006 21:50:13 GMT  
 Illegal instruction (core dumped)
Rob (aka Bruce) was almost, but not quite, entirely unlike tea:

Quote:



>> > Hello, Anyone who know what is "Illegal instruction (core dumped)" ??
>> > When I compiled and Run a fortran files in UNIX, this error comes out.
...
> Other causes of such a symptoms with Fortran code include;

>          a)   Calling a function or subroutine with less arguments than
>                  the actual function or subroutine accepts --- particularly
>                  if the argument in question gets modified.

>          b)   Passing an argument of wrong type, particularly a type of
>                  different physical type.  For example, passing an integer
>                  when the called subprogram expects a double precision
>                  or a string.

These are for core dumps, but the OP was talking about "illegal
instruction" in particular - SIGILL.

--
TimC -- http://astronomy.swin.edu.au/staff/tconnors/
Disclaimer: Due to feline interference, this post may contain typographical
errors.



Sat, 28 Oct 2006 22:24:19 GMT  
 Illegal instruction (core dumped)

Quote:

> Rob (aka Bruce) was almost, but not quite, entirely unlike tea:



>>> > Hello, Anyone who know what is "Illegal instruction (core dumped)" ??
>>> > When I compiled and Run a fortran files in UNIX, this error comes out.
> ...
>> Other causes of such a symptoms with Fortran code include;

>>          a)   Calling a function or subroutine with less arguments than
>>                  the actual function or subroutine accepts --- particularly
>>                  if the argument in question gets modified.

>>          b)   Passing an argument of wrong type, particularly a type of
>>                  different physical type.  For example, passing an integer
>>                  when the called subprogram expects a double precision
>>                  or a string.
> These are for core dumps, but the OP was talking about "illegal
> instruction" in particular - SIGILL.

All of those things can cause an illegal instruction, in addition to various
other errors.  It's a symptom of "running out of program and attempting to
execute your data".

Of course, you can also get an illegal instruction in other ways, such as
using the wrong target mode when compiling.

--
Dave Seaman
Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling.
<http://www.commoncouragepress.com/index.cfm?action=book&bookid=228>



Sat, 28 Oct 2006 23:44:23 GMT  
 Illegal instruction (core dumped)

(snip regarding "Illegal instruction (core dumped)")

Quote:
> It means that a machine-level instruction mnemonic was issued
> that didn't correspond to any machine-level mnemonic known to
> the current processor.  One way this could happen is that code
> was compiled for a different processor than it was actually
> run on, but most frequently some instructions would be placed
> in the executable prolog that would result in a more user-
> friendly diagnostic in this case.
> More commonly an instruction was issued to the processor that
> wasn't part of the compiled code either by:
> 1) overwriting the compiled code by writing to an invalid array
>    index (although in many environments this would be trapped
>    and you would get a segmentation fault or a bus error rather
>    than surviving to issue an invalid instruction)

While this is possible on many machines, I don't believe that
I have ever known it to actually cause this problem.

Quote:
> 2) jumping to an unanticipated address by either
> 2a) associating a data actual argument with a procedure dummy
>     argument or

This one I used to know as very common for beginning Fortran
programmers.  It is somehow not obvious that arrays need to be
DIMENSIONed in both main and called subroutines.  The effect of
forgetting the DIMENSION in a subroutine is that the compiler
assumes is is being passed a function address, and that array
references are actually function references.  If no assignments
to such an array exist, the program can easily compile without
any compile time errors.

Quote:
> 2b) messing up the stack (kind of requires a compiler that
>     has a callee cleans up the stack calling convention, in
>     which case invoking a procedure with the wrong number of
>     arguments or the wrong number of character arguments
>     could do the trick.)

Another reason I don't like the callee clean up convention.

(snip)

-- glen



Sun, 29 Oct 2006 01:34:42 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. _tkinter makes core dump (Re: python links with Tk in OS/2 - but core dumps)

2. To dump core or not to dump core

3. core or core dump file ?

4. Illegal Instruction Workaround

5. clipper & nt illegal instruction

6. Windows NT 3.5 Illegal Instruction

7. Any illegal instruction processing interrupts?

8. Illegal instructions

9. Why does this give illegal instruction?

10. drand : illegal instruction ???

11. Illegal Instruction on Mac OS X Intel

12. Illegal Instruction in Tcl_Eval()

 

 
Powered by phpBB® Forum Software