Tests: 16 tests abort when TEMP has a character outside the ANSI code page (host std::tmpfile returns NULL) #13083
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by bunbeans2-arch on 2026-10-30T00:44:37Z.
What happens
16 C++ tests abort on Windows when
%TEMP%contains a character outside the ANSI code page, as it does for a profile likeC:\Users\Жаннаon a code page 1252 system. Each of them gets a scratch stream from the hoststd::tmpfile(). UCRT builds that file underGetTempPathA, which turns the character into?. Sotmpfile()returnsNULLwitherrno22, and the test aborts withFileStream: null handleorcannot open a temporary file for stderr.A path with spaces alone, or with a character inside the code page (
é), is fine. These are test-only failures as far as I can see: no non-test.cppundercore/libs/prxcallstmpfile, and the runtime temporary paths I read (Jit.cpp,SharedMemory.cpp) go throughtemp_directory_pathandCreateFileW.Title, test or build step
guest_binary_word,guest_stream_purge,file_position,guest_wide_stream_scan,guest_stdio_variadic,guest_standard_streams,guest_gets,file_stream_status,file_streams,guest_syslog,guest_err,guest_getopt,np_trophy2_store,guest_np_trophy_stats,guest_raise_in_host_code,guest_filesystemAnyPS5 commit
2960e9a6e7, where 74std::tmpfile()calls sit in 28 test files undercore.GuestBinaryWord.cppandTrophyStore.cppstill call it onmain76fd1c09e9.System
Windows 11 Pro 10.0.22631, ANSI code page 1252, MSYS2 UCRT64 GCC 16.1.0, Release,
BUILD_TESTING=ON, Python 3.13.Steps to reproduce
From Git Bash, with any existing directory whose name has a character outside the code page:
The same tests pass with
TEMP=C:\x\sp aceand withTEMP=C:\x\e_é.Log
A small probe built with the same toolchain (
std::tmpfile(), thenGetTempPathA):What was checked
TEMP=TMP=<dir>\tmp Жé: all 16 tests fail in 3 of 3 runs. They pass with the normalTEMP, withTEMP=<dir>\sp aceand withTEMP=<dir>\e_é.std::tmpfile(). A shared test helper that opens a scratch file understd::filesystem::temp_directory_path()with_wfopenon Windows would cover them. I have not written or run that fix.tëmp) throughfopen(path.string())andgetenv. Underéthose tests fail here too, and these 16 do not.Ж, not part of this issue: the Python tool tests that runcmake,gccorobjdumpon files underTEMP(check_compile_*,select_tests*,configure_seed*,annotate_module) fail at that step.asandobjdumpreport the path with?(can't create ...\zh_?\...\unit.o), so these look like a MinGW toolchain limit.pad_timelineandpr_overlap_export_cachefail withétoo on Python 3.13. Their logs show the UTF-8 path decoded as cp1252 (Ж).agc_*GPU tests under thisTEMP(several also callstd::tmpfile()), Linux and macOS.IST-5:30andNZST-12NZDT,LANG=LC_ALL=de_DE.UTF-8, andUSERPROFILE=HOME=<dir>\home dircaused no new failures in the same suite.AI-assisted: yes (Claude Code)