This is the mail archive of the
mailing list for the GNU Fortran project.
Re: gfortran47, pgf90 work - ifort segfaults
- From: Tobias Burnus <burnus at net-b dot de>
- To: Anton Shterenlikht <mexas at bristol dot ac dot uk>
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 10 Feb 2012 11:40:55 +0100
- Subject: Re: gfortran47, pgf90 work - ifort segfaults
- References: <20120210100840.GA26093@mech-cluster241.men.bris.ac.uk>
On 02/10/2012 11:08 AM, Anton Shterenlikht wrote:
Intel: 12.0.2 20110112
The code below segfaults only when compiled with Intel compiler.
The code looks valid - and using ifort 11.1, 12.0.3 and 12.1.1, it does
not crash for me; thus, it could be fixed in later 12.0.x versions or
might have different reasons.
On issue which can lead to segfaults is a too small stack. And in
particular the Intel compiler uses a lot of stack space by default.
Stack memory is fast - faster than memory allocated on the heap. But the
down side is: By default the available stack size is rather limited.
Thus, one easily runs into stack issues. Having large arrays can require
a lot of stack size - exceeding the available space leads to segfaults.
If ifort places "space1" on the stack, you need 31.5 MB stack space.
That's not very much but might be still too much. Could you check what
"ulimit -s" (POSIX shell, bash) or "limit stack" (csh, tcsh) prints?
I know it's something to do with stream output
and array indexing. If I modify the write
line to either of these:
there is no segfault with intel.
However, these do segfault with intel:
Is there anything in stream output that
can lead to such behaviour?
Seems as if there is an issue with strides. It might be that ifort
creates a temporay array for that (which would lead to more stack usage,
cf. above). Of that it passes the array as is but has another bug.