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.

Reply via email to