startup_stubs/inflate: fix fixed_block static-init data race #1481
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1488"
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 tedin7 on 2026-11-24T12:49:59Z.
Summary
x2w_inflate::fixed_block(src/startup_stubs/inflate.h). Previously,fixed_blockguarded non-atomicstatic Huffman lencode, distcodeinitialization with a non-atomicstatic bool ready = false, allowing concurrent callers to observeready == truebefore table construction finished or race on initialization.static const FixedTables tables = make_fixed_tables();initialization ([stmt.dcl]/4), keeping the hot path lock-free and immutable after construction.tests/startup_inflate_status.cppwith a multi-threadedfixed_lit_streamstress test (check_fixed_multithreaded) that synchronizes 8std::threads at a start barrier before invokinginflate_zlib_exconcurrently, verifyingInflateStatus::okand byte-exact output on every thread.Verification
g++ -std=c++17 -pthread -Wall -Wextra -Werror -I src tests/startup_inflate_status.cpp -o /tmp/startup_inflate_status && /tmp/startup_inflate_status-> exit 0g++ -std=c++17 -pthread -fsanitize=thread -O1 -g -Wall -Wextra -Werror -I src tests/startup_inflate_status.cpp -o /tmp/startup_inflate_status_tsan && /tmp/startup_inflate_status_tsan-> exit 0git diff --check-> cleanpython3 tests/docs_links_check.py-> passpython3 tests/bidi_controls_check.py-> passpython3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py preflight /root/wt/x2w-h-w3-inflate->VERDICT: OKAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:58:18Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
db7d106ddbf6af26b6c47e8895630129bef29710:--preset dev):ctest -R '^startup_inflate': 2/2 passed (startup_inflate_status0.01s,startup_inflate0.25s)/O2(--preset release):ctest -R '^startup_inflate': 2/2 passed (startup_inflate_status0.01s,startup_inflate0.22s)Linux:
g++ -std=c++17 -pthread -Wall -Wextra -Werrorclean, repeated runs pass,-fsanitize=threadclean;git diff --checkclean.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:58:29Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
db7d106ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.