Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
30 Views

no traceback with -static-libgcc ?

Please consider this trivial code snippet, which does nothing else but generate a backtrace:

program tb

   use ifcore

   call TRACEBACKQQ

end

 

Compiling this with ifort 18 using the -traceback flag yields the expected result:

$ ./a.out
Image              PC                Routine            Line        Source             
a.out              0000000000404391  Unknown               Unknown  Unknown
a.out              0000000000400AA4  MAIN__                      5  backtrace.f90
a.out              0000000000400A4E  Unknown               Unknown  Unknown
a.out              000000000048B636  Unknown               Unknown  Unknown
a.out              000000000048B82A  Unknown               Unknown  Unknown
a.out              0000000000400929  Unknown               Unknown  Unknown

 

However, when adding the -static-libgcc flag on a Linux system, the backtrace completely disappears and the program does not produce any output. I observed this not only for an explicit call to TRACEBACKQQ, but also for runtime errors, which usually give a backtrace as well (but not with -static-libgcc). Interestingly a fully statically linked executable (using the -static flag) gives backtraces without any problem.

Is it somehow expected that -static-libgcc kills my backtraces, or can this be considered an ifort bug? The documentation does not seem to mention anything in this direction:

https://software.intel.com/en-us/fortran-compiler-18.0-developer-guide-and-reference-static-libgcc

https://software.intel.com/en-us/fortran-compiler-18.0-developer-guide-and-reference-tracebackqq

Cheers,

Janus

0 Kudos
3 Replies
Highlighted
New Contributor I
30 Views

No answer for more than a week. Obviously a bug. I opened a support request.

Cheers,

Janus

0 Kudos
Highlighted
Valued Contributor I
30 Views

I could confirm this behaviour.  

0 Kudos
Highlighted
New Contributor I
30 Views

Thanks for the confirmation, Juergen. In fact I see no good reason why -static-libgcc should prevent ifort from throwing a stack trace.

Incidentally GCC/gfortran has the same -static-libgcc flag, and there it doesn't affect the stack traces in any way. The test case is slightly different:

program tb_gfortran

   call BACKTRACE

end

But compiling this with "gfortran -static-libgcc -static-libgfortran -g" gives me a beautiful backtrace, just as it does without the -static-... flags.

Cheers,

Janus

0 Kudos