Uh oh!
There was an error while loading. Please reload this page.
Allow spawning threads after TLS destruction - #138702
Conversation
rustbot
commented
Mar 19, 2025
rustbot has assigned @Mark-Simulacrum. Use |
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
r=me with docs added (or maybe comment on the unstable tracking issue)
| ChildSpawnHooks { hooks, to_run } | ||
| } else { | ||
| // TLS has been destroyed. Skip running the hooks. | ||
| // See https://github.com/rust-lang/rust/issues/138696 |
There was a problem hiding this comment.
Should we document this in add_spawn_hook ("for every newly thread spawned"), maybe as a footnote or something like that?
There was a problem hiding this comment.
This comment seems unresolved? I agree that it'd be good to document this.
There was a problem hiding this comment.
I responded to it below:
Added it to the tracking issue for now.
We might want to investigate exactly when this can and cannot happen before stabilizing (and documenting).
m-ou-se
commented
Mar 26, 2025
Added it to the tracking issue for now. We might want to investigate exactly when this can and cannot happen before stabilizing (and documenting). @bors r=Mark-Simulacrum |
bors
commented
Mar 26, 2025
…mulacrum Allow spawning threads after TLS destruction Fixesrust-lang#138696
Rollup of 9 pull requests Successful merges: - rust-lang#130883 (Add environment variable query) - rust-lang#138672 (Avoiding calling queries when collecting active queries) - rust-lang#138702 (Allow spawning threads after TLS destruction) - rust-lang#138935 (Update wg-prio triagebot config) - rust-lang#138946 (Un-bury chapters from the chapter list in rustc book) - rust-lang#138964 (Implement lint against using Interner and InferCtxtLike in random compiler crates) - rust-lang#138977 (Don't deaggregate InvocationParent just to reaggregate it again) - rust-lang#138980 (Collect items referenced from var_debug_info) - rust-lang#138985 (Use the correct binder scope for elided lifetimes in assoc consts) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
commented
Mar 27, 2025
Looks like this failed in rollup: #138994 (comment) @bors r- |
Zalathar
commented
Mar 27, 2025
This probably just needs a |
Thanks. It failed with the following error message. #138994 Error``` 2025-03-26T21:40:40.3315646Z failures: 2025-03-26T21:40:40.3315853Z 2025-03-26T21:40:40.3316147Z ---- [ui] tests/ui/thread-local/spawn-hook-atexit.rs stdout ---- 2025-03-26T21:40:40.3316528Z 2025-03-26T21:40:40.3325429Z error: test run failed! 2025-03-26T21:40:40.3325770Z status: exit status: 134 2025-03-26T21:40:40.3327164Z command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local/spawn-hook-atexit" && RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUST_TEST_THREADS="4" "/wasmtime-v19.0.0-x86_64-linux/wasmtime" "run" "-C" "cache=n" "--dir" "." "--env" "RUSTC_BOOTSTRAP" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local/spawn-hook-atexit/a.wasm" 2025-03-26T21:40:40.3328475Z stdout: none 2025-03-26T21:40:40.3328724Z --- stderr ------------------------------- 2025-03-26T21:40:40.3329095Z 2025-03-26T21:40:40.3329330Z thread 'main' panicked at /rustc/FAKE_PREFIX/library/std/src/thread/mod.rs:729:29: 2025-03-26T21:40:40.3329941Z failed to spawn thread: Error { kind: Unsupported, message: "operation not supported on this platform" } 2025-03-26T21:40:40.3330518Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 2025-03-26T21:40:40.3331181Z Error: failed to run main module `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local/spawn-hook-atexit/a.wasm` 2025-03-26T21:40:40.3331635Z 2025-03-26T21:40:40.3331726Z Caused by: 2025-03-26T21:40:40.3331945Z 0: failed to invoke command default 2025-03-26T21:40:40.3332513Z 1: error while executing at wasm backtrace: 2025-03-26T21:40:40.3333117Z 0: 0x731d - a.wasm!__rustc[e71bbdf1327cd442]::__rust_start_panic 2025-03-26T21:40:40.3333847Z 1: 0x711a - a.wasm!__rustc[e71bbdf1327cd442]::rust_panic 2025-03-26T21:40:40.3334874Z 2: 0x70ed - a.wasm!std::panicking::rust_panic_with_hook::hf7253cc1326481e4 2025-03-26T21:40:40.3335606Z 3: 0x618f - a.wasm!std::panicking::begin_panic_handler::{{closure}}::he12880ca3e35ef7a 2025-03-26T21:40:40.3336306Z 4: 0x60fb - a.wasm!std::sys::backtrace::__rust_end_short_backtrace::h5892030c5e958e1f 2025-03-26T21:40:40.3336770Z 5: 0x6a80 - a.wasm!__rustc[e71bbdf1327cd442]::rust_begin_unwind 2025-03-26T21:40:40.3337185Z 6: 0xb81b - a.wasm!core::panicking::panic_fmt::hfecdcbf9788721e5 2025-03-26T21:40:40.3337691Z 7: 0xd3a8 - a.wasm!core::result::unwrap_failed::h0cf8ff721cbe3fe3 2025-03-26T21:40:40.3338103Z 8: 0xa88 - a.wasm!std::thread::spawn::h6b69bdde073e2268 2025-03-26T21:40:40.3338488Z 9: 0x1802 - a.wasm!spawn_hook_atexit::main::h872f7eff79614d37 2025-03-26T21:40:40.3338951Z 10: 0x5c6 - a.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h0654a70c6c569708 2025-03-26T21:40:40.3339424Z 11: 0x5b9 - a.wasm!std::rt::lang_start::{{closure}}::h53d8d7c9849aa50e 2025-03-26T21:40:40.3339848Z 12: 0x37bb - a.wasm!std::rt::lang_start_internal::h824b1b60e0c6fb40 2025-03-26T21:40:40.3340199Z 13: 0x183b - a.wasm!__main_void 2025-03-26T21:40:40.3340566Z 14: 0x325 - a.wasm!_start 2025-03-26T21:40:40.3341079Z 2: wasm trap: wasm `unreachable` instruction executed 2025-03-26T21:40:40.3341648Z ------------------------------------------ 2025-03-26T21:40:40.3341982Z ``` |
m-ou-se
commented
Mar 27, 2025
@bors r=Mark-Simulacrum |
bors
commented
Mar 27, 2025
…lacrum Allow spawning threads after TLS destruction Fixesrust-lang#138696
bors
commented
Mar 27, 2025
This comment has been minimized.
This comment has been minimized.
bors
commented
Mar 27, 2025
💔 Test failed - checks-actions |
m-ou-se
commented
Mar 27, 2025
@bors r=Mark-Simulacrum |
bors
commented
Mar 27, 2025
bors
commented
Mar 27, 2025
bors
commented
Mar 28, 2025
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 3f55023 (parent) -> 7586a9f (this PR) Test differencesShow 3 test diffsStage 1
Stage 2
Job group index
Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
rust-timer
commented
Mar 28, 2025
Finished benchmarking commit (7586a9f): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 777.846s -> 778.708s (0.11%) |
…lacrum Allow spawning threads after TLS destruction Fixesrust-lang#138696
Fixes#138696