Skip to content

Ensure TLS accesses don't call the global allocator through panic - #160934

Open
maxdexh wants to merge 1 commit into
rust-lang:mainfrom
maxdexh:fix-thread-local-global-alloc-reenter
Open

Ensure TLS accesses don't call the global allocator through panic#160934
maxdexh wants to merge 1 commit into
rust-lang:mainfrom
maxdexh:fix-thread-local-global-alloc-reenter

Conversation

@maxdexh

@maxdexh maxdexh commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #160930

That issue is much more simple to fix than the other reentrancy issues, since only thread locals
use the TLS code. We can just replace all the assertions with their rt versions that do not
call the global allocator.

r? libs

@rustbot rustbot added 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 Aug 11, 2026
@nia-e

nia-e commented Aug 11, 2026

Copy link
Copy Markdown
Member

That should work. ty!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 16c0574 has been approved by nia-e

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 11, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 11, 2026
…loc-reenter, r=nia-e

Ensure TLS accesses don't call the global allocator through panic

Fixes rust-lang#160930

That issue is much more simple to fix than the other reentrancy issues, since only thread locals
use the TLS code. We can just replace all the assertions with their `rt` versions that do not
call the global allocator.

r? libs
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 11, 2026
…loc-reenter, r=nia-e

Ensure TLS accesses don't call the global allocator through panic

Fixes rust-lang#160930

That issue is much more simple to fix than the other reentrancy issues, since only thread locals
use the TLS code. We can just replace all the assertions with their `rt` versions that do not
call the global allocator.

r? libs
rust-bors Bot pushed a commit that referenced this pull request Aug 11, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #160620 (Do not pass `-no-pie` on Windows)
 - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion)
 - #160760 (Miri: give the incremental session a chance to finish)
 - #160854 (Add -Zwasm-proc-macros flag)
 - #160868 (std: Adjust cfgs again for TLS on WASI)
 - #160894 (Allow running an arbitrary number of try jobs per PR)
 - #160790 (rustc-book: update sys-v abi link)
 - #160878 (Add rust_analyzer to check-cfg names)
 - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency)
 - #160920 (No longer mention the removed generic)
 - #160921 (rustdoc: Fix invalid CSS classes generated for notable items)
 - #160924 (split up `rustc_session`)
 - #160934 (Ensure TLS accesses don't call the global allocator through panic)
 - #160937 (Store the names of `Fn` trait parameters in the AST, fix rustfmt bug)
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 12, 2026
…loc-reenter, r=nia-e

Ensure TLS accesses don't call the global allocator through panic

Fixes rust-lang#160930

That issue is much more simple to fix than the other reentrancy issues, since only thread locals
use the TLS code. We can just replace all the assertions with their `rt` versions that do not
call the global allocator.

r? libs
rust-bors Bot pushed a commit that referenced this pull request Aug 12, 2026
Rollup of 14 pull requests

Successful merges:

 - #160620 (Do not pass `-no-pie` on Windows)
 - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion)
 - #160854 (Add -Zwasm-proc-macros flag)
 - #160868 (std: Adjust cfgs again for TLS on WASI)
 - #160882 (Add basic `splat` support to `rustdoc`)
 - #160894 (Allow running an arbitrary number of try jobs per PR)
 - #160790 (rustc-book: update sys-v abi link)
 - #160878 (Add rust_analyzer to check-cfg names)
 - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency)
 - #160920 (No longer mention the removed generic)
 - #160921 (rustdoc: Fix invalid CSS classes generated for notable items)
 - #160924 (split up `rustc_session`)
 - #160934 (Ensure TLS accesses don't call the global allocator through panic)
 - #160937 (Store the names of `Fn` trait parameters in the AST, fix rustfmt bug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

More global allocator reentrancy issues; this time thread_local

3 participants