cpu: compare startup TLS values inside callbacks #426
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!426
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/426/head"
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?
@Jess-Doit on GitHub · 2026-11-22 01:36 UTC · original
Jess-Doit:cpu/startup-tls-observations→main· +146 −32 · 5 files · 1 commits · merged 2026-11-22 07:47 UTCChange
Refs #165. Extend the three-image startup fixture from #262 to record the TLS value and actual thread ID inside the dependency DLL's callback. Compare those events by thread role under the Windows loader and
pe_map.102and3The fixture preserves the startup log, exit codes, and dependency and worker failure controls.
Verification
Commit
824e47con Windows 10 22H2 build19045.6456, x64 MSVC19.44.35230.0, Windows SDK10.0.26100.0. Both builds passed all four selected CTest cases.For the negative control, I temporarily forced worker-detach observations to
0and rebuiltcpu_startup_a. The command below detected both wrong values. After restoring the source and rebuilding the DLL, it passed.Evidence and follow-up
The existing MIT-licensed, source-built startup fixtures use an explicit
TlsAllocslot and empty static TLS data templates. The EXE retains the worker handles through the trace snapshot so their IDs stay valid. The accompanyingdocs/experiments.mdupdate records the observation and reproduction command.Checklist
AI-assisted with Codex.
@R0Y00 on GitHub · 2026-11-22 03:16 UTC · original
@yummancito, would you be willing to take this review through the next revision if one is needed? Jess-Doit is extending the three-image startup fixture you contributed in #262. Could you check how the test matches TLS callbacks to the main thread and each worker across Windows and pe_map, especially whether swapping the two workers' detach values would be caught? Please leave your verdict here and, if you request changes, take another look after the author updates the PR. Thanks!
@Jess-Doit on GitHub · 2026-11-22 04:25 UTC · original
I ran the exact swap control at
824e47con Windows 10 22H2 build 19045.6456 with MSVC 19.44.35230. In a separate build of cpu_startup_a.dll, I exchanged only the reported TLS values 2 and 3 during DLL_THREAD_DETACH.I ran the original and swapped DLL three times each in Debug and Release under both Windows and pe_map. All 12 originals passed. All 12 swapped runs kept the startup log and exit code 0x0103020e, and check_tls rejected them on the callback comparison. Worker 1 reported 3 and worker 2 reported 2, with the attach values intact.
AI-assisted.