Repository navigation
Conversation
|
Tested
AI-assisted (Claude Code). |
|
Independent build + test: tests PASS, but there's a regression for slots at or past the PC table end (BUG) AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo, NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124. Head
Bug:
The mock doesn't catch this because its real table has 128 non-null entries. To show it, I temporarily set Suggested fix: keep only the Smaller notes:
|
… keep their route Reported in ProjectLeonida#7923 review: the forward guard read the PC vtable entry for every slot, so a slot the PC device does not have (Xbox WaitFrameEventX at 80, or anything past slot_count) got E_NOINTERFACE where the routes and the beyond-table refusal used to answer. The pointer-shape check now runs before the routes and the entry check only once the slot is inside slot_count.
|
Good catch, that was real. Pushed a fix in 55c042f. The guard was reading the PC vtable entry for every slot, so a slot the PC device does not have answered Red before, green after, with the new case in section 11 of the test: The One thing I could not check locally: |
|
Tested Built No game files. AI-assisted (Claude Code). |
|
Tested
AI-assisted. |
Claimed in the coordination issue as: #7804 (comment) (first posted before the tracker moved: #7694 (comment))
What and why
A device thunk that forwards trusts the pointer it was handed. Slots past the 23 measured ones are refused and the tail read is guarded, but nothing checked that
selfis the device proxy at all: the generic thunk readsself->slot_countandself->real_vtableout of whatever it got and tail-jumps intoreal_vtable[slot]. Called on the PC device, on another of our proxies, on a pointer into the middle of a proxy, or on a foreign COM object, that reads a PC vtable out of memory that is not one and jumps to whatever the words there say.Not theoretical on this machine: a
--runboot stopped inside slot 26's thunk, at an address that is not code, with nothing named in the log.The forward path now looks at the pointer before dereferencing anything:
device_forward_blocker(self, slot)says why a forward cannot be made, or null when it can: null pointer, unreadable pointer, first word is not this proxy's own table, no PC device or PC table behind it, slot past the table, unreadable PC vtable, null PC method.refuse_bad_forwardlogs one line naming the slot, the reason and the two pointers (once per slot, its own flag array so it cannot hide the existing beyond line) and returnsE_NOINTERFACE, the same code the tail guard gives for a wrong object.Nothing is forwarded, no hit is counted and no PC method runs. The check sits before
note_slot, so a refused call cannot even look like traffic. Honest calls on the proxy are untouched:QueryInterface,AddRefandReleasestill come from the proxy's own slots and a real forward still reaches the PC device.Tested
Linux, clang-cl against the xwin SDK, run through my Proton prefix, CPU only, main
dde82f27eplus this commit.d3d12_xs_device.cppwith the new case:xs_proxy_mock_testdies in slot 26 (exit 5, no report line). The case hands the forward an object whose words read as a proxy with 64 slots and a table full of values that are not addresses, then a mock of another kind, null, a queue proxy and a pointer 8 bytes into a real proxy. Each must returnE_NOINTERFACEwith the mock's slot 26 untouched.xs_proxy_mock_test: PASS (9 allocations refused on purpose), and the five setup-failure variants still pass (--fail-virtualalloc,--fail-virtualprotect,--fail-veh,--env-slots,--env-slots-invalid). The case also checks the proxy still forwards afterwards and that the refusals did not move the hit counters./W4 /permissive-inxs_proxy_mock_test.device_proxy_testandroot_sig_testdo not start on this box: the Proton prefix has no vkd3d-proton, so wine exits 53 before the first line, and the same happens with the exes built from main. The mock test is the one covering this path here.Overlap
forward_deviceand the end ofcheck_tailare busy right now, so I checked instead of guessing. Ten open PRs editruntime/shims/d3d12_xs_device.cpp(#7639, #7642, #7653, #7679, #7685, #7759, #7821, #7880, #7949, #7969) and none of them looks atselfitself, they all stop atSlot >= self->slot_countbounds and per-slot refusals, so this check is new. I rangit merge-treeof this branch against each of those ten plus #6964, #7125, #7187, #7201, #7490 and #7503: all sixteen merge clean, and the branch is on current main (dde82f27e). Earlier in the day some of them conflicted, that cleared as their heads moved.This is a refusal, not a slot mapping, so it should not change anyone's answers. If anything still lands on top of it I will rebase.
Checklist
docs/design.md, with how it was confirmed. (no translator rule changed; this is a refusal inside the existing forward)[rt] d3d12_xs:lines)AI-assisted (Tacit).