Skip to content

Fix multi-page JIT module invalidation#1585

Open
blixt wants to merge 2 commits into
copy:masterfrom
blixt:master
Open

Fix multi-page JIT module invalidation#1585
blixt wants to merge 2 commits into
copy:masterfrom
blixt:master

Conversation

@blixt

@blixt blixt commented Jun 10, 2026

Copy link
Copy Markdown

When running Windows 98 I would get occasional blue screens, but only when JIT was enabled. I tracked it down (disclosure: with the help of Claude Fable 5, but this PR has been tested and written by me) to cases where a JIT module was spread across more than one page.

This PR fixes the issue by tracking all pages and cleaning up appropriately.

There's also a drive-by fix for a line that probably should have been targeting the virtual page slot, not the physical slot, but happy to remove that if it's wrong.

Comment thread src/rust/jit.rs
}) => set_tlb_code(virt_page, *wasm_table_index, entry_points, *state_flags),
None => cpu::clear_tlb_code(phys_page.to_u32() as i32),
// Note: tlb_code is indexed by virtual page
None => cpu::clear_tlb_code(virt_page.to_u32() as i32),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by fix: this seems like it should use virt_page, not phys_page

@copy

copy commented Jun 14, 2026

Copy link
Copy Markdown
Owner

I recently started looking in this independently, and intend to propose a different fix for this.

The drive-by fix looks good, feel free to only fix that and remove the other commit.

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