upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/loader_test.cpp
diff options
context:
space:
mode:
authorTyrannys <80750971+Tyrannys@users.noreply.github.com>2026-11-27 19:36:14 -0600
committerTyrannys <80750971+Tyrannys@users.noreply.github.com>2026-11-27 19:36:14 -0600
commitb04fdc91c0564b19112bdc671a7f71e45e65fd32 (patch)
tree7db30ed9cc6cde5234b7eba984204531859fd583 /runtime/test/loader_test.cpp
parent431ceba4f4a55c69c26fcf0e36fd83e86e1b9a32 (diff)
com_shim: nested CoUninitialize gives its host reference back; check TlsSetValue
Every nested co_initialize_ex() takes a host COM reference (host_inits_owned), but co_uninitialize() gave them all back only at the outermost CoUninitialize. A thread with an outer init that runs balanced inner init/uninit pairs piled up one host reference per pair until the outer balance (kevincommits' Finding 19 in #1608, item 1). A nested CoUninitialize now gives back its own reference. The first init's reference still stays until the guest balances, so host-first teardown keeps working. The first init also ignored TlsSetValue's result. When it fails, the state is not tracked and no CoUninitialize would ever give the host reference back, so the init now undoes it and fails with the error. com_shim_test gains a case: 100 balanced nested pairs under an outer init must leave exactly one host reference. It fails on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/loader_test.cpp')
0 files changed, 0 insertions, 0 deletions