Repository navigation
Do not run 05076_error_trace_file_offsets on Darwin - #119145
Conversation
The test asserts that frames inside the main binary reach system.errors.last_error_trace as file offsets, bounded above by max(address_end) from system.symbols. That storage form is ELF-only. StackTrace::resolveAddress is compiled under `#if defined(__ELF__) && !defined(OS_FREEBSD)`. The other arm returns AddressKind::Unsupported with the address unchanged, which StackTrace.h documents as "the platform keeps runtime addresses", so on Darwin resolveAddressForStorage stores a raw runtime address for every frame and none is ever converted to a file offset. collectSymbolsFromMachOImage in turn stores absolute addresses (n_value + slide) and extends each image's last symbol to that image's max_addr, and SymbolIndex::load() runs it for every loaded dyld image. max(address_end) is therefore a ceiling above every captured frame, which makes the second column unsatisfiable and leaves the first no longer measuring the offset form. The test printed `1 0` for that reason, 23 times out of 23 runs. Fast test (arm_darwin) had 23 failures and no passes across 23 distinct pull requests since ClickHouse#117449 added the test, which is every pull request that reached that arm. The assertion is left untouched on the arms whose platform implements the contract it checks. This is a different defect from the one ClickHouse#119136 fixes: unfiltered absolute Mach-O symbols would only raise a ceiling that is already above every frame, so filtering them would leave the output at `1 0`. Related: ClickHouse#119136 Related: ClickHouse#117449 Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding), plus my own cold read of
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20260910-045700 |
|
Workflow [PR], commit [734d678] Summary: ✅ AI ReviewSummaryThis PR adds a Findings
Tests
Final VerdictChanges requested: the Darwin exclusion needs to be applied consistently to the sibling |
| @@ -1,4 +1,8 @@ | |||
| #!/usr/bin/env bash | |||
| # Tags: no-darwin | |||
There was a problem hiding this comment.
system.errors is not the only surface using this storage path. ErrorLog.cpp:127-133 also serializes system.error_log.last_error_trace via StackTrace::resolveAddressForStorage, and 03172_error_log_table_not_empty.sh:60-70 still asserts the same max(address_end) file-offset bound there. On Darwin that query also becomes vacuous for the same reason you describe here: resolveAddress returns AddressKind::Unsupported, so every raw runtime address falls below the image-wide ceiling from system.symbols. This leaves the Darwin fast test green while the sibling system.error_log contract is no longer being checked. Please either apply the same Darwin split to that subcheck or rewrite it to assert only the Darwin behavior the product currently documents.
There was a problem hiding this comment.
Mechanism confirmed, remedy declined, with the measurement.
The bound is vacuous on Darwin for exactly the reason given: off ELF StackTrace::resolveAddress reports AddressKind::Unsupported and leaves the address unchanged, and the Mach-O collector stores n_value + slide for every dyld image, so max(address_end) sits above every captured frame. That is the same mechanism this PR tags out of 05076.
What does not follow is that the system.error_log contract stops being checked on Darwin. These parts of 03172 are platform independent and still run there:
:27-29and:41-43, the 111/222/333 propagation and re-propagation counts;:48,last_error_time/last_error_query_id/last_error_messagepopulated;:54,arrayCount(x -> x != '', arrayMap(x -> demangle(addressToSymbol(x)), last_error_trace)) > 10, which works on macOS becausefindSymbolapplies the address-to-offset conversion only under#if defined(__ELF__)and otherwise searches absolute addresses directly (src/Common/SymbolIndex.cpp:738-751).
The :64 subcheck also cannot hide a Darwin regression that :54 does not already catch: find() returns a symbol only when offset >= it->offset_begin && offset < it->offset_end (src/Common/SymbolIndex.cpp:679), and system.symbols.address_end is that offset_end (src/Storages/System/StorageSystemSymbols.cpp:119), so within one trace every frame :54 counts also satisfies the BETWEEN clause. Zeroed, shifted, or offset-form addresses redden :54 first.
So both suggested remedies cost coverage:
# Tags: no-darwinon03172deletes the checks listed above. Over the last 14h03172is81 OK / 0 FAILonFast test (arm_darwin)across 80 distinct pull requests, and has no failure on any other check.- Rewriting
:60-70to the Darwin behaviour drops the offset bound on every ELF arm, where it is the contract being tested (301 OK / 0 FAILon LinuxFast test, 173 pull requests).
I am leaving 03172 alone and not changing this PR. The one point I do take: the comment at 03172:60-62 states the ELF mechanism without qualifying it by platform. That is text only, so it is not worth a push against a green test on its own.
a77884d
Bring in the upstream Darwin exclusion for the file-offset check. The assertion depends on ELF executable offsets and reads a mutable, server-wide `system.errors` row, so retain both `no-darwin` and `no-parallel` when resolving the test header. Keep the trace lifecycle changes while taking the upstream `TCPHandler` query-kind initialization and settings-masking corrections. The test's executable commands and reference assertions remain intact. ClickHouse#119145 ClickHouse#118415 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118415&sha=02075ae13fe4fa5baff34b23af02d084e6232eec&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29 Co-Authored-By: Codex CLI <[email protected]>
…sets no-darwin)
…sets no-darwin)
…k-5dc0 Picks up #119145, which tags 05076_error_trace_file_offsets as no-darwin - that test is what the Fast test (arm_darwin) failure on this PR was, and it fails on master too. Co-authored-by: Yakov Olkhovskiy <[email protected]>
…he release binary as PIE" This reverts the changes merged in 30c0912 (pull request ClickHouse#117449). The test it added, `05076_error_trace_file_offsets`, has never passed on two configurations and is red on `master` and on every pull request opened since it merged on 2026-09-09: Fast test (arm_darwin) 0 ok / 130 fail Stateless tests (amd_release, parallel, 1/2) 0 ok / 31 fail Stateless tests (arm_release, parallel) 30 ok / 0 fail every other configuration ~2500 ok / 0 fail Both failing configurations produce the same diff: the second column drops from 1 to 0, so no captured frame lies outside the main executable. The `amd_release` runner reproduced it 48 out of 48 times with the randomized settings and 49 out of 49 without them, so it is deterministic rather than flaky, and `arm_release` passes at the same times, so it is not a scheduling artifact. It merged green because neither failing configuration ran the test on the original pull request - `Fast test (arm_darwin)` and the `amd_release` stateless jobs are absent from its results. The Darwin half was since addressed on `master` by 734d678 (pull request ClickHouse#119145), which tags the test `no-darwin`. That tag cannot help `amd_release`, which is still failing on `master` as of 2026-09-10 15:13 - including on a77884d, the very commit that merged the tag. Reverting removes the test altogether, so that tag goes with it. The feature is worth having; it should return with the test guarded for the configurations whose premise it does not match, and with both jobs above exercised before it merges. Related: ClickHouse#117449 Related: ClickHouse#119145
… build the release binary as PIE"" This reverts 34421af (pull request ClickHouse#119279), restoring pull request ClickHouse#117449. ClickHouse#119279 reverted the change to get `master` green: the test it added, `05076_error_trace_file_offsets`, was failing on every release run. The Darwin half had already been fixed on `master` by 734d678 (pull request ClickHouse#119145), whose `no-darwin` tag comes back with this re-land, but `amd_release` was still failing and remains undiagnosed. Do not merge this before that is fixed - it re-introduces a known red job. What is known about the remaining failure: - Only `Stateless tests (amd_release, parallel, 1/2)` fails. `arm_release` passes at the same times, and so does every other configuration. - It is deterministic, not flaky: 48 of 48 runs with the randomized settings and 49 of 49 without them. - It is the second column that fails, dropping from 1 to 0: no captured frame lies outside the main executable, so either every frame is being stored as a file offset, or `max(address_end)` from `system.symbols` is above all of them. - Both release builds are configured identically apart from the toolchain file, and both set `ENABLE_THINLTO=1`. Before this change PIE was gated on `NOT ENABLE_THINLTO`, so the release builds are exactly the ones whose PIE status it flips - and only the amd64 one fails. The difference is therefore in architecture-specific link or runtime behaviour, not in the CMake configuration. Related: ClickHouse#117449 Related: ClickHouse#119145 Related: ClickHouse#119279
Related: #119136
Related: #117449
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
05076_error_trace_file_offsetsno longer runs on Darwin, where the storage form it asserts is not implemented.Description
05076_error_trace_file_offsetshas not passed once onFast test (arm_darwin)since #117449 merged it: CIDB has 24 FAIL and 0 OK across 24 distinct PRs, almost all bystanders, and it prints1 0instead of1 1. Report forac5f2596d6e8d3391a1c8f973713ac706b68d2ae: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=111423&sha=ac5f2596d6e8d3391a1c8f973713ac706b68d2ae&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29The test asserts a storage form that Darwin documents itself as not implementing.
StackTrace::resolveAddressis compiled#if defined(__ELF__) && !defined(OS_FREEBSD); elsewhere it returnsAddressKind::Unsupportedwith the address unchanged, whichStackTrace.hdescribes as "the platform keeps runtime addresses". So no frame reacheslast_error_traceas a file offset there.collectSymbolsFromMachOImagemeanwhile stores absolute addresses (n_value + slide) and extends each image's last symbol to that image'smax_addr, for every loaded dyld image, somax(address_end) FROM system.symbolsis a ceiling above every captured frame: the second column can never hold, and the first stops measuring the offset form. Neither ThinLTO nor dyld layout is involved, which is why #119136 (the ELF half of this,SHN_ABSsymbols inflating the same bound onamd_release) does not repair this arm.Tagging is therefore the fix, and the assertion is untouched on the 20+ arms where the contract holds (
Fast testis 84 OK / 0 FAIL over 53 PRs). Since there is no macOS host to iterate on, this PR's ownFast test (arm_darwin)run is the verification, and it lands before merge; locally the runner'sshould_skip_testwas exercised over both platform arms and both versions of the file, and the test passes 50/50 on Linux.Two residuals I am not changing:
03172_error_log_table_not_emptyshares the bound but only in the in-range shape, so a high ceiling satisfies it weakly rather than falsely; and on macOS a stored trace is not portable across restarts as it is on ELF. Whether Darwin should implement file offsets is an owner-level design question, not attempted here.Workflow [PR]
Sync PR [sync-upstream/pr/119145]
Version info
26.9.1.1117(included in26.9and later)