ICE seg fault

Florian Ladstaedter flad@gmx.at
Tue Jul 31 08:22:00 GMT 2007


> At least gdb and valgrind agree on the problem. The problem must be
> somehow related to expressions which are regarded as functions
> (EXPR_FUNCTION), not necessarily statement functions, and seemingly the
> e->symtree == NULL.
> 
> A backtrace (i.e. running in gdb and entering after the segfault "bt")
> would help too.
> 
> You could also try to find out more about the expression. In gdb after
> the segfault do:
> 
> p e->symtree
> p e->where
> p e->where->lb->file->filename
> p e->where->lb->file->line
> 


I could reduce the test case quite a lot:

------------------------------------------------



module AtmoIonoSphere

use AtmoIono
use EGOPS_Utilities, ONLY:  dirname


end module AtmoIonoSphere
------------------------------------------------

...but the behaviour now is not very consistent: When I try to 
explicitly state the function imported by the second "use" statement, 
the seg.fault vanishes... (and similar inconsistent behaviours) I post 
the gdb output for the stated test case, maybe you can read more out of it:



------------------------------------------------
(gdb) b check_specification_function
Breakpoint 1 at 0x8064560: file ../../gcc/gcc/fortran/expr.c, line 696.
(gdb) run
Starting program: /usr/local/libexec/gcc/i686-pc-linux-gnu/4.3.0/f951 
AtmoIonoSphere_red.f90 -quiet -dumpbase AtmoIonoSphere_red.f90 
-mtune=generic -auxbase AtmoIonoSphere_red -J../include 
-fintrinsic-modules-path 
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/finclude -o /tmp/ccrhSA4h.s

Breakpoint 1, check_specification_function (e=0x891c450) at 
../../gcc/gcc/fortran/expr.c:696
696       sym = e->symtree->n.sym;
(gdb) p e->symtree
$1 = (gfc_symtree *) 0x0
(gdb)  p e->where
$2 = {nextc = 0x888df93 "", lb = 0x888df60}
(gdb) p e->where->lb->file->filename
$3 = 0x88951d0 "AtmoIonoSphere_red.f90"
(gdb) p e->where->lb->file->line
$4 = 11
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x08064563 in check_specification_function (e=<value optimized out>) at 
../../gcc/gcc/fortran/expr.c:696
696       sym = e->symtree->n.sym;
(gdb) bt
#0  0x08064563 in check_specification_function (e=<value optimized out>) 
at ../../gcc/gcc/fortran/expr.c:696
#1  0x0806549d in gfc_is_constant_expr (e=0x891c450) at 
../../gcc/gcc/fortran/expr.c:740
#2  0x080a2cca in resolve_symbol (sym=0x891c310) at 
../../gcc/gcc/fortran/resolve.c:6717
#3  0x080ad13d in traverse_ns (st=0x8a40810, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2875
#4  0x080ad123 in traverse_ns (st=0x893f4e0, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2878
#5  0x080ad123 in traverse_ns (st=0x893fc60, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2878
#6  0x080ad123 in traverse_ns (st=0x89403e0, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2878
#7  0x080ad123 in traverse_ns (st=0x8940a20, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2878
#8  0x080ad123 in traverse_ns (st=0x8940f20, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2878
#9  0x080ad123 in traverse_ns (st=0x89484a0, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2878
#10 0x080ad123 in traverse_ns (st=0x8974f60, func=0x80a1c20 
<resolve_symbol>) at ../../gcc/gcc/fortran/symbol.c:2878
#11 0x0809e186 in resolve_types (ns=0x88b0a10) at 
../../gcc/gcc/fortran/resolve.c:8456
#12 0x080a1bfc in gfc_resolve (ns=0x88b0a10) at 
../../gcc/gcc/fortran/resolve.c:8535
#13 0x08094040 in gfc_parse_file () at ../../gcc/gcc/fortran/parse.c:3288
#14 0x080b96cd in gfc_be_parse_file (set_yydebug=0) at 
../../gcc/gcc/fortran/f95-lang.c:301
#15 0x0832dc18 in toplev_main (argc=13, argv=0xbfe17b44) at 
../../gcc/gcc/toplev.c:1043
#16 0x0810069f in main (argc=145227602, argv=0x88c63a6) at 
../../gcc/gcc/main.c:35
(gdb) p e->symtree
Cannot access memory at address 0x28
------------------------------------------------



More information about the Fortran mailing list