简体   繁体   English

fortran编译执行中不需要的回溯信息

[英]Non-desired backtrace info in fortran-compiled execution

I'm developing a fortran code (standard 2003) in which I have to control all non-nominal exits. 我正在开发一个fortran代码(标准2003),在该代码中我必须控制所有非名义出口。

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! 非常感谢!

您可以将-fno-backtrace用于GCC版本,其中-fbacktrace是默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM