DREDGE (PPSA09076) on Windows: intermittent fault in Job.Worker 4 (read of 0x6000000xx at app.exe+0x17f0796), 2 of 8 runs #3915
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?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T19:07:48Z.
DREDGE (PPSA09076, Unity) on Windows 10,
maina11c8f7f7, relinked with--windows --module-dir Media/Modules --module-dir Media/Plugins(13 modules, 0 absent imports), RTX 4080 SUPER: it intermittently faults in a job worker thread. Of 8 runs of 60 to 180 s with this build, 2 ended withand
The other 6 runs (one of them 180 s) ran to their time limit with no fault, no abort and no error line. In the first fault the instruction is
mov rax,[r8+0x30]in title code (app.exe+0x17f0796, right after it stores two 32-bit values to[rdi+0x1c]and[rdi+0x20]), andr8is0x0000000600000000: a pointer whose low half is 0 and whose high half is 6, which looks like two adjacent 32-bit fields read as one 64-bit pointer, or a pointer slot that was never written. Both faults are inJob.Worker 4, in the same part ofapp.exe(+0x17efe13and+0x17f0796are 0x983 bytes apart), and both read an address of the form0x6000000xx.Not established: what the routine is (Unity's job system, as the thread name suggests), whether the bad pointer comes from a race between workers or from a value our imports return, and why only 2 of 8 runs hit it. I have not tried a build with a different thread or timer setting, and I have not looked at the picture. The same Unity titles Cult of the Lamb and Harmony's Odyssey did not fault in the 150 s runs I made (one run each), so I do not know if it is specific to this title.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T19:48:57Z.
Cause found, as far as a static read and a control experiment go: this is the red-zone overwrite tracked in #361 and fixed in part by #2054, not a new bug.
app.exe+0x17f0796readsr8from[rsp-0x30](mov r8,[rsp-0x30]at+0x17f0730) and other locals from[rsp-0x3c],[rsp-0x28],[rsp-0x48], and usesvmovups ymmin the same function. The fault itself ismov rax,[r8+0x30]withr8 = 0x600000000, i.e. the slot read back as garbage. That matches the mechanism in #361: a resumed write fault on this thread makes Windows build its exception frame, with the upper AVX state, belowrspand overwrite the slots (the nearest overwritten qword isrsp-0x20or closer on a host without AVX-512; this host is a Ryzen 7 5800X3D, Zen 3, no AVX-512).APS5_TRACE_MEMORY=1over six 140 s runs under gdb no mapping, reservation or flexible-memory call touches the0x6_0000_0000range; the guest ranges are all below0x2_5000_0000. So0x600000000was not returned by our memory calls.APS5_NO_WRITE_WATCH=1, 8 runs of 60 s: 0 faults. Without it the same build faulted in 2 of 8 earlier runs. 8 clean runs would happen by chance about one time in ten at that rate, so this supports the cause but does not prove it; I did not test #2054's branch.SIGSEGV(6 runs of 140 s) the fault did not appear at all, which fits a timing-dependent effect.Both faults are in
Job.Worker 4, at+0x17f0796(ther8load above) and+0x17efe13(rax = 0x600000000, a read of0x600000004).AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T21:04:14Z.
Rate data for this issue (details on #2054): plain
maina11c8f7f7, DREDGE, 20 runs (10 at 60 s, 10 at 120 s): 3 faulted, all at 60 s and all inJob.Workerthreads, atapp.exe+0x17f05ed(twice, read of0x00007ff74d268000) and+0x17f0843(read of0x40), next to the sites above. With the red-zone fix candidate #2054 rebased onto the samemain: 0 of 20. So the crash rate here is about 2 of 8, then 3 of 20 overall onmain, and it was not constant between batches. I have not shown that #2054 is the cause or the cure: 3 of 20 against 0 of 20 is p of about 0.12.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T21:24:50Z.
Update with more runs (details on #2054): plain
main, DREDGE, 60 s runs: 5 of 20 faulted (app.exe+0x17f05edtwice,+0x17f0843once,+0x17f0796twice; reads of0x7ff74d268000,0x40and0x600000030), 120 s runs 0 of 10. With #2054 rebased onto the samemain: 1 of 20 at 60 s, atapp.exe+0x17efe13with a read of0x600000004(the same site and value as one of the original faults here), 0 of 10 at 120 s. So #2054 lowered the rate in these runs (p of about 0.09, not significant) but did not remove the crash.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T21:57:42Z.
Measurements for the red-zone explanation (#361), DREDGE (PPSA09076) on Windows 10, Ryzen 7 5800X3D,
maina11c8f7f7. I added a local, uncommitted counter toWindowsMappings::HandleWrite(the resumed write fault on a write-armed shared view) that counts faults per 16 KiB page and prints a summary every 5 s. 60 s runs:main, run 1main, run 2main, run 3 (this run later faulted fatally)main, new counter build, run 2main, new counter build, run 3main, new counter build, run 1 (faulted fatally)main+ #2054, run 1 and run 2main+ #2054, run 3What this shows: on
mainthe title takes about 3,800 resumed write faults per second (about 210,000 in 55 s, the figure #2054 also gives). Most of the 30,000 pages are hit once; about 830 to 880 pages are hit 20 or more times and carry about 85 % of all faults (about 14 MiB of hot memory), the 11 to 15 hottest pages about 10 to 13 %. With #2054 two of three runs had no fault at all, but the third had as many asmain; I did not check why (a guess, not checked: that run's direct memory got mapped a second time, which turns it back into views, and in #2054 only a range mapped once is private). That would also fit the 1 of 20 crash with #2054 in #3915.From a read of the code by a second reviewer, not measured by me, and marked so: the faults happen on direct-memory section views (
GuestArenaMap,GuestArena.cpp:343) thatCollect(clear=true)re-arms withVirtualProtectto read-only (WindowsMappings.hpp:249-257); the handler resumes them throughReportCrashandHandleWrite(CrashReport.cpp:244,WindowsMappings.hpp:134-145). Excluding stack pages from the arming would not help, because the fault is on a data page and Windows builds its exception frame atrspbelow the System V red zone before any handler runs, and there is nosigaltstackequivalent. A possible mitigation, also read and not tried: pin hot views, aslibSceFiber/Export.cpp:191andUserContext.cpp:60already do throughPin(WindowsMappings.hpp:109-123), by counting faults per page inHandleWriteand pinning a page after a threshold. A page that is pinned stays writable, so it stops faulting, butCollectthen reports it as written every time, so the GPU side would re-process that memory each time; what that costs I have not measured.One correction to my earlier control experiment:
APS5_NO_WRITE_WATCH=1sets_writeWatched = false(GuestArena.cpp:137), so the 0 of 8 faults with it show that the write-watch path as a whole matters, not that the views alone do.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T22:33:20Z.
Branch for the pin idea from the previous comment, built and measured:
xXPBSXx:fix/libc-pin-hot-shared-views(9906ffeae, based onmainca4ab0d5d, two files). InWindowsMappings::HandleWritea view is counted per fault and pinned writable (the samepinsthat libSceFiber uses) after 100 faults; the pin is released when the view is unmapped.Collectreports a pinned page as written every time. New testCheckHotSharedPageStopsFaultinginguest_memory(a range mapped once, written and collected 300 times: after the threshold the page staysPAGE_READWRITEandCollectkeeps reporting it); it passes with the change and fails atGuestMemory.cpp:1186without it (Windows 10, with #4021 merged locally becausemainca4ab0d5ddid not build on Windows at that moment).DREDGE, 10 alternating pairs of 60 s runs on the same
mainlibs with and without this change: 2 of 10 faulted without it (Job.Worker 7atapp.exe+0x17f0843,Job.Worker 3at+0x17f0796), 1 of 10 with it (Job.Worker 1at+0x17f01a1, the same routine area). So it did not make the crash disappear, and 1 of 10 against 2 of 10 says nothing statistically. Together with the earlier batches of the same comparison the crash rate on plainmainis 7 of 30 for 60 s runs and 0 of 10 for 120 s runs (7 of 40 in all).An estimate, not measured: if every resumed fault has the same small chance of hitting live red-zone data, about 210,000 faults per run at a crash rate near 25 % would be about one chance in a million per fault, and removing the 85 % of faults on the hot pages would leave a rate of a few percent, which is what 1 of 10 and 1 of 20 (with #2054) look like but cannot confirm. About 15 % of the faults are first writes to pages that fault only a few times each (about 29,000 pages), and a threshold cannot remove those. I have not measured the cost of pinning: a pinned page is reported as written on every
Collect, so the GPU side may process those pages every time; about 850 pages of 16 KiB is about 14 MiB for this title.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T12:10:29Z.
DREDGE (PPSA09076) re-measure on current
mainffa198407(Windows 10, GCC Release; fresh work directory,--module-dir Media/Modules --module-dir Media/Plugins; libs built from that commit,libkernel.prxhash3B72701Bidentical in the work directory): 5 runs of 150 s, one after the other.0xc0000005onJob.Worker 2,rip app.exe+0x17f0843(542 stderr lines in that run). This is the same code offset as the fault I saw once in a 5-run series onmaind146ec1b6with #4186 merged (Job.Worker 9,app.exe+0x17f0843); that series had 0 of 5 fatal on plain main and 1 of 5 with the PR.Together that is 2 faults in 15 runs of 150 s over three commits and one local merge, all at the same offset, so the rate looks like roughly 1 in 7 to 1 in 5 for 150 s runs; the earlier figure of 5 of 20 at 60 s is of the same order. Difference to this issue's description: the fault here is a read of
0x40atapp.exe+0x17f0843, not a read of0x6000000xxatapp.exe+0x17f0796as in the title. It is nearby (0xad bytes later, possibly the same routine, not checked) and a different access, so I would not count it as the same signature without a disassembly comparison.This does not say what the faulting routine is or whether it is the red-zone case of this issue; I did not take a register dump this time.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T14:06:49Z.
DREDGE (PPSA09076) on
mainwith the libs of3d8ffeb27, a run started by the user: crashed after about 40 s in the intro (the user saw the picture and says frame 497; no statement about sound or input). Separated into what the files show and what is interpretation.Shown (log +
objdumpof the relinkedapp.exe)FATAL 0xc0000005onJob.Worker 0,rip app.exe+0x17f05ed, read of0x7ff6bff18000= image RVA0x1dd8000, the first byte of PE section.elf6(the ELF's flaglessPT_LOAD, p_flags 0, which contains DYNAMIC; the relinker gives such pages no read permission,WindowsLoadImage.cpp).rax = 0x7ff6bff0f990lies 0x8670 bytes before it in the preceding RW section.elf5.vmulss xmm1,xmm1,[rax+rbp*4]in a float loop whose loop variables are loaded from slots belowrsp([rsp-0x7c],[rsp-0x70],[rsp-0x68],[rsp-0x60]; 12 such accesses between+0x17f0500and+0x17f0600). At the faultrsi = 0xffffffffffffdde4(movsxdof the 32-bit value from[rsp-0x7c]) andrbx = -0x80(from[rsp-0x70]): both are not plausible loop values.app.exe+0x17efa70(push rbp; sub rsp,0xf8) to itsretat+0x17f08a2; this fault (+0x17f05ed), the issue's+0x17f0796(a loadmov rax,[r8+0x30]) and my earlier+0x17f0843(a loadmov rcx,[r12+0x40], read of 0x40) are all inside it. Three different faulting instructions, three different bad values.Interpretation (not proven)
rspbeing overwritten fits the red-zone mechanism of #361 (a resumed write fault makes Windows build its exception frame atrsp), and the write-watch approach of #2054 is the candidate for it. I have no trace showing a write fault resumed inside this function in the faulting run, so I cannot say the red zone was overwritten here. The.elf6boundary is only where this wrong index happens to land, not the cause.Rate on this title so far: 2 faults in 15 runs of 150 s (earlier comment) plus this run at about 40 s.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T23:52:59Z.
Closing as a duplicate of #361: the faulting function keeps its locals below
rsp, which is the red-zone overwrite tracked there. The DREDGE rates are useful on #361; if it still faults after that's fixed, comment here.