-
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
Add a global lock to FatalErrorHandler
to avoid re-entry
#122144
Conversation
I am not sure this actually fixes the problem. I can't provoke any crashes with a debug build of the |
It is my understanding based on the diagnostics we have so far that it is not actually FatalErrorHandler that is responsible, yes, thus locking it is pointless, it merely "looks sus". |
@DianQK Consider the change I made in #122061 The reason I did this is that we hit a cascade of LLVM ERROR but cannot fully distinguish "LLVM is emitting this error" vs. "our fatal error handler emits the error". There is another "fatal error" that LLVM emits that is only called from the destructor of Honestly, I suspect we simply aren't handling errors properly at all, based on this SO: https://stackoverflow.com/questions/59911752/are-llvm-fatal-errors-really-fatal |
In fact, when debugging locally, I can reproduce using a @workingjubilee Actually it can still be reproduced when I comment out The interesting thing is that after turning on sanitizer, I can get the following log:
But I'm not sure if it's relevant yet. (I am not sure yet why integrating sanitizer into rustc fails to build, that should be some issue with my development environment.) @rustbot author |
@DianQK any updates on this? thanks |
Ah, I have other unfinished PRs, and this current PR is at the bottom of my priority list to complete. :) |
Fixes #122089. Multiple threads calling
LLVMRustWriteOutputFile
may lead to repeated callFatalErrorHandler
after encountering errors.r? saethlin