test(libc): match the crash thread name check against the thread name lines only #15578
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15578"
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 dantdmdarealguy on 2026-11-03T19:53:19Z.
What
On
main1e658521a0,windows_crash_thread_namefails in a Windows Debug build, though the crash report it checks is correct. The test names the main thread'a'×126 + 'Z' + 'b'×70and a worker'c'×126 + 'Y' + 'd'×70, then faults. ItsFAIL_REGULAR_EXPRESSION "Zb|Yd|did not fault"(core/libs/CMakeLists.txt:708) is meant to catch a thread name the report prints past the 127 bytes it keeps (#14406). It also matches the crash report's register text dump, and in a Debug buildrbxstill points at the description string:The failure check now only looks at the name the report prints after
thread <id> ':thread [0-9]+ 'a+Z[^']|thread [0-9]+ 'c+Y[^']|did not fault. The test still fails if anything other than the closing quote followsZorY: an unterminated buffer, a name that isn't truncated, or stray bytes. A name cut short beforeZ/Ystill fails the unchangedPASS_REGULAR_EXPRESSION. The check is tied to the test's own names because other threads in the process carry their own descriptions (on this machine an injectedWindhawkMainLoopThreadAttachExemptthread shows up in the all-threads list). Only the test registration changes; libc is untouched.Tested
Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0. The Debug build has #15398 cherry-picked so that it links; it is not part of this PR.
ctest -R '^windows_crash_thread_name$' -V:mainfails 3/3 (Error regular expression found in output. Regex=[Zb|Yd|did not fault]); with this change it passes 5/5.mainpasses 3/3; with this change it passes 5/5.CrashReport.cppis deliberately broken:sizeof(buf)again): Debug prints'a…Zb'/'c…Yd', Release prints'a…Zb<garbage>'. Both fail on the new FAIL regex.'a…Zb…'): fails on the FAIL regex.'c…Yd…'): fails on the FAIL regex.'a…'): fails onRequired regular expression not found.ctest --output-on-failure --timeout 120 --parallel 2 -R "windows_crash_thread_name|patched_libraries": 2/2 pass.cmake --build buildand--target libssucceed.tools/check_test_registration.py buildandtools/check_conventions.py --base origin/mainpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-04T16:52:51Z.
Review: APPROVED
Head
3b64a02fcbmerged onto currentmainb11c7bf84f(clean merge, local only), on a second machine wheremainfails this test in a Release build. Here the trigger isrdiandr13rather thanrbx.Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (
x86_64-ucrt-posix-seh, r3), Release,BUILD_TESTING=ON.ctest -R '^windows_crash_thread_name$', 3 runs each:mainError regular expression found in output. Regex=[Zb|Yd|did not fault]sizeof(threadName)andsizeof(name)instead of- 1inCrashReport.cpp)FAIL_REGULAR_EXPRESSIONmatcheson thread … 'a…aZb'On
mainthe names are cut where the test expects. The faulting thread prints'a…aZ'and the list printsthread … 'c…cY':, but at the faultrdiandr13still point at the worker's description, so the register dump prints[rdi] u"c…cYdddd…"and[r13] u"c…cYdddd…", andYdmatches there. The new pattern needsthread <id> 'before the name, and the dump lines start with[reg] u", so they no longer match. The control above shows that an unterminated name is still caught.check_conventions.py --base mainpasses on the merge. I found nothing to change.AI-assisted: yes (Claude Code)