application crash if compiled with -fopenmp
Asher Langton
langton2@llnl.gov
Tue Jan 8 21:17:00 GMT 2008
On Jan 8, 2008, at 11:30 AM, Daniel Franke wrote:
> 2008/1/8, Daniel Franke <franke.daniel@gmail.com>:
>> Somewhat strange problem: I have a large source file (1.2MB, 32kloc)
>> that compiles (and works) fine. Compiling the same source, that does
>> not yet contain any OMP statements, with -fopenmp, it crashes
>> immediately on runtime.
>
> Some digging showed that this can be easily reproduced:
>
> $> cat sigsegv.f90
> real(8), dimension(10000000) :: largearray
> largearray = 1.0_8
> end
>
> $> gfortran-svn -g -Wall -fdump-tree-original sigsegv.f90 && ./a.out
> [ok]
>
> $> gfortran-svn -g -Wall -fopenmp -fdump-tree-original sigsegv.f90
> && /a.out
> Segmentation fault
>
> The difference:
> $> diff -u sigsegv.f90.003t.original sigsegv.f90.003t.original.openmp
> --- sigsegv.f90.003t.original 2008-01-08 18:26:15.000000000 +0100
> +++ sigsegv.f90.003t.original.openmp 2008-01-08
> 18:25:27.000000000 +0100
> @@ -1,6 +1,6 @@
> MAIN__ ()
> {
> - static real(kind=8) largearray[10000000];
> + real(kind=8) largearray[10000000];
> static integer(kind=4) options.0[7] = {68, 127, 0, 0, 0, 1, 0};
Hi Daniel,
Try adjusting the stack size (limit or ulimit; you might also want to
set GOMP_STACKSIZE). With -fopenmp, arrays are now placed on the stack:
http://gcc.gnu.org/ml/fortran/2007-08/msg00442.html
-Asher
More information about the Fortran
mailing list