TLS: images with AddressOfIndex = 0 #183
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!183
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/183/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?
@tshadofr on GitHub · 2026-11-23 19:31 UTC · original
tshadofr:fix/tls-no-index-variable→main· +22 −3 · 2 files · 1 commits · merged 2026-11-23 21:08 UTCFrom the TLS list in #106: a TLS directory with
AddressOfIndex = 0(callbacks only, or a template nothing indexes through_tls_index) went throughadj(0), sotls::installwrote the slot number to0 + delta, andtake_slot_zerowrote 0 there again for the executable.The loader now passes a null index pointer for those, and both writes are skipped when it is null. The slot is still allocated and filled, so the callbacks and
/GAslot-0 code see the same block as before.Tested:
cargo test -p xcl --lib tls(newinstall_without_an_index_variable) and the e2e tests pass on an RTX 2060 SUPER. Not run against a game.@Kalmarv on GitHub · 2026-11-23 20:50 UTC · original
Linux / Wine / GNU run of
c69c4d10(merge-base956a476, the currentmain). Ubuntu 24.04, XCL cross-built forx86_64-pc-windows-gnu(mingw-w64 13, release, so no overflow checks), run under Wine 11.21 Staging (Kron4ek wow64 build). The control is this PR's head with only the production hunks reverse-applied, so the new tests stay in.tlsfilter (6 tests incl.pe::tests::parses_own_test_binary_tls, 1 ignored):install_without_an_index_variablelogsunit-noidx: template 16 B, block 4096 B, index 3, threads initialized: 2loader.rsandtls.rsproduction hunks reverted)wine: Unhandled page fault on write access to 0000000000000000, the write through the null index pointer this PR guardsSo the carrier-DLL TLS path,
fill_existing_threadsand the null-index case behave under Wine's loader the way the PR describes for Windows. I read the diff: both writes are guarded, and the slot is still allocated and filled. No findings.Not covered: the
take_slot_zeropath with a null index (no test reaches it); an executable withoutAddressOfIndexloaded end to end; any title.@ivall on GitHub · 2026-11-23 21:09 UTC · original
Merged (main
6da33fa). Checked on an RX 9070 (RDNA4) with the 22 PRs merged together on maineaa36b6:cargo build --workspace && cargo test --workspace -- --test-threads=4- 582 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed too; and the retail game still reaches its first menu (646 frames in 30 s, no device removal).