Skip to content

Comments

sys/miri: fix Mmap::from_file to seek to start of file.#12572

Merged
cfallin merged 1 commit intobytecodealliance:mainfrom
cfallin:miri-mmap-file-seek
Feb 11, 2026
Merged

sys/miri: fix Mmap::from_file to seek to start of file.#12572
cfallin merged 1 commit intobytecodealliance:mainfrom
cfallin:miri-mmap-file-seek

Conversation

@cfallin
Copy link
Member

@cfallin cfallin commented Feb 11, 2026

The constructor takes a &File but &File still allows mutation of the underlying state, e.g., the seek position. It turns out that this matters when we try to Mmap::from_file more than once, e.g. when enabling guest debugging and thus mapping private copies of code.

No test yet as this will be covered by upcoming miri coverage of guest debugging.

The constructor takes a `&File` but `&File` still allows mutation of
the underlying state, e.g., the seek position. It turns out that this
matters when we try to `Mmap::from_file` more than once, e.g. when
enabling guest debugging and thus mapping private copies of code.

No test yet as this will be covered by upcoming miri coverage of guest
debugging.
@cfallin cfallin requested a review from a team as a code owner February 11, 2026 21:33
@cfallin cfallin requested review from fitzgen and removed request for a team February 11, 2026 21:33
@cfallin
Copy link
Member Author

cfallin commented Feb 11, 2026

(Found while trying to add miri coverage to #12566)

@cfallin cfallin enabled auto-merge February 11, 2026 21:39
@cfallin cfallin added this pull request to the merge queue Feb 11, 2026
Merged via the queue into bytecodealliance:main with commit 3623501 Feb 11, 2026
45 checks passed
@cfallin cfallin deleted the miri-mmap-file-seek branch February 11, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants