A failed rollback leaves a mix of old and new files
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Bereich
- desktop-dev
Rechercherichtung
Start in Rollback in clean/installer/src/wg_core/launcher.cpp, around lines 615-654, where files are copied into .swap, overwritten one at a time by CopyChecked, and the record is saved last. Check how RunOp turns the exception into an error result, and how the retry path clears .swap with RemoveTree near line 629. The new test is the one in tests/run_launcher_tests.py, which needs a file held open with FILE_SHARE_READ only. Done means a failed rollback restores the first live file's current bytes and leaves .swap in place when the undo itself fails.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
This was found by reading the code. It has not been reproduced.
What happens
Rollback (clean/installer/src/wg_core/launcher.cpp:615) copies the current files into .swap. It then overwrites the live files one at a time with CopyChecked (launcher.cpp:636-643). There is no catch and no undo. The record is saved only at the end (launcher.cpp:654). RunOp turns an exception into an error result. A retry runs RemoveTree(swap) first (launcher.cpp:629) and rebuilds .swap from the now-mixed live files.
If the loop fails halfway, the live files are a mix of two versions. The folder the player would use to roll back again (the new previous\, built from .swap) is mixed too.
No player file is lost. previous\ is untouched and verified, so a retry finishes the rollback. The record's hashes no longer match the live files, so the verify step suggests a repair (launcher.cpp:930). Repair or Update recovers.
When it can happen
Unusual but innocent. The game running is already blocked (launcher.cpp:618). What remains is another program holding a payload DLL without write sharing, a full disk, or a crash during the copy loop. Until the player retries or repairs, the game may fail to start or crash with mixed DLLs. Low severity.
To do
- Wrap the copy loop in try/catch. On failure, copy back the files already replaced from
.swap(the hashes are in itsprevious.txt) before rethrowing. - Do not delete
.swapon a later run while the record's version still differs from what.swap\previous.txtnames. - Caution: the undo can fail on the same lock. It should then leave
.swapin place and say so.
Test
CPU-only. Fake install with previous\ holding two payload files whose bytes differ. Hold the second live file open with FILE_SHARE_READ only. Run Rollback. Assert it fails and the first live file has its current bytes again. The existing test (tests/run_launcher_tests.py:371-401) uses identical payloads, so it cannot catch this.
- Vorherrschende Sprache
- C++
- Sterne
- 12
- Forks
- 2
- Ø Merge
- 3 Std. 10 Min.
- Gemergte PRs (30 T.)
- 171
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus phantoslayer21/wronggpu
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
phantoslayer21/wronggpu#275 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
phantoslayer21/wronggpu#274 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
phantoslayer21/wronggpu#241 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug build
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
phantoslayer21/wronggpu#234 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug build
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
phantoslayer21/wronggpu#233 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in phantoslayer21/wronggpu
Ähnliche Issues
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
ReyeMe/SaturnRingLib#155 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Nheko-Reborn/nheko#2092 ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
isocpp/CppCoreGuidelines#2345 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 71/100
ROCm/rocm-libraries#16108 ·
Maintainer antworten meist innerhalb von 2 Tagen