-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
std: Don't assume thread::current() works on panic #24478
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon |
@@ -18,7 +18,6 @@ use cell::UnsafeCell; | |||
|
|||
// Sure wish we had macro hygiene, no? | |||
#[doc(hidden)] | |||
#[unstable(feature = "thread_local_internals")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these accidentally stripped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module at the top-level has an #[unstable]
attribute which everything inside inherits from by default. (it was intentional)
I've opened #24479 about panicking destructors in TLS aborting the process, which I believe is a separable issue. |
@bors: r+ |
📌 Commit 3d04a33 has been approved by |
⌛ Testing commit 3d04a33 with merge 240ff7b... |
💔 Test failed - auto-win-32-nopt-t |
Don't need so much manual #[doc(hidden)] and #[unstable] as much of it is inherited!
3d04a33
to
ac7ba99
Compare
Inspecting the current thread's info may not always work due to the TLS value having been destroyed (or is actively being destroyed). The code for printing a panic message assumed, however, that it could acquire the thread's name through this method. Instead this commit propagates the `Option` outwards to allow the `std::panicking` module to handle the case where the current thread isn't present. While it solves the immediate issue of rust-lang#24313, there is still another underlying issue of panicking destructors in thread locals will abort the process. Closes rust-lang#24313
ac7ba99
to
d98ab4f
Compare
⌛ Testing commit d98ab4f with merge 2b8c9b1... |
Inspecting the current thread's info may not always work due to the TLS value having been destroyed (or is actively being destroyed). The code for printing a panic message assumed, however, that it could acquire the thread's name through this method. Instead this commit propagates the `Option` outwards to allow the `std::panicking` module to handle the case where the current thread isn't present. While it solves the immediate issue of #24313, there is still another underlying issue of panicking destructors in thread locals will abort the process. Closes #24313
Inspecting the current thread's info may not always work due to the TLS value
having been destroyed (or is actively being destroyed). The code for printing
a panic message assumed, however, that it could acquire the thread's name
through this method.
Instead this commit propagates the
Option
outwards to allow thestd::panicking
module to handle the case where the current thread isn'tpresent.
While it solves the immediate issue of #24313, there is still another underlying
issue of panicking destructors in thread locals will abort the process.
Closes #24313