I'm using the intel fortran compiler (ifort
) in an mpi environment. It turns out that my code has a buffer overflow as I compiled with the flags -g -O2 -check bounds
. After running a while, I get this message:
forrtl: severe (408): fort: (2): Subscript #1 of the array XX has value 4 which is greater than the upper bound of 3
Image PC Routine Line Source
program.exe 00000000006E757E Unknown Unknown Unknown
program.exe 00000000006E6016 Unknown Unknown Unknown
program.exe 00000000006905B2 Unknown Unknown Unknown
program.exe 0000000000642E6B Unknown Unknown Unknown
program.exe 0000000000643381 Unknown Unknown Unknown
program.exe 00000000005F33FB Unknown Unknown Unknown
program.exe 00000000004139E7 Unknown Unknown Unknown
program.exe 000000000040A6B4 Unknown Unknown Unknown
program.exe 0000000000409D2C Unknown Unknown Unknown
libc.so.6 000000380D61ECDD Unknown Unknown Unknown
program.exe 0000000000409C29 Unknown Unknown Unknown
This is great -- I now know that I'm overrunning XX
, but where? using gfortran
, -fbounds-check
would give me a file and line number. Is there any way that I can get that with ifort
?
A -traceback
flag may be used with Intel and Portland Group Fortran compilers to request additional information to be generated in object files for line and source traceback. When a severe error occurs during run time, the program will attempt to report line number and source file where the error occured, as well as line numbers and source files from parent procedures where the calls were made.
Equivalent flag for gfortran is -fbacktrace
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With