RR silently not used when the game interface is already loaded (delay-load imports)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- game-dev, operating-systems
Direzione di ricerca
Start in clean/rr_f/proxy/src/hook_dll.cpp at the delay-import lookup inside if (!g_interposer) (around lines 1050-1065), then the module loop and if (delay) patch block (around lines 1105-1120). Read the test header clean/rr_f/proxy/tests/test_hook_dll.cpp to see the WG_TEST_DELAYLOAD setup. Done means the RR delay slots point into the plugin when the interface is already loaded, the host route is requested when nothing was patched, and the test passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This was found by reading the code. It has not been reproduced.
What happens
In do_hook (clean/rr_f/proxy/src/hook_dll.cpp), the delay-import descriptor is looked up only inside if (!g_interposer) (hook_dll.cpp:1050-1053). If GetModuleHandleW already finds the interface module, delay stays null. The log then says "already loaded via import table" (hook_dll.cpp:1065), even when the exe imports it by delay-load or another module loaded it first.
The module loop patches ordinary import tables only (hook_dll.cpp:1105-1115). The only delay-IAT patch is under if (delay) (hook_dll.cpp:1116-1120). g_wait_for_host is set only when the interface is absent and not linked (hook_dll.cpp:1057), so the request for the host's route (hook_dll.cpp:1346) is not made either.
Result: the exe's delay-load slots for the interface are never patched, no host route is requested, and the game's RR calls go to the original interface. RR is silently not used. The log is misleading. There is no crash.
When it can happen
A game that delay-imports the interface, where the delay load has already fired before InitializeASI (the host loads the plugin after the game has started), or where another module (host, overlay) loaded the interface first. This timing is ordinary, not exotic. The test header (clean/rr_f/proxy/tests/test_hook_dll.cpp) covers only the "not loaded yet" branch and says the host loads the plugin after the interface is already loaded for static importers. What is lost: the RR feature on affected delay-load games, with no visible error. Medium severity.
To do
- Always compute
delay = find_delay_import(GetModuleHandleW(nullptr), kWgInterposerFile). If present, callpatch_module_delay_importswhether or not the module was already loaded. - Keep "we loaded it ourselves" as a separate bool for the
adopt_unseen_initdecision (hook_dll.cpp:1088-1095). If the interface was already loaded, init may have run, so adopt. - If the total patched count is 0, set
g_wait_for_hostso the host route is still requested. - Fix the log line so it does not claim an import-table load when it was not.
- Caution: patching an already-resolved delay slot is fine, the same as an IAT slot. Do not leave the adopt decision keyed on
delay, or an already-initialised interface would be treated as fresh.
Test
CPU-only. In test_hook_dll, built with WG_TEST_DELAYLOAD: call one non-RR interface export (forcing the delay load), or LoadLibrary the interface before loading the plugin. Assert the RR delay slots now point into the plugin and the RR path reaches the fake runtime. A run in a real delay-load game would confirm it (see #36 for testing in a game).
- Lingua principale
- C++
- Stelle
- 12
- Fork
- 2
- Merge medio
- 3h 10m
- PR unite (30g)
- 171
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di phantoslayer21/wronggpu
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
phantoslayer21/wronggpu#275 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
phantoslayer21/wronggpu#274 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
phantoslayer21/wronggpu#241 ·
I maintainer di solito rispondono entro 1 giorno
-
bug build
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
phantoslayer21/wronggpu#234 ·
I maintainer di solito rispondono entro 1 giorno
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildApertabug build
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
phantoslayer21/wronggpu#233 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di phantoslayer21/wronggpu
Issue simili
-
ai_p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
ClickHouse/ClickHouse#132519 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
juce-framework/JUCE#1810 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
petercorke/robotics-toolbox-python#952 ·
I maintainer di solito rispondono entro 1 giorno
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusApertafunc:engine type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NatronGitHub/Natron#1276 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno