Opened 10 years ago

Last modified 8 years ago

#47049 assigned request

gfortran backtrace issue

Reported by: basmac Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: larryv (Lawrence Velázquez), petrrr
Port: gcc49

Description (last modified by larryv (Lawrence Velázquez))

We have gdb to work and have set the com.apple.taskgated.plist to add the -p as specified in the macports install of gdb. We are 10.10.2 and latest as of March 5 with macports and fortran 4.9.2.

Just concerned that Linux fortran gives the extra lin information and macports version does not. Here is the user description of a small test program, that displays this issue. He has a much larger program he wants the line numbers displayed if at all possible on the macports fortran.

Compare this with the Linux backtrace lower down.

The key difference for this very short demo program is that the Linux backtrace shows the source label, source file name, and source line number in the backtrace. "MAIN__ at btest.f90:12". This is the symbol information from a non-stripped object file, a.out in this case.

The backtrace on Mac is missing all of this.

I am not concerned about the first three lines in the Linux call stack. These are probably low-level calls within a stripped runtime library.

This is not a new problem. Backtrace symbols were missing in the last several versions of gfortran, Mac OS, and Xcode on PSD Macs.

mac56:/home/dallured/btest 7> gfortran --version | grep gcc
GNU Fortran (MacPorts gcc49 4.9.2_1) 4.9.2

mac56:/home/dallured/btest 8> gfortran -g -ffpe-trap=zero btest.f90

mac56:/home/dallured/btest 9> ./a.out 
 Start program.
 Divide by zero.

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x10b15bfbc
#1  0x10b15c4df
#2  0x7fff94646f19
#3  0x10b155cb7
#4  0x10b155e4e
Floating exception

==================================================

linux64:~/btest 1025> /usr/locale/bin/gfortran --version | grep GCC
GNU Fortran (GCC) 4.9.2

linux64:~/btest 1026> /usr/locale/bin/gfortran -g -ffpe-trap=zero btest.f90

linux64:~/btest 1027> ./a.out
 Start program.
 Divide by zero.

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x7F225DDA8347
#1  0x7F225DDA894E
#2  0x3585A3269F
#3  0x400978 in MAIN__ at btest.f90:12
Floating exception (core dumped)

Attachments (1)

btest.f90 (300 bytes) - added by basmac 10 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 10 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added
Description: modified (diff)
Keywords: gfortran backtrace removed
Owner: changed from macports-tickets@… to mww@…
Port: gcc49 added; gfortran removed

Could you attach the btest.f90 file?

Changed 10 years ago by basmac

Attachment: btest.f90 added

comment:2 Changed 10 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:3 Changed 8 years ago by kurthindenburg (Kurt Hindenburg)

Owner: changed from mww@… to macports-tickets@…
Status: newassigned
Note: See TracTickets for help on using tickets.