[Bug libbacktrace/96973] New: No backtrace for cc1 on x86_64-apple-darwin

fxcoudert at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 8 10:48:12 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96973

            Bug ID: 96973
           Summary: No backtrace for cc1 on x86_64-apple-darwin
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libbacktrace
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
                CC: ian at gcc dot gnu.org
  Target Milestone: ---

On x86_64-apple-darwin, internal errors in the compiler are not displaying
backtraces. 

For example this code:

$ cat ../../z1.f90 
program p
   type ta
      integer :: a
   end type
   type t
      type(ta), pointer :: b
   end type
   type(t) :: z
   data z / t(ta(1)) /
end

is giving me:

$ ./f951 ../../z1.f90
 p main
Analyzing compilation unit
f951: internal compiler error: in record_reference, at cgraphbuild.c:64
libbacktrace could not find executable to open


The message about not finding an executable is from fileline.c in
fileline_initialize(). There, it's trying to find the executable in several
steps.

- state->filename is NULL
- getexecname() is not available on darwin
- the /proc filesystem is not either
- the BSD-specific function sysctl_exec_name() is not present either

I am wondering how this is supposed to work. Probably state->filename should be
set in the first place.


More information about the Gcc-bugs mailing list