cpu: compare startup TLS values inside callbacks #420
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/426"
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 R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-22T01:36:05Z.
Change
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.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T03:16:10Z.
@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!
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-22T04:25:16Z.
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.