A failed rollback leaves a mix of old and new files
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- desktop-dev
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C++
- Estrellas
- 12
- Forks
- 2
- Merge medio
- 3 h 10 min
- PR fusionados (30 d)
- 171
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de phantoslayer21/wronggpu
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
phantoslayer21/wronggpu#275 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
phantoslayer21/wronggpu#274 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
phantoslayer21/wronggpu#241 ·
Los mantenedores suelen responder en 1 día
-
bug build
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
phantoslayer21/wronggpu#234 ·
Los mantenedores suelen responder en 1 día
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildAbiertobug build
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
phantoslayer21/wronggpu#233 ·
Los mantenedores suelen responder en 1 día
Todos los issues de phantoslayer21/wronggpu
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
ReyeMe/SaturnRingLib#155 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Nheko-Reborn/nheko#2092 ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
isocpp/CppCoreGuidelines#2345 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 71/100
ROCm/rocm-libraries#16108 ·
Los mantenedores suelen responder en 2 días