-
Notifications
You must be signed in to change notification settings - Fork 13.3k
LLVM failures cause exit status 1 #54992
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
Comments
Those error functions all call |
There is |
That sounds nice, but if we exit with 101 (or simply panic) in the handler won't we be skipping any other cleanup ( I'm interested in putting a patch together, but I'm unfamiliar with how we link Rust to C++. The error handler needs to be able to consume a |
We shouldn't do anything that looks like exception unwinding. See /// It is dangerous to naively use an error handler which throws an exception.
/// Even though some applications desire to gracefully recover from arbitrary
/// faults, blindly throwing exceptions through unfamiliar code isn't a way to
/// achieve this.
I think we can call it -- it's publicly declared in
We bridge C++ code in |
Exit with code 101 on fatal codegen errors Fixes #54992. This PR installs a custom fatal error handler that prints the error from LLVM and exits with 101. There should be no visible change in the output from LLVM. This allows distinguishing a fatal LLVM error with a compilation error by exit code. This PR also modifies the LLVM codegen backend to ICE instead of emitting a fatal error when encountering a LLVM worker thread panic for the same reason. r? @cuviper
Related to #51971.
If a fatal error occurs in LLVM, the compiler exits with status 1. This is problematic, because if a test is expecting a compilation failure, the test could still pass. It also makes it difficult to test for the presence of ICEs in general.
A simple fix would be to patch our copy of LLVM to exit with 101 (like ICEs) in
report_fatal_error
, but any other ideas would be appreciated.The text was updated successfully, but these errors were encountered: