Repository navigation
Point LLVM_PROFILE_FILE at /dev/null on the per-test coverage lanes - #129684
Conversation
On the per-test coverage lanes every process of the coverage binary merged its counters at exit into a merge-pool file shared by the whole job (`%2m` for stateless clients and the job env, `%4m` for integration containers and host clients), without continuous mode. The exit-time merge maps the pool file, merges it, truncates it and rewrites it from offset 0. A process SIGKILLed during that rewrite (02435's `thread_cancel`, the runner's process-group kill on a timeout) can leave the value-profile records cut inside a record. Every later process whose pool slot (`getpid() % N`) is that file then reads past the mapping in `lprofMergeValueProfData` and dies with SIGSEGV after its output, and the file stays poisoned. NightlyCoverage `Stateless tests (amd_llvm_coverage_per_test, per_test_coverage, 2/8)` on 358b830 lost 251 results this way: all 392 crashing client PIDs were even (pool slot 0), and the 163 sequential tests, which use another pool file, all passed. Those lanes never merge a `.profraw`: per-test coverage is read inside the server from the static counter section and exported from `system.coverage_log`. So point `LLVM_PROFILE_FILE` at `/dev/null` there: no process opens, reads or merges a pool file any more. The other lanes keep their `%c` values, which never merge. Not `%p` (thousands of files, ClickHouse#97020), not `%c` again (the shared-mapping slowdown ClickHouse#118370 removed). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding on the first pass, 0 on the re-run after the title fix) plus my own review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261106-062800 |
|
cc @alexbakharew, could you review this and add the |
|
Workflow [PR], commit [71cfee3] Summary: ✅ AI ReviewSummaryReviewed #129684 at Missing context / blind spots
Final Verdict✅ Approve. No changes requested. |
c162649
Related: #118370
Related: #110716
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Stateless tests (amd_llvm_coverage_per_test, per_test_coverage, 2/8)on master358b8300lost 251 results: from02435_rollback_cancelled_querieson, client processes printed the right output and then died withreturn code: 139(SIGSEGV).On the per-test coverage lanes every process merges its counters at exit into a merge-pool file shared by the whole job (
%2m/%4mwithout continuous mode; #118370 dropped%cfor clients), rewriting the file in place. A process SIGKILLed during that rewrite (02435'sthread_cancel, the runner's kill on a timeout) can leave the value-profile records cut inside a record. Every later process mapped to that pool slot then crashes inlprofMergeValueProfDataat exit. In the job log all 392 crashing client PIDs are even (pool slot 0), and the 163 sequential tests, which use another pool file, all passed.These lanes never merge a
.profraw(their coverage comes fromsystem.coverage_log), so this PR setsLLVM_PROFILE_FILE=/dev/nullthere for theclickhouse-testclients, the job environment infunctional_tests.py(servers, job clients, coverage export), and the containers and host clients of per-test integration jobs. Other lanes keep their%cvalues.Validation with the CI binary of the failing run:
lprofMergeValueProfData).clickhouse-test --collect-per-test-coverageover tests that failed in CI with such pool files: the 11 parallel ones fail withreturn code: 139before, all 12 pass after;02435_rollback_cancelled_queriespasses and no profile file is written.test_materialized_view_restart_server: passes, noit-*.profraw, same per-module coverage.#110716 filters the
LLVM Profile Error: Invalid profile data to mergenoise of the same kill; with this change it cannot occur on this lane.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/129684]
Version info
26.11.1.1556-master(included in26.11and later)