Skip to content

fix(coverage): use atomic counters for worker threads - #219

Merged
Zxilly merged 1 commit into
masterfrom
codex/qemu-coverage
Sep 27, 2026
Merged

Zxilly merged 1 commit into
masterfrom
codex/qemu-coverage

Conversation

@Zxilly

@Zxilly Zxilly commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

OpenWrt QEMU coverage intermittently fails with negative counts in proxy.c when worker threads update shared gcov counters. Compile coverage builds with -fprofile-update=atomic and keep lcov negative-count validation enabled.

Validation: GCC 14.2 passes all 123 existing tests and real REDIRECT/TPROXY netns integration; Clang 20 accepts the flag. In 100 real worker startup/shutdown cycles plus netns tests, both builds recorded 1,604 worker entries. The original build recorded only 3,207 listener calls (expected 3,208); the atomic build recorded all 3,208 and passed lcov. This local run demonstrated lost counts without reproducing the negative-count error itself.

Historical QEMU runs 34099489032 and 32688567132 show the same negative-count failure before the dependency update. Both OpenWrt 24.10.8 and 25.12.5 QEMU jobs now pass, including strict lcov generation and coverage upload.

@Zxilly
Zxilly merged commit 4fc1c47 into master Sep 27, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant