miri genmc: fix exit() handling#148991
Merged
bors merged 2 commits intorust-lang:mainfrom Dec 20, 2025
Merged
Conversation
Collaborator
Collaborator
|
|
Member
Author
|
@oli-obk anything I can do to move this along? :) Or should I find another reviewer? The core interpreter changes are very small, just slightly weakening a sanity check that is getting in the way. |
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Member
Author
|
@saethlin maybe you could take a look at this? |
Member
|
r? saethlin |
Member
Author
|
@saethlin friendly review reminder. :) |
oli-obk
approved these changes
Dec 20, 2025
Contributor
|
@bors r+ rollup |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 20, 2025
miri genmc: fix exit() handling In genmc mode, Miri does not want to stop execution when `exit` is called. Instead we want to continue running other threads to ensure we covered all possible concurrent behaviors (including the ones where the exiting thread was delayed so the other threads took their turns first). However, the core interpreter has a sanity check that prevents us from just doing nothing in `exit`. This leaves us in a pickle: there's nowhere we can jump to (exit has return type `!` so there's no next block), but if we don't jump anywhere we ICE. The first commit fixes that by disabling the sanity check when there is no block to jump to. That still catches the mistake of forgetting to jump for the vast majority of shims. We currently don't build Miri's genmc integration in rustc CI so I had to hack the feature into the bootstrap miri integration. That turned out to use the wrong Miri binary, which is fixed by the second commit: we can just rely on CARGO_BIN_EXE_miri, there's no need for a MIRI environment variable. r? `@oli-obk`
This was referenced Dec 20, 2025
bors
added a commit
that referenced
this pull request
Dec 20, 2025
Rollup of 4 pull requests Successful merges: - #146747 (rustc_codegen_llvm: Tidying of `update_target_reliable_float_cfg`) - #148499 (Nvptx: Use llbc as default linker) - #148991 (miri genmc: fix exit() handling) - #150172 (Handle remapped paths correctly when generating "Source" links) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Dec 20, 2025
Rollup merge of #148991 - RalfJung:genmc-exit, r=oli-obk miri genmc: fix exit() handling In genmc mode, Miri does not want to stop execution when `exit` is called. Instead we want to continue running other threads to ensure we covered all possible concurrent behaviors (including the ones where the exiting thread was delayed so the other threads took their turns first). However, the core interpreter has a sanity check that prevents us from just doing nothing in `exit`. This leaves us in a pickle: there's nowhere we can jump to (exit has return type `!` so there's no next block), but if we don't jump anywhere we ICE. The first commit fixes that by disabling the sanity check when there is no block to jump to. That still catches the mistake of forgetting to jump for the vast majority of shims. We currently don't build Miri's genmc integration in rustc CI so I had to hack the feature into the bootstrap miri integration. That turned out to use the wrong Miri binary, which is fixed by the second commit: we can just rely on CARGO_BIN_EXE_miri, there's no need for a MIRI environment variable. r? ``@oli-obk``
github-actions Bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Dec 21, 2025
Rollup of 4 pull requests Successful merges: - rust-lang/rust#146747 (rustc_codegen_llvm: Tidying of `update_target_reliable_float_cfg`) - rust-lang/rust#148499 (Nvptx: Use llbc as default linker) - rust-lang/rust#148991 (miri genmc: fix exit() handling) - rust-lang/rust#150172 (Handle remapped paths correctly when generating "Source" links) r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In genmc mode, Miri does not want to stop execution when
exitis called. Instead we want to continue running other threads to ensure we covered all possible concurrent behaviors (including the ones where the exiting thread was delayed so the other threads took their turns first). However, the core interpreter has a sanity check that prevents us from just doing nothing inexit. This leaves us in a pickle: there's nowhere we can jump to (exit has return type!so there's no next block), but if we don't jump anywhere we ICE.The first commit fixes that by disabling the sanity check when there is no block to jump to. That still catches the mistake of forgetting to jump for the vast majority of shims.
We currently don't build Miri's genmc integration in rustc CI so I had to hack the feature into the bootstrap miri integration. That turned out to use the wrong Miri binary, which is fixed by the second commit: we can just rely on CARGO_BIN_EXE_miri, there's no need for a MIRI environment variable.
r? @oli-obk