Skip to content

std: don't call current_os_id from signal handler - #149456

Merged
bors merged 2 commits into
rust-lang:mainfrom
joboet:async-safe-tid
Dec 4, 2025
Merged

std: don't call current_os_id from signal handler#149456
bors merged 2 commits into
rust-lang:mainfrom
joboet:async-safe-tid

Conversation

@joboet

@joboetjoboet commented Nov 29, 2025

Copy link
Copy Markdown
Member

current_os_id is not always async-signal-safe depending on the platform, hence it may not be called from the SIGSEGV handler. Instead, store the thread ID along with the thread name during setup. With #144465 merged, this information is available even before the thread main function.

@rustbot

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbotrustbot added O-unix Operating system: Unix-like 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 29, 2025
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 5009847 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@borsbors 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 Nov 30, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 1, 2025
…lacrum
std: don't call `current_os_id` from signal handler
`current_os_id` is not always async-signal-safe depending on the platform, hence it may not be called from the SIGSEGV handler. Instead, store the thread ID along with the thread name during setup. With rust-lang#144465 merged, this information is available even before the thread main function.
bors added a commit that referenced this pull request Dec 1, 2025
Rollup of 2 pull requests
Successful merges:
- #149456 (std: don't call `current_os_id` from signal handler)
- #149479 (Fix indent in E0591.md)
r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr

Copy link
Copy Markdown
Member

@bors r-

#149493 (comment)

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 1, 2025
@joboet

Copy link
Copy Markdown
MemberAuthor

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 1, 2025
@rust-log-analyzer

This comment has been minimized.

@joboet

This comment was marked as resolved.

@borsbors 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 Dec 2, 2025
@joboet

This comment was marked as resolved.

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 2, 2025
@joboetjoboet added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 2, 2025
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 85b6c38 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@borsbors 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 Dec 4, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 4, 2025
…lacrum
std: don't call `current_os_id` from signal handler
`current_os_id` is not always async-signal-safe depending on the platform, hence it may not be called from the SIGSEGV handler. Instead, store the thread ID along with the thread name during setup. With rust-lang#144465 merged, this information is available even before the thread main function.
@ZalatharZalathar mentioned this pull request Dec 4, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 4, 2025
…lacrum
std: don't call `current_os_id` from signal handler
`current_os_id` is not always async-signal-safe depending on the platform, hence it may not be called from the SIGSEGV handler. Instead, store the thread ID along with the thread name during setup. With rust-lang#144465 merged, this information is available even before the thread main function.
This was referenced Dec 4, 2025
bors added a commit that referenced this pull request Dec 4, 2025
Rollup of 12 pull requests
Successful merges:
- #147841 (Fix ICE when applying test macro to crate root)
- #149147 (Fix unused_assignments false positives from macros)
- #149183 (Use `TypingMode::PostAnalysis` in `try_evaluate_const`)
- #149456 (std: don't call `current_os_id` from signal handler)
- #149501 (CTFE: avoid emitting a hard error on generic normalization failures)
- #149528 (reword error for invalid range patterns)
- #149539 (Additional test for uN::{gather,scatter}_bits)
- #149549 (Regression test for system register `ttbr0_el2`)
- #149550 (Disable native-lib for x check miri)
- #149554 (build-manifest: generate MSI and MINGW arrays from rustc)
- #149557 (c-variadic: bpf and spirv do not support c-variadic definitions)
- #149569 (Fix mailmap issue)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 08a5519 into rust-lang:mainDec 4, 2025
11 checks passed
@rustbotrustbot added this to the 1.93.0 milestone Dec 4, 2025
rust-timer added a commit that referenced this pull request Dec 4, 2025
Rollup merge of #149456 - joboet:async-safe-tid, r=Mark-Simulacrum
std: don't call `current_os_id` from signal handler
`current_os_id` is not always async-signal-safe depending on the platform, hence it may not be called from the SIGSEGV handler. Instead, store the thread ID along with the thread name during setup. With #144465 merged, this information is available even before the thread main function.
github-actionsBot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Dec 15, 2025
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#147841 (Fix ICE when applying test macro to crate root)
- rust-lang/rust#149147 (Fix unused_assignments false positives from macros)
- rust-lang/rust#149183 (Use `TypingMode::PostAnalysis` in `try_evaluate_const`)
- rust-lang/rust#149456 (std: don't call `current_os_id` from signal handler)
- rust-lang/rust#149501 (CTFE: avoid emitting a hard error on generic normalization failures)
- rust-lang/rust#149528 (reword error for invalid range patterns)
- rust-lang/rust#149539 (Additional test for uN::{gather,scatter}_bits)
- rust-lang/rust#149549 (Regression test for system register `ttbr0_el2`)
- rust-lang/rust#149550 (Disable native-lib for x check miri)
- rust-lang/rust#149554 (build-manifest: generate MSI and MINGW arrays from rustc)
- rust-lang/rust#149557 (c-variadic: bpf and spirv do not support c-variadic definitions)
- rust-lang/rust#149569 (Fix mailmap issue)
r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-unixOperating system: Unix-likeS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant 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.

6 participants

@joboet@rustbot@Mark-Simulacrum@bors@matthiaskrgr@rust-log-analyzer