How to debug "Access not within mapped region" runtime error
Jerry DeLisle
jvdelisle@verizon.net
Tue Aug 14 00:20:00 GMT 2007
Florian wrote:
>
> I have a piece of code causing runtime troubles with gfortran (compiling
> problems are solved thanks to your quick patchings). It works with NAG,
> lahey, and intel fortran compiler, so I guess the troubles are related
> with gfortran, that's why I would ask for advice here how to debug the
> situation.
>
> So far I didn't succeed to produce a compact test case, so I rather try
> to explain the behavior:
>
> -------
> gfortran --version
> GNU Fortran (GCC) 4.3.0 20070808 (experimental)
>
> flags:
> gfortran -mtune=i586 -O0 -m32 -Wall -fbacktrace -g -fstack-check
> -fstack-protector-all -Wstack-protector -Wtabs .....
> -------
Some possible steps:
1. Try it without any flags, see if that makes a difference.
2. With -fbacktrace, did you get a backtrace? If so, show us. If not, compile
with -static and then run with gdb. When it segfaults, at the gdb prompt do
'bt' (with no quotes). This will show roughly where it is going bad.
3. Keep working on a reduced test case, eliminating function by function until
the problem goes away. Its almost impossible to figure out whats wrong without
that.
4. Gfortran does not initialize variables for you. Look for places where that
could get you in trouble.
Good Luck,
Jerry
More information about the Fortran
mailing list