[MacPorts] #47049: gfortran backtrace issue

MacPorts noreply at macports.org
Thu Mar 5 14:06:58 PST 2015


#47049: gfortran backtrace issue
--------------------------------+-------------------
  Reporter:  barry.j.mcinnes@…  |      Owner:  mww@…
      Type:  request            |     Status:  new
  Priority:  Normal             |  Milestone:
 Component:  ports              |    Version:  2.3.3
Resolution:                     |   Keywords:
      Port:  gcc49              |
--------------------------------+-------------------
Changes (by larryv@…):

 * cc: larryv@… (added)
 * keywords:  gfortran backtrace =>
 * owner:  macports-tickets@… => mww@…
 * port:  gfortran => gcc49


Old description:

> 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)

New description:

 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)
 }}}

--

Comment:

 Could you attach the `btest.f90` file?

-- 
Ticket URL: <https://trac.macports.org/ticket/47049#comment:1>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list