Skip to content

file_system: T: is a folder of each process's own in the overlay, so the title's crash files land - #8161

Open
aslan2142 wants to merge 1 commit into
ItsNotRexed:mainfrom
aslan2142:t-drive-overlay
Open

aslan2142 wants to merge 1 commit into
ItsNotRexed:mainfrom
aslan2142:t-drive-overlay

Conversation

@aslan2142

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #7913 (comment) (from Spacecer2's finding: #7913 (comment)).

Depends on: none. It builds on main. Two open pull requests overlap:

Why T: failed

Spacecer2 found that the title's crash dump (T:\<guid>.dmp) and crash log (T:\game-<stamp>-32.crash.log) fail with ERROR_FILE_EXISTS (80). They put that down to Wine mapping T: to the host root. On main, though, the runtime maps T: itself (RT-218), not Wine:

  • Every Win32 file call the title makes on T:\... goes to one folder, <overlay>\.gta6rt-temp.
  • Every run shares that folder, and it is kept between runs.
  • 80 is what CREATE_NEW returns for a name that already exists there, whether an earlier run or a second process left it.
  • The new tests get exactly 80 on main, both in the test process and in a second process.
  • Wine's own T: is reached only by a call the shims don't cover, such as a dynamic CRT fopen (Runtime: GAME: paths through the Universal CRT's opens (RT-354) #4996 is open for those). A default prefix has no t: drive at all.

I could not check which call or which names the title's crash path uses, because that needs the game.

What changes

  • T:\ now names <overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>. That is the process's start time in UTC and its id. The folder is made on the first T: call and stays the same for the whole process.
  • The start time keeps a reused process id out of an old run's folder. Wine hands each fresh prefix the same small ids.
  • T:\.. cannot climb into the shared folder, and T:\ still cannot be removed or moved.
  • Folders from earlier runs are kept, so their crash files can still be read. They are deleted by hand.
  • GAME: and G: are unchanged.
  • rt::fs::scratch_dir() returns the folder. The startup line names it: console paths: GAME: -> ..., writes -> ..., T: -> ....
  • The two CMake checks of that line (run_tiny_game_console_paths, run_tiny_game_dir) and tests/test_console_paths.py now expect the T: part.
  • docs/boot.md (the --overlay entry) and docs/runtime_imports.md describe the folder.

Tested

All on Linux under Wine 11.22 (Staging). Everything is built with clang for the mingw target, not MSVC.

  • file_system_test, with new checks:
    • a CREATE_NEW of a name that earlier runs left in .gta6rt-temp (and in an older process's folder) succeeds and lands in this process's folder;
    • the folder name has the expected form and stays the same for the process;
    • a second process (the test starting itself again) on the same overlay creates the same name in a folder of its own;
    • GAME: reads and writes are unchanged.
  • Results:
  • gta6rt with the tiny_game fixture (not the retail game): check_console_paths.cmake and check_game_dir.cmake pass. The startup line reads T: -> ...\overlay-保存\.gta6rt-temp\20261123-180545-395-pid32.
  • python -I tests/test_console_paths.py and scripts/check_no_game_data.py on the changed files pass, and git diff --check is clean.
  • No GPU involved; these are CPU-only file system tests.

Not tested:

  • On Windows itself, or with the MSVC /W4 /permissive- build. CI covers those.
  • With a real boot of the game. The crash-file measurement and error 80 are Spacecer2's. Whether the title's crash files now land needs a run with the game, which I did not do.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)

AI-assisted (Claude Code, Claude Opus 5.5).

T:\ mapped to <overlay>\.gta6rt-temp, one folder shared by every run and
kept between runs. The title makes its crash dump and crash log there
with CREATE_NEW, and a name an earlier run (or a second process) had
left failed with ERROR_FILE_EXISTS (80), so no report landed (ItsNotRexed#7913,
measured by Spacecer2 under Wine 11.22).

T:\ now names <overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>, the
process's start time in UTC and its id, made on the first T: call. The
start time keeps a reused process id (Wine hands each fresh prefix the
same small ids) out of an old run's folder. T:\.. cannot climb into the
shared folder, T:\ itself still cannot be removed or moved, and earlier
runs' folders are kept so their crash files can be read. GAME: and G:
are unchanged.

rt::fs::scratch_dir() returns the folder, and the startup line names it:
"console paths: GAME: -> ..., writes -> ..., T: -> ...". The two CMake
checks of that line (run_tiny_game_console_paths, run_tiny_game_dir)
and the synthetic test of the first now expect the T: part.

file_system_test: a CREATE_NEW of a name earlier runs left in
.gta6rt-temp succeeds and lands in the process's own folder; the folder
is stable for the process; a second process (the test started again)
creating the same name on the same overlay succeeds in a folder of its
own; GAME: reads and writes are unchanged. On main these fail with
ERROR_FILE_EXISTS (80), in this process and in the second one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Xiiano Xiiano left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot SDK:
I found one correctness issue:

scratch_run() uses PID plus a millisecond-truncated start time, which is not guaranteed unique. Rapid PID reuse can reuse a retained folder and reproduce ERROR_FILE_EXISTS. The folder should be atomically reserved or otherwise guaranteed unique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants