Bug 222371 - internal compiler error: Illegal instruction
internal compiler error: Illegal instruction
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gmp (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
: Reopened
Depends On:
Blocks: 223038
  Show dependency treegraph
 
Reported: 2007-01-11 16:43 EST by Orion Poplawski
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: gmp-4.1.4-11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-26 07:29:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Code (7.21 KB, application/octet-stream)
2007-01-11 16:43 EST, Orion Poplawski
no flags Details
fortran source file, causes internal compiler error (47.75 KB, text/x-fortran)
2007-02-10 13:57 EST, Herbert Carl Meyer
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 30444 None None None Never

  None (edit)
Description Orion Poplawski 2007-01-11 16:43:26 EST
Description of problem:

f95 -fPIC -c sfstubsf95.f90
sfstubs.f90:48: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.

Version-Release number of selected component (if applicable):
gcc-gfortran-4.1.1-53


The code is clearly buggy:

      common /zzplstr1/ string1
      common /zzplstr2/ string2
      common /zzplstr3/ string3
      common /zzplstr4/ string4
      common /zzplstr5/ string5
      common /zzplstr6/ string6
      common /zzplstr6/ string7
      common /zzplstr6/ string8
      common /zzplstr6/ string9

(should be zzplstr7, zzplstr8,...)

but I wouldn't expect f95 to die with an illegal instruction.
Comment 1 Orion Poplawski 2007-01-11 16:43:26 EST
Created attachment 145400 [details]
Code
Comment 2 Orion Poplawski 2007-01-11 17:23:03 EST
Hmm, still happens with:

      common /zzplstr7/ string7
      common /zzplstr8/ string8
      common /zzplstr9/ string9

so maybe it really is a gfortran bug.
Comment 3 Orion Poplawski 2007-01-11 17:50:01 EST
Definitely a regression.  Compiles okay on FC6.
Comment 4 Orion Poplawski 2007-01-11 19:02:00 EST
Well, there's hardly a difference between FC6 and rawhide WRT gcc:

* Tue Jan 09 2007 Jakub Jelinek <jakub@redhat.com> 4.1.1-53
- fix libgomp testsuite driver (Ulrich Weigand)
- combiner fixes (Richard Sandiford, PR rtl-optimization/25514,
  PR rtl-optimization/27736)

* Fri Jan 05 2007 Jakub Jelinek <jakub@redhat.com> 4.1.1-52
- update from gcc-4_1-branch (-r120325:120507)
  - PRs c++/30382, middle-end/27826, middle-end/28116,
        tree-optimization/30212

Perhaps something else is coming into play.
Comment 5 Christophe Merlet 2007-01-14 05:19:56 EST
With gcc-gfortran-4.1.1-51.fc6.i386 on an athlon-xp.

Same bug with polyhedron benchmark

$ LANG=C gfortran ac.f90 -o ac
ac.f90:0: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.

and with fortran 90 code in NetCDF.

gcc-gfortran-4.1.1-51.fc6.x86_64 on an opteron 285 works...
Comment 6 Jakub Jelinek 2007-01-16 05:40:53 EST
Sorry, can't reproduce this.  Tried e.g. the gcc-gfortran-4.1.1-53.i386
f951 binary (on x86_64), works just fine (the same as native x86_64 f951).
Comment 7 Jakub Jelinek 2007-01-16 05:51:58 EST
Closed prematurely.  As I can't reproduce this, need further information.
Are you able to reproduce it (if you run gfortran -53.i386 again on
sfstubsf95.f90 with -fPIC, is it reproduceable in every invocation)?
If yes, can you ulimit -c and get a backtrace where it crashed?
Comment 8 Orion Poplawski 2007-01-16 19:07:58 EST
Completely reproducible here.  No core or trace appears to be generated.  Tried
the following:

# gdb /usr/libexec/gcc/i386-redhat-linux/4.1.1/f951
GNU gdb Red Hat Linux (6.5-26.fc7rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90 -quiet
-dumpbase sfstubsf95.f90 -m32 -march=i386 -mtune=generic -auxbase-strip
bindings/f95/CMakeFiles/plplotf95d.dir/sfstubsf95.o -g -O2 -Wall -version
-fexceptions -fstack-protector -fasynchronous-unwind-tables -fPIC --param
ssp-buffer-size=4 -I/usr/src/redhat/BUILD/plplot-5.7.1/include
-I/usr/src/redhat/BUILD/plplot-5.7.1/fedora
-I/usr/src/redhat/BUILD/plplot-5.7.1/fedora/include
-I/usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95
-I/usr/src/redhat/BUILD/plplot-5.7.1/fedora/bindings/f95 -I
/usr/lib/gcc/i386-redhat-linux/4.1.1/finclude -o -
Starting program: /usr/libexec/gcc/i386-redhat-linux/4.1.1/f951
/usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90 -quiet -dumpbase
sfstubsf95.f90 -m32 -march=i386 -mtune=generic -auxbase-strip
bindings/f95/CMakeFiles/plplotf95d.dir/sfstubsf95.o -g -O2 -Wall -version
-fexceptions -fstack-protector -fasynchronous-unwind-tables -fPIC --param
ssp-buffer-size=4 -I/usr/src/redhat/BUILD/plplot-5.7.1/include
-I/usr/src/redhat/BUILD/plplot-5.7.1/fedora
-I/usr/src/redhat/BUILD/plplot-5.7.1/fedora/include
-I/usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95
-I/usr/src/redhat/BUILD/plplot-5.7.1/fedora/bindings/f95 -I
/usr/lib/gcc/i386-redhat-linux/4.1.1/finclude -o -
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
GNU F95 version 4.1.1 20070105 (Red Hat 4.1.1-53) (i386-redhat-linux)
        compiled by GNU C version 4.1.1 20070105 (Red Hat 4.1.1-53).
GGC heuristics: --param ggc-min-expand=46 --param ggc-min-heapsize=31518
        .file   "sfstubsf95.f90"
        .section        .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
        .section        .debug_info,"",@progbits
.Ldebug_info0:
        .section        .debug_line,"",@progbits
.Ldebug_line0:
        .text
.Ltext0:
 In file sfstubs.f90:530

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshades_multiple_tr(z, defined, &
                                               1
Warning: Unused variable defined declared at (1)
 In file sfstubs.f90:505

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshades_multiple_2(z, defined, &
                                              1
Warning: Unused variable defined declared at (1)
 In file sfstubs.f90:480

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshades_multiple_1(z, defined, &
                                              1
Warning: Unused variable defined declared at (1)
 In file sfstubs.f90:456

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshades_multiple_0(z, defined, &
                                              1
Warning: Unused variable defined declared at (1)
 In file sfstubs.f90:430

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshade_single_tr(z, defined, &
                                            1
Warning: Unused variable defined declared at (1)
 In file sfstubs.f90:401

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshade_single_2(z, defined, &
                                           1
Warning: Unused variable defined declared at (1)
 In file sfstubs.f90:372

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshade_single_1(z, defined, &
                                           1
Warning: Unused variable defined declared at (1)
 In file sfstubs.f90:345

     Included at /usr/src/redhat/BUILD/plplot-5.7.1/bindings/f95/sfstubsf95.f90:104

      subroutine plshade_single_0(z, defined, &
                                           1
Warning: Unused variable defined declared at (1)

Program received signal SIGILL, Illegal instruction.
0x08471799 in free ()
(gdb) bt
#0  0x08471799 in free ()
#1  0x00000000 in ?? ()


That seems odd.
Comment 9 Orion Poplawski 2007-01-17 11:31:49 EST
Okay, with gcc-debuginfo installed, I see:

Program received signal SIGILL, Illegal instruction.
0x08471799 in mpfr_ceil_double ()
(gdb) bt
#0  0x08471799 in mpfr_ceil_double ()
#1  0x08471852 in mpfr_get_str_compute_g ()
#2  0x08471be0 in mpfr_get_str ()
#3  0x0808548f in mio_gmp_real (real=<value optimized out>) at
gcc/fortran/module.c:2372
#4  0x080859fd in mio_expr (ep=<value optimized out>) at gcc/fortran/module.c:2622
#5  0x0808662d in mio_symbol (sym=0xa4e62e8) at gcc/fortran/module.c:2849
#6  0x08086871 in write_symbol (n=255, sym=0xa4e62e8) at gcc/fortran/module.c:3522
#7  0x080869c6 in write_symbol0 (st=<value optimized out>) at
gcc/fortran/module.c:3561
#8  0x0808691e in write_symbol0 (st=0xa485920) at gcc/fortran/module.c:3541
#9  0x08086916 in write_symbol0 (st=0xa486138) at gcc/fortran/module.c:3540
#10 0x0808691e in write_symbol0 (st=0xa4dece0) at gcc/fortran/module.c:3541
#11 0x0808691e in write_symbol0 (st=0xa4d2648) at gcc/fortran/module.c:3541
#12 0x0808691e in write_symbol0 (st=0xa4a4e18) at gcc/fortran/module.c:3541
#13 0x08086916 in write_symbol0 (st=0xa4e63c0) at gcc/fortran/module.c:3540
#14 0x08086916 in write_symbol0 (st=0xa4ceb70) at gcc/fortran/module.c:3540
#15 0x08086916 in write_symbol0 (st=0xa4db408) at gcc/fortran/module.c:3540
#16 0x08086916 in write_symbol0 (st=0xa502150) at gcc/fortran/module.c:3540
#17 0x08086916 in write_symbol0 (st=0xa4a0988) at gcc/fortran/module.c:3540
#18 0x08087851 in gfc_dump_module (name=0xa50028e "plplot", dump_flag=1)
    at gcc/fortran/module.c:3707
#19 0x0808ec65 in gfc_parse_file () at gcc/fortran/parse.c:3185
#20 0x080b2750 in gfc_be_parse_file (set_yydebug=0) at gcc/fortran/f95-lang.c:302
#21 0x0832cf8c in toplev_main (argc=29, argv=0xbfb19214) at gcc/toplev.c:991
#22 0x080e1e52 in main (argc=Cannot access memory at address 0x35
) at gcc/main.c:35
#23 0x470c2e5c in __libc_start_main () from /lib/libc.so.6
#24 0x0804aaa1 in _start ()
Comment 10 Jakub Jelinek 2007-01-17 12:05:04 EST
And you have some oldish CPU that doesn't support SSE2, right?

This seems to be a bug in gmp packaging:

--- gmp.spec~   2007-01-17 11:53:57.000000000 -0500
+++ gmp.spec    2007-01-17 11:53:57.000000000 -0500
@@ -84,11 +84,12 @@ cd ..
 mkdir build-sse2
 cd build-sse2
 ln -s ../configure .
-CFLAGS="-O2 -g -march=pentium4"
-%configure --enable-mpbsd --enable-mpfr --enable-cxx pentium4-redhat-linux
+CFLAGS="%{optflags} -march=pentium4"
+%configure --enable-mpbsd --disable-mpfr --enable-cxx pentium4-redhat-linux
 perl -pi -e
's|hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=\"-L\\\$libdir\"|g;'
libtool
 export LD_LIBRARY_PATH=`pwd`/.libs
 make %{?_smp_mflags}
+unset CFLAGS
 cd ..
 %endif
 cd mpfr-%{mpfr_version}

On i?86 CFLAGS were changed to add -march=pentium4 (in a wrong way, overriding
the default RPM_OPT_FLAGS instead of appending to them) and wasn't reverted
before building libmpfr, so libmpfr.a contains some SSE2 code.

When mpfr is fixed (btw, mpfr should be also updated to 2.2.1 and in rawhide
also split from gmp into a separate package), gcc needs to be rebuilt to fix
this problem.
Comment 11 Tony Radice 2007-01-29 13:19:11 EST
Gents - 
    I have a block of code which has the same error, is reproducable, and does 
NOT exhibit the error on an FC5 install.  The code is from the SCILAB 4.1 
application and is in tree: SCI/resources/metanet/prfmatch.f. Of the 10 
subroutines in the noted file, 9 compile properly with gfortran -c {fn}.f, this 
one (the first) flags the error you have noted above:

c the program is based on the paper  u. derigs "solving non-bipartite 
c matching problems via shortest path techniques" annals of operations
c research 7, 1988.  
c Author :
c ulrich derigs 
c lehrstuhl fur betriebswirtschaftslehre vii, 
c universitat bayreuth, postfach 3008,
c d-8580 bayreuth, germany.            
c ** *****************************************************************
      subroutine prfmatch(n,m,np1,m2,nbl,cc,iindex,cost,nmatch,
     + basis,mem,ka,kb,sm,tma,tmb,y1,y2,dminus,dplus)
c     ***     (min-cost perfect matching problem)              ***
      integer basis(n),mem(n),ka(n),kb(n),sm(n),tma(n),tmb(n)
      integer zfw,cost,nmatch(n),cc(m2),nbl(m2)
      integer iindex(np1)
      double precision  y1(n),y2(n),dminus(n),dplus(n),eps
      eps=10.**(-38)  
      sup=40000000
      cost=400000000
      do 1,i=1,n
         nmatch(i)=0
 1    continue
      call sap(n,m,cc,nbl,iindex,zfw,nmatch,basis,mem,ka,kb,sm,
     +tma,tmb,y1,y2,dplus,dminus,sup,eps)
      cost=zfw
c     zfw       cost of the optimal matching         
c     nmatch(n) optimal matching                     
      return
      end
Comment 12 Herbert Carl Meyer 2007-02-10 13:57:23 EST
Created attachment 147839 [details]
fortran source file, causes internal compiler error
Comment 13 Ivana Varekova 2007-07-26 07:29:28 EDT
Fixed in gmp-4.1.4-11.

Note You need to log in before you can comment on or make changes to this bug.