Skip to content

Disable TLS dtors on process::exit for all platforms - #165437

Open
ChrisDenton wants to merge 1 commit into
rust-lang:mainfrom
ChrisDenton:tls-disable
Open

ChrisDenton wants to merge 1 commit into
rust-lang:mainfrom
ChrisDenton:tls-disable

Conversation

@ChrisDenton

@ChrisDenton ChrisDenton commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Running them may be unsound if called within a drop. We should endeavour to ensure they're disabled on all (non-linux __cxa_thread_atexit_impl) platforms, Note: this is blocked on the FCP in #165125.

r? joboet

@ChrisDenton ChrisDenton added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Nov 3, 2026
@rustbot rustbot added A-thread Area: `std::thread` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 3, 2026
@rustbot

rustbot commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

joboet is currently at their maximum review capacity.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Running them may be unsound if called within a drop.
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/pass/tls/tls_macro_drop.rs (revision `tree`) ... ok
tests/pass/tls/tls_macro_drop.rs (revision `tree_implicit_writes`) ... ok

FAILED TEST: tests/pass/tls/tls_macro_drop_main_thread.rs (revision `with_exit`)
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-zzU5Bt" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass/tls" "tests/pass/tls/tls_macro_drop_main_thread.rs" "--edition" "2021" "--cfg=with_exit" "-Cextra-filename=with_exit" "--target" "aarch64-apple-darwin"

error: no output was emitted
Execute `./miri test --bless` to remove `tests/pass/tls/tls_macro_drop_main_thread.with_exit.stdout`

full stderr:
---

Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.7/src/lib.rs:365

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/miri/3bfd8b5a5ee732c6/out/ui-3bfd8b5a5ee732c6` (exit status: 1)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout -Zembed-metadata=no --locked --color=always --profile=release --manifest-path /checkout/src/tools/miri/Cargo.toml -- [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:208:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:790:19

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test --stage 2 miri cargo-miri --target aarch64-apple-darwin`
Currently active steps:
test::Miri { target: aarch64-apple-darwin } at src/bootstrap/src/core/build_steps/test.rs:716
Build completed unsuccessfully in 0:01:54
  local time: Tue Nov  3 23:18:09 UTC 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-thread Area: `std::thread` S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants