Repository navigation
Conversation
…cements (trustno1-coder#2393) Co-authored-by: Andrei Turcan <360425173+fainty0@users.noreply.github.com>
Co-authored-by: Andrei Turcan <360425173+fainty0@users.noreply.github.com>
|
Independent confirmation of the race under Wine, with a runtime result this Environment: RTX 4080 SUPER 16 GB, i9-14900K (no SSE4a), CachyOS, The same fault, in the same shape as #2614's report. Two run-ending The bytes in the file at those RVAs are A control that settles it without patching any code. This tree already has And I built your branch and ran it here, on top of #2060/#2160/#2240/#2188
For comparison, a fix I wrote that only took Not the same as the What I did not do: test on Windows, or run it long enough to reach a steady |
|
@Kassadd Weirdly enough i just encountered this same crash under wine (following the same |
|
Review note (read from the diff, not run on this branch): The ordering looks right to me. The replacement is recorded while Two small points:
Review was AI-assisted. |
|
Update: rerun on the current tree (v2026.11.29.03). The numbers in my earlier Built
On attribution, to be precise about what I have. Three runs on this tree:
So this PR alone did carry a run past five minutes, which is why the table is here rather What I did not verify: Windows, or a run past the opening. Logs on request. |
|
The Windows unit tests of this branch, run (the description says they were type-checked only). Environment: i7-13700KF (no SSE4a), RTX 4080, CachyOS kernel 7.3.6, GE-Proton 11-11 Tests: The fault, a third time on other hardware and another Proton: on the same site and shape as #2614 and Kassadd's Not done: an in-game run of this branch here (the runtime result above is Kassadd's), or Tests run and comment written with Claude Code (AI-assisted). |
|
The fault is still there on v2026.11.29.05, which is the point: this PR has to Ran the released
That is why I think this one should not wait for a quiet moment: every release the Nothing new about the code itself; the tests above and gabrielecabrini's and |
…ough recorded console instruction replacements (trustno1-coder#2393)) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@tempodat — thanks for confirming it under Wine, another independent report at the same site. But You no longer need to wait for anything. On closing this PR — the remaining diff against - flush_code(at, len);
+ let _ = flush_code(at, len);Everything else is already in The thread is now doing the opposite of what it was written for: two people have concluded they My suggestion: close this one, keeping the credit for the diagnosis, and open a small PR with that Not tested by me: Windows, and the failing-flush path itself. |
Fixes #2393
What it changes
A late illegal-instruction fault could go unhandled if another thread had already replaced the faulting instruction. The handler now snapshots code under the patch lock and resumes only when the bytes exactly match a replacement it installed at that address. It enters generated stubs directly and retries inline replacements in place. Stubs are flushed before their jumps are installed. The site flush is best-effort: the bytes were already written and must remain recognisable even if the flush fails. CLWB falls back to emulation when it cannot be patched atomically.
How it was tested
insertq,extrq,monitorx,mwaitx, theclzeroloop andclwb, and rejects altered or unrecorded bytes. It was type-checked but not run (no Windows); runtime behaviour was not verified.cargo testpassed for the crates it touches: no. Eleven Linux loader unit tests passed; one unchanged PE-only test failed on the Linux test executable withUnknown file magicon both main and the branch. Windows tests were not run (no Windows).Checked for overlap
SSE4a,insertq,1653,2393andconsole_insnfound no open PRs. Related: loader: replace SSE4a extrq/insertq with SSE2 stubs on first fault #1653 (merged).