[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#572756: marked as done (Many programs compiled with gfortran-4.4 -fopenmp segfault)



Your message dated Tue, 9 Mar 2010 14:02:43 +0100
with message-id <20100309130243.GA14740@minet.uni-jena.de>
and subject line Re: Many programs compiled with gfortran-4.4 -fopenmp  segfault
has caused the Debian Bug report #572756,
regarding Many programs compiled with gfortran-4.4 -fopenmp  segfault
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
572756: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572756
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gfortran-4.4
Version: 4.4.3-3
Severity: important
Tags: l10n

I have compiled the following fortran 95 program    
 
program test
  double precision a(10000000)
  a(1)=1
  write(6,*) a(1)
  stop
end

with the command 

gfortran -fopenmp 
and I get the following error message (If I try to execute the program)

stefano@debsim2:~/prova$ ./a.out
Segmentation fault
stefano@debsim2:~/prova$
-----------------------------------------------------------
If I reduce the dimension of the a array, for example

program test1
  double precision a(1000000)
  a(1)=1
  write(6,*) a(1)
  stop
end

and I compile the program with the same flag -fopenmp 
the binary program can be execute

stefano@debsim2:~/prova$ ./a.out
   1.0000000000000000     
stefano@debsim2:~/prova$
----------------------------------------------------
If I use a dynamical allocation (the dimension of a is like the dimension in test)

program test2
  double precision,allocatable :: a(:)
  allocate(a(100000000))
  a(1)=1
  write(6,*) a(1)
  stop
end

the program can be compiled (with -fopenmp) and executed.
----------------------------------------------------------
I have not used the OMP directives in these programs but I observe the same behaviour 
with OMP commands.
The program 

program test_omp
  double precision a(10000000)
!$OMP PARALLEL DEFAULT(PRIVATE)
  a(1)=1
  write(6,*) a(1)
!$OMP END PARALLEL 
  stop
end

segfaults when compiled with the option -fopenmp
while  the program 

program test_omp1
  double precision a(100000)
!$OMP PARALLEL DEFAULT(PRIVATE)
  a(1)=1
  write(6,*) a(1)
!$OMP END PARALLEL 
  stop
end

gives the result
stefano@debsim2:~/prova$ ./a.out
   1.0000000000000000     
   1.0000000000000000     
stefano@debsim2:~/prova$

-------------------------------------------
Analogously the program 

program test_omp2
  double precision,allocatable :: a(:)
!$OMP PARALLEL DEFAULT(PRIVATE)
  allocate(a(100000000))
  a(1)=1
  write(6,*) a(1)
!$OMP END PARALLEL 
  stop
end

runs correctly:

stefano@debsim2:~/prova$ ./a.out
   1.0000000000000000     
   1.0000000000000000     
stefano@debsim2:~/prova$

Thank you



                    


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-rc8-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages gfortran-4.4 depends on:
ii  gcc-4.4                   4.4.3-3        The GNU C compiler
ii  gcc-4.4-base              4.4.3-3        The GNU Compiler Collection (base 
ii  libc6                     2.9-23         GNU C Library: Shared libraries
ii  libc6-dev                 2.9-23         GNU C Library: Development Librari
ii  libgfortran3              4.4.3-3        Runtime library for GNU Fortran ap
ii  libgmp3c2                 2:4.3.2+dfsg-1 Multiprecision arithmetic library
ii  libmpfr1ldbl              2.4.2-3        multiple precision floating-point 

gfortran-4.4 recommends no packages.

Versions of packages gfortran-4.4 suggests:
pn  gfortran-4.4-doc              <none>     (no description available)
pn  gfortran-4.4-multilib         <none>     (no description available)
pn  libgfortran3-dbg              <none>     (no description available)

-- no debconf information



--- End Message ---
--- Begin Message ---
On Sat, Mar 06, 2010 at 01:09:40PM +0100, Stefano Simonucci wrote:
> I have compiled the following fortran 95 program    
>  
> program test
>   double precision a(10000000)
>   a(1)=1
>   write(6,*) a(1)
>   stop
> end
> 
> with the command 
> 
> gfortran -fopenmp 
> and I get the following error message (If I try to execute the program)
> 
> stefano@debsim2:~/prova$ ./a.out
> Segmentation fault

When using OpenMP, the array cannot be allocated statically, but needs
to reside on the stack, and you run into the stack size limit. See
http://gcc.gnu.org/PR43050

You can use "ulimit -s unlimited" to work around this.

  Falk




--- End Message ---

Reply to: