Retrieving some context from Fortran runtime errors
Dennis Wassel
dennis.wassel@googlemail.com
Fri Sep 12 17:01:00 GMT 2008
2008/9/12 Alberto Luaces <aluaces@udc.es>:
> Hello,
>
> I have a C++ program that uses a library written in Fortran. Currently the
> program stops with this message:
>
> Fortran runtime error: Attempt to DEALLOCATE unallocated memory.
>
> However, as it doesn't segfaults nor dumps core, I cannot find which
> DEALLOCATE is the culprit. How could I find it?
>
> gfortran gcc version 4.3.1 (Debian 4.3.1-9)
>
> Thanks,
>
> Alberto
>
This solution worked for me; it requires you to have the Fortran
library available as source, though.
Compile (at least) the library with -g, then run the executable in gdb
and set a breakpoint at '_gfortran_runtime_error'. gdb will stop at
the "Fortran runtime error" somewhere inside libgfortran, but you can
backtrace your way into your code from there to find the offending
DEALLOCATE.
Cheers,
Dennis
More information about the Fortran
mailing list