Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ifort 9.0 segmentation fault

oli
Beginner
732 Views
Hi all!

I use...

Intel Fortran Compiler for 32-bit applications, Version 9.0 Build 20051201Z Package ID: l_fc_c_9.0.031
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

...on a linux machine running RedHatEL4...

Linux lpaspc76 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686 i686 i386 GNU/Linux

...and try to compile the following code...

program test
implicit none
real, pointer :: p(:,:)
nullify(p)
call gugus(p)
end program test
subroutine gugus(h)
implicit none
real, pointer :: h(:,:)
if (associated(h)) deallocate(h)
end subroutine gugus


...using the ifort compiler with the following options...

ifort -C -g -debug extended -traceback -o test3 test3.f90

...and get a segmentation fault upon execution...

> ./test3
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
test3 08049E88 gugus_ 7 test3.f90
test3 08049DB1 MAIN__ 5 test3.f90
test3 08049BC5 Unknown Unknown Unknown
libc.so.6 00347E23 Unknown Unknown Unknown
test3 08049B01 Unknown Unknown Unknown

...while this compiles fine on Sun and pgf90 compilers and up to my knowledge should work.

Can you help?

Oliver Fuhrer
0 Kudos
4 Replies
Ron_Green
Moderator
732 Views

Oliver,

ulimit -s unlimited

also see http://softwareforums.intel.com/en-us/forums//topic/43795

ron

0 Kudos
oli
Beginner
732 Views
Dear Ron,

It doesn't seem to do the trick! Also, since the variable passed is simply a nullified pointer, it should not require any stackspace. Any more ideas?

oli

[fuhrer@lpaspc76 ~]$ ifort -o test test.f90

[fuhrer@lpaspc76 ~]$ ./test
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
test 08049E55 Unknown Unknown Unknown
test 08049BC5 Unknown Unknown Unknown
libc.so.6 00347E23 Unknown Unknown Unknown
test 08049B01 Unknown Unknown Unknown

[fuhrer@lpaspc76 ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 32744
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

[fuhrer@lpaspc76 ~]$ ulimit -s unlimited
[fuhrer@lpaspc76 ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 32744
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

[fuhrer@lpaspc76 ~]$ ./test
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
test 08049E55 Unknown Unknown Unknown
test 08049BC5 Unknown Unknown Unknown
libc.so.6 00347E23 Unknown Unknown Unknown
test 08049B01 Unknown Unknown Unknown

[fuhrer@lpaspc76 ~]$
0 Kudos
tobias-burnus
Beginner
732 Views
Hi Oliver,
program test
implicit none
real, pointer :: p(:,:)
nullify(p)
call gugus(p)
end program test
subroutine gugus(h)
implicit none
real, pointer :: h(:,:)
if (associated(h)) deallocate(h)
end subroutine gugus
As the NAG compiler nicely points out:
Explicit interface required for GUGUS from TEST - argument H (no. 1) is a POINTER
If you change the code to
program test
...
contains
subroutine gugus(h)
...
end subroutine gugus
end program test
it works. Alternatively you can put gugus into a module, which you include via "use". (Or [ugly style] you add an interface block to program test.)

The reason is that you may not use the dimension(:) syntax (assumed-shape arrays) for dummy elements without providing an explicit interface as the compiler needs to know that is has to pass extra information.

The compiler knows this when you use ifort -gen_interfaces, which you could use a ugly work around. (Unfortunally, ifort does not warn in such cases.)

Tobias
0 Kudos
Steven_L_Intel1
Employee
732 Views
Tobias-Burnus:
The compiler knows this when you use ifort -gen_interfaces, which you could use a ugly work around. (Unfortunally, ifort does not warn in such cases.)


That's a bug in the process of being fixed. Don't rely on that behavior.
0 Kudos
Reply