backtrace-rs icon indicating copy to clipboard operation
backtrace-rs copied to clipboard

macOS 15 fails line-tables-only because of change in C debuginfo

Open workingjubilee opened this issue 3 months ago • 9 comments

~~cc @madsmtm If you recognize this off the top of your head: https://github.com/rust-lang/backtrace-rs/actions/runs/17957211691/job/51071470672~~

A regression has been surfaced by a recent change in the runner images from macOS 14 to macOS 15. The effect of the regression is that when we compile some C code using -g1, which typically adds debuginfo, using an automatically-determined C toolchain by the logic in the cc crate, we no longer have frames for the C code in our backtrace.

The root of the regression might be in backtrace-rs, it might be in cc-rs, and it might be in the Xcode toolchain packaged by https://github.com/actions/runner-images. This might be because of an Apple-specific change, or it might be because of a change in upstream Clang. Currently nothing has been eliminated from consideration.

workingjubilee avatar Sep 23 '25 19:09 workingjubilee

Likely https://github.com/actions/runner-images/issues/12520, try using macos-14?

Unsure why the bug happens, but that should unblock your CI in the meantime.

madsmtm avatar Sep 25 '25 10:09 madsmtm

That's weird.

workingjubilee avatar Sep 25 '25 16:09 workingjubilee

The trace is failing when it enters C code. It may be a change in available debuginfo for C libraries...?

workingjubilee avatar Sep 25 '25 16:09 workingjubilee

That doesn't make sense, we build it ourselves and set -g1?

workingjubilee avatar Sep 25 '25 16:09 workingjubilee

I have updated the issue with the current summary of the situation.

workingjubilee avatar Sep 25 '25 20:09 workingjubilee

Hmm. Apparently "weird issues we can't pin down but Xcode maybe?" is a recurring problem: https://github.com/rust-lang/backtrace-rs/issues/327

workingjubilee avatar Sep 25 '25 21:09 workingjubilee

GitHub's runner images package macOS 14 with Xcode 16.2, but macOS 15 is packaged with Xcode 16.4, giving us these two release note sets to scan through:

  • https://developer.apple.com/documentation/xcode-release-notes/xcode-16_3-release-notes
  • https://developer.apple.com/documentation/xcode-release-notes/xcode-16_4-release-notes

But this contains absolutely no information I can identify as useful, here.

workingjubilee avatar Sep 26 '25 01:09 workingjubilee

I have identified the cause as a subtle change in how appleclang responds to different sequences of debuginfo (-g) commands. This may be because of upstream clang or it may be particular to appleclang. I need to more closely compare the command lines used by cc-rs.

workingjubilee avatar Sep 26 '25 19:09 workingjubilee

Might be of relevance: I don't think cc-rs actually passes -g on macOS, it passes -gdwarf-2.

(Which might be wrong, idk.?)

madsmtm avatar Sep 26 '25 19:09 madsmtm