Intel: 0xc000001d when two threads reach an SSE4a instruction while it's being replaced (#1653) #2393
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#2393
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@iBooM72 on GitHub · 2026-11-29 12:39 UTC · original
What happened
v2026.11.29.01 crashed once, 2 min 45 s after the start, with
0xc000001datvictory-image-b99f876b74d4a77f.dll+0x55b1811. It happened on the first start of this release, with defaultVICTORY_PATCH_SSE4A(on).f2 0f 78 c9 08 18(insertq xmm1, xmm1, 8, 24)e9 8a ea 9c fa 90(the jump from #1653 and a NOP)Likely cause (from the code and tests): two threads fault on the same instruction, and the first one replaces it. When the second thread's fault is handled,
emulate()reads the new bytes, can't decode the jump and returns 0. The fault then ends the run. This depends on timing, so it won't happen on every start.Tests on the unfixed release code (the tests aren't in the repo):
insertqat 128 places ended with0xc000001din 10 of 10 runs.insertq,extrq,monitorx,mwaitx, theclzeroloop andclwb. So the same gap affects the older replacements too. I only saw the SSE4a one crash in the game.Workaround: start with
--set VICTORY_PATCH_SSE4A=0, or addVICTORY_PATCH_SSE4A=0tovictory-settings.txt. I haven't seen0xc000001dsince, including in a 30-minute run. The crash depends on timing, so that isn't proof. It doesn't change the older replacements.About a fix: I tried running the replacement again when a late fault hits its exact bytes. That isn't safe enough for a PR yet:
0xc000001dfaults: 19 of 1,500 debug runs of the 8-thread test ended with0xc0000096.0xc0000096faults too: 2 of 8,000 runs (debug and release) still ended with0xc0000005. The cause isn't known. Changing code that other cores may be running needs synchronization, and one atomic write isn't enough.Safer options may be to turn
VICTORY_PATCH_SSE4Aoff by default for now, or to replace known instructions before any title thread starts. Neither has been tested. I can share the tests. Which approach would you prefer?GPU and driver
RTX 4070 Ti 12 GB, driver 621.01
CPU, RAM and Windows version
Intel Core i7-14700K, 32 GB, Windows 11 build 26300
VIctory release or commit
v2026.11.29.01 (official release)
Settings
Series X,
1080to1440, DLSS Quality, frame generation off, ray tracing off, 120 FPS cap.Logs
Attached (redacted): the play log and this crash's entry from
crashes.log. The memory dump isn't attached.Are you working on a fix?
I'd like to, with some pointers
Investigated and written with an AI assistant (Claude Code); the crash and tests were on my PC.
sse4a-crash-logs.zip
github-bot referenced this issue2026-11-29 14:44:53 +00:00
@KWillTech on GitHub · 2026-11-29 15:39 UTC · original
Same crash here, on a different Intel CPU and a different
insertq.v2026.11.29.01(829188e), release0xc000001datvictory-image-b99f876b74d4a77f.dll+0x5084782, about 7 minutes after the start, in the world. Windows Error Reporting names the module and the offset; there was no crash log from the layer.f2 0f 78 c0 08 18(insertq xmm0, xmm0, 8, 24)The log's only "a console CPU instruction this CPU lacks: emulated" line is for another
insertq(len: 16, idx: 16), so this site was replaced during the run, and a second thread most likely faulted on it while it was being replaced, as described above.I applied the same idea as #2614 locally (sites we replace are recorded; a fault at one of them that no longer decodes returns
CONTINUE_EXECUTIONwithout movingrip), with a unit test that emulates the first fault and then a late one at the samerip. The test fails without the change and passes with it. With the change, the next run stayed in the world for over 9 minutes without this crash. That is a single run, so it is not proof, but it is consistent with the cause in this issue.+1 for merging #2614 or #2585.
@iBooM72 on GitHub · 2026-11-29 18:05 UTC · original
I stress-tested #2614 (
eae2afbb) and #2585 (87ddb293) on Windows. Neither fixes every crash in this test, but #2585 is much better. OnlyVICTORY_PATCH_SSE4A=0passed every run.Test: 8 threads reach the same
insertqtogether, at 128 places per run. It uses the loader's real exception handler, and each run is a separate process. The PRs'console_insn.rsfiles are unchanged apart from line endings. The base (829188e9) and the added test are the same for all versions. i7-14700K, Windows 11, half debug runs and half release. This is much harsher than the game, so these aren't in-game crash rates. I didn't run the game.0xc000001d0xc00000960xc0000005829188e9829188e9,VICTORY_PATCH_SSE4A=0#2614: it notes a place only after changing its bytes, so a late fault in between isn't recognised. To check this, I moved that step before the change in a local copy.
0xc000001dwent from 1,981 in 2,000 runs to 0. That isn't a safe fix, though: 468 of those 2,000 runs finished but failed the test's final checks. All 55 outputs I saved from them report wronginsertqresults (the other 29 failures were0xc0000096). I haven't confirmed why. The handler still reads the code without a lock while another thread may be changing it, so it may have decoded a mix of old and new bytes. #2585 reads the bytes under the patch lock and had no wrong results in its 19,747 completed runs.#2585:
0xc000001dis gone here, which matches the Proton result in its comments. Neither PR handles late0xc0000096faults. All three0xc0000005crashes were at replaced places, in debug runs. One was at byte 4 of the 6-byte instruction. Neither the old instruction nor the newjmp+nophas an instruction starting there, which would fit a core running a mix of old and new bytes. That isn't proof, but it's why I wouldn't just retry0xc0000005faults.My own unfinished fix also handles late
0xc0000096faults, and it still had 20xc0000005crashes in 8,000 runs of a similar test. So handling late faults may not be enough while code that other cores may be running is being changed.Replacement off: with
VICTORY_PATCH_SSE4A=0, the same test programs that crashed in all 200 runs of829188e9passed all 20,000. Every result was right and nothing was replaced, so the crashes in this test come from the replacement. It only coversinsertq, and this switch doesn't affect theclzero,monitorx/mwaitxorclwbreplacements. With the switch off, a CPU without SSE4a raises an exception each time one of these instructions runs. The comment onpatches_sse4amentions oneinsertqthat faulted about 3,700 times a second. I didn't measure what that costs in the game.#2585 looks like the better of the two PRs, but not a complete fix. From these results, turning
VICTORY_PATCH_SSE4Aoff by default looks like the safest option for now, if the cost in the game is acceptable. I can share the test and the saved output.Tests and this comment were prepared with an AI assistant (Claude Code).
raisehelper fails with current DXC #2769raisehelper fails with current DXC #2769@diademoff on GitHub · 2026-11-30 10:40 UTC · original
Two more instances of the same shape on v2026.11.29.05, Linux/Proton (RTX 3060 12 GB, i7-12700, GE-Proton11-15 and Proton Experimental):
+0x5084782twice (e9 b9 ba 1f fa 90 …ande9 b9 ba 8f fa 90 …) and+0x27c8f2once (e9 a9 39 a0 ff 90 90 …), all right after the loading art while pixel shaders are translated. Full data, logs and what was ruled out are in #3775.