-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic unwinding fails on macOS targets when using the Xcode 15 beta #113783
Comments
I'm seeing the same issue with Xcode 15 beta 4. (I think the OP meant to say 'Xcode 15' in the first line, not Xcode 14). Reverting the version of the Xcode Command Line Tools via Xcode/Settings/Locations to the Xcode 14 toolchain fixes the problem for me. I remember reading somewhere that Xcode 15 has some breaking changes to clang that affect Rust. |
In the first line I mention that reverting to Xcode 14 is a fix - I'll rewrite it to make it more clear |
For anyone stumbling upon this, to revert to Xcode 14:
|
Additionally, https://www.xcodes.app is a great app for managing multiple versions of Xcode! |
I encountered this issue when using
|
No idea what the deal here is (and it will be a couple weeks until I can debug this), but this will be a significant problem when XCode 15 releases1, since it will mean a tier-1 platform doesn't have a working panic=unwind runtime. Note that the actual MVCE is just Footnotes
|
assert_eq
failes when using Xcode 15 beta 4 on macOS 14 beta
I don't really have the time to look into this now in depth but I took a peek. Error code 3 is |
This fails due to |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-critical +E-needs-bisection |
@rustbot ping macos any chance to bisect the mcve mentioned in this comment? |
Hey MacOS Group! This issue or PR could use some MacOS-specific guidance. Could one |
@apiraino I don't think this is something that needs a bisection because I don't think it is a regression in rustc. It's a regression in Xcode 15. |
I suspect it's because of the new linker. Any luck with |
if this an issue with Xcode, are you therefore implying that Apple will fix that? I could not find evidence of that yet (though I didn't search deeply). My thinking was if we should investigate if this is connected to the unwind library ~recently introduced in rustc and find a quick solution before the next Xcode release1. Footnotes
|
Yes, |
I'm not sure what the options are. This isn't due to a change in the rustc side since at least 1.54 (about two years ago). From what I can tell, this was introduced in Xcode 15 beta 3 (beta 2 seems to work). Strangely, the full Xcode beta 3 seems to have been removed from the downloads page, so I could only test the command-line tools for that release, but the full beta 4 also fails. It may be possible we could make a change to work around the issue, but I don't know. |
Just a heads up, Xcode 15 beta 5 was just released and the issue is still present |
Worth noting that with ld-classic (which seems to be their pre-rewrite version of the linker), this issue is not present. E.g. |
Good news! This seems to have been fixed in Xcode 15 beta 6 |
Yep! It seems that poking the developer sometimes works! Going to close this for now since it seems completely resolved. Hopefully that's not premature. |
This continues to be a problem with the non-beta release of Xcode15 I can work around it using this in my
|
I just checked and I can't reproduce on the non-beta Xcode 15. If you can give me steps to reproduce I can bug someone about it. |
@thomcc I believe trying to build this crate https://github.com/MaterializeInc/materialize/tree/main/src/sqllogictest with |
I, uh, don't suppose you've seen it in anything less massive, have you? |
I also can't reproduce. Or don't know if I can. Certainly |
@thomcc Ill try to find time to reduce it! for now using |
Even non-reduced I can't reproduce the issue you're describing. |
@thomcc I can't anymore either...this was fairly consistent last week; if I hit it again ill try to collect more info... |
Is it possible you had some artifacts still built with the older SDK? |
@thomcc I fairly regularly clean my |
This (well, a related issue that produces the same error) does seem to happen on some projects. It's fixed in the XCode 15.1 beta though. (Also, FYI, |
I was having some issues with panics not showing backtraces, and instead showing the following: ``` libunwind: stepWithCompactEncoding - invalid compact unwind encoding ``` This seems to be from the latest mac update using a new linker. See rust-lang/rust#113783 As an aside, I think might have an errant panic somewhere that's not getting bubbled up properly.
Platform:
I tried this code:
I expected to see this happen:
Both
println!
statements should be printedInstead, this happened:
The first part of the code completed correctly, but the
assert_eq
does not:A quick exploration with a debugger showed that the runtime was aborted from std/paniking.rs:
So the call to
__rust_start_panic
failed to unwindConclusion
My guess is that something have changed in libSystem that breaks stack unwinding. But is'a strange that it only happens for the
assert_eq/assert_ne
macros, butpanic/assert
works as expectedFix
Installing Xcode 14 and setting it as the active toolchain using
xcode-select
mitigates the problem.Xcode 14 won't open on macOS 15, but the command line tools works perfectly
Meta
Tested on both stable (1.71) and nightly (2023-07-16)
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: