Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

miri: implement TlsFree #133457

Merged
merged 1 commit into from
Nov 27, 2024
Merged

miri: implement TlsFree #133457

merged 1 commit into from
Nov 27, 2024

Conversation

joboet
Copy link
Member

@joboet joboet commented Nov 25, 2024

If the variable does not need a destructor, std uses racy initialization for creating TLS keys on Windows. With just the right timing, this can lead to TlsFree being called. Unfortunately, with #132654 this is hit quite often, so miri should definitely support TlsFree (documentation).

I'm filing this here instead of in the miri repo so that #132654 isn't blocked for so long.

If the variable does not need a destructor, `std` uses racy initialization for creating TLS keys on Windows. With just the right timing, this can lead to `TlsFree` being called. Unfortunately, with rust-lang#132654 this is hit quite often, so miri should definitely support `TlsFree` ([documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-tlsfree)).

I'm filing this here instead of in the miri repo so that rust-lang#132654 isn't blocked for so long.
@rustbot
Copy link
Collaborator

rustbot commented Nov 25, 2024

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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 25, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 25, 2024

The Miri subtree was changed

cc @rust-lang/miri

@saethlin
Copy link
Member

Looks good to me.

r? saethlin
@bors r+

@bors
Copy link
Contributor

bors commented Nov 25, 2024

📌 Commit 77fccf5 has been approved by saethlin

It is now in the queue for this repository.

@rustbot rustbot assigned saethlin and unassigned Mark-Simulacrum Nov 25, 2024
@bors bors 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 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#132979 (use `--exact` on `--skip` to avoid unintended substring matches)
 - rust-lang#133248 (CI: split x86_64-msvc-ext job)
 - rust-lang#133449 (std: expose `const_io_error!` as `const_error!`)
 - rust-lang#133453 (Commit license-metadata.json to git and check it's correct in CI)
 - rust-lang#133457 (miri: implement `TlsFree`)
 - rust-lang#133493 (do not constrain infer vars in `find_best_leaf_obligation`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3cce78b into rust-lang:master Nov 27, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Nov 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2024
Rollup merge of rust-lang#133457 - joboet:miri-tlsfree, r=saethlin

miri: implement `TlsFree`

If the variable does not need a destructor, `std` uses racy initialization for creating TLS keys on Windows. With just the right timing, this can lead to `TlsFree` being called. Unfortunately, with rust-lang#132654 this is hit quite often, so miri should definitely support `TlsFree` ([documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-tlsfree)).

I'm filing this here instead of in the miri repo so that rust-lang#132654 isn't blocked for so long.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants