I'm developing a fortran code (standard 2003) in which I have to control all non-nominal exits.
When executing the code without arguments (it requires a number of args) I received the expected exit code + some non-asked backtrace info, as you may see below:
./test_1
Error | Wrong number of inputs in test_1
STOP 128
Backtrace for this error:
#0 0x0000003b9b0ac584 in wait () from /lib64/libc.so.6
#1 0x00007ff41d8ff00d in ?? () from /usr//lib64/libgfortran.so.3
#2 0x00007ff41d90082e in ?? () from /usr//lib64/libgfortran.so.3
#3 0x00007ff41d90112f in _gfortran_stop_numeric () from usr//lib64/libgfortran.so.3
#4 0x000000000041f7d4 in _gfortran_stop_numeric_f08 ()
#5 0x000000000041b680 in MAIN__ ()
#6 0x000000000041f74d in main ()
The weird thing is that I don't have any flag in my compilation with optimization (I think) to invoke the backtracking.
gfortran -Wall -Wextra -Wuninitialized -Wno-maybe-uninitialized -O2 -finit-local-zero -I/opt/cots/netcdf_4.2_gfortran/include -L/usr//lib64 -Wl,-rpath,/usr//lib64 -L/opt/cots/netcdf_4.2_gfortran/lib -Wl,-rpath,/opt/cots/netcdf_4.2_gfortran/lib -o test_1 test_1.o -lnetcdff -lnetcdf -lz -lm
I have it though in the debug mode. But I'm using the optimized executable...
Anyone knows how I can get rid of the backtrace info?
I'm assuming it's nothing related to the code since it appears after the stop order.
Thanks a lot!
You can use -fno-backtrace
for GCC versions where -fbacktrace
is the default.