https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96973
--- Comment #2 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> --- I've gone a bit further with this, using the patch in comment #1 to fix the executable path issue. I am now trying to make the backtrace work within libgfortran, on a case with a known runtime error: $ cat a.f90 integer, allocatable :: i(:) allocate(i(10)) print *, i(20) end $ ./bin/gfortran a.f90 -fbounds-check -g && ./a.out At line 3 of file a.f90 Fortran runtime error: Index '20' of dimension 1 of array 'i' above upper bound of 10 Error termination. Backtrace: Could not print backtrace: executable file is not in Mach-O format Why is it complaining? Looking at the code in macho_add(), it's being called a number of times: filename = /private/tmp/irun/./a.out header.magic = 0xfeedfacf filename = /private/tmp/irun/./a.out.dSYM/Contents/Resources/DWARF/a.out header.magic = 0xfeedfacf filename = /tmp/irun/lib/libgfortran.5.dylib header.magic = 0xfeedfacf filename = /usr/lib/libSystem.B.dylib header.magic = 0xbebafeca filename = /usr/lib/libSystem.B.dylib header.magic = 0x00000000 It makes sense that it's called twice on libSystem.B.dylib, which is a fat i386 + x86_64 library on darwin19. The first time it correctly sees a fat magic, but the second time it finds it nul…