Repository navigation
Conversation
…, evidence for replan) The plan's fix: record, for each registered signal, the action its handler replaced, and give those back in reverse order in reset() instead of SIG_DFL. Measured during IMPL: for SIGSEGV/SIGBUS/SIGILL/SIGSYS the replaced action is Poco::SignalHandler (installed by the Poco::Util::Application constructor), which always aborts, so a teardown SIGSEGV becomes a silent SIGABRT (134) instead of a silent SIGSEGV (139), and the sanitizer handler is not restored. Kept only as evidence for the replan. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er build is reported Poco::Util::Application's constructor called Poco::SignalHandler::install(), which puts Poco's handler on SIGSEGV, SIGBUS, SIGILL and SIGSYS. That handler siglongjmps to a jump buffer registered by poco_throw_on_signal, or aborts; nothing in the tree registers one, so it only ever aborts. Installed at startup, it replaces the sanitizer runtime's own fault handler. With the previous commit, HandledSignals::reset() gives back the action each ClickHouse handler replaced. With Poco's install gone that action is the sanitizer's handler in sanitizer builds and SIG_DFL otherwise, so a fault after reset() (e.g. in the static destructors of clickhouse-local) prints a <Sanitizer>:DEADLYSIGNAL report with the stack instead of dying with exit code 139 and no output, which is what the Stress test (arm_msan) job of ClickHouse#131994 recorded. Release and debug builds still get SIG_DFL there. A fault before ClickHouse's handlers are installed, or in a tool that never installs them, now kills the process with its own signal instead of SIGABRT. The gtest now checks both halves: reset() restores sentinel handlers on all eight registered signals after a double registration, and an Application does not leave Poco's handler on the four fault signals. 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; 2 findings; bounded: 1 full pass + 1 fix round + 1 delta recheck).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261120-175400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20261120-165701 |
|
Workflow [PR], commit [12e70ba] Summary: ❌
AI ReviewSummaryReviewed PR #133286 at Missing context / blind spots
Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units27 translation units recompiled, 125 s compile time in total, 27 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.06 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
Algunenano
left a comment
There was a problem hiding this comment.
Please drop the test, we don't need it.
Also, let's also fix this: - 💡 emplace_back can throw after the handler is installed (SignalHandlers.cpp:353-357). The handler would then never be restored, and after reset(true) closes the pipe it could write to a closed or reused fd. Master has the same problem: it copies the signals into the list only after installing them all. The author rejected this point from codex as "same as master", which is true. A handled_signals.reserve(handled_signals.size() + signals.size()) before the loop would close it in one line.
…mment Per review: reserve `handled_signals` before the install loop, so a failed allocation cannot leave an installed handler that `reset()` never restores (before the pipe it writes to is closed). Remove the death tests and the comment about the Poco install that is no longer there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, done in 12e70ba:
|
CI finish ledger - 12e70baEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261124-220031 |
Related: #131994
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A fault while a ClickHouse program shuts down now produces the sanitizer's report with a stack trace in sanitizer builds, instead of a silent exit with code 139.
Description
In Stress test (arm_msan) on #131994, a
clickhouse localprobe oftests/config/install.shprinted its answer and then exited with code 139 and nothing on stderr: no ClickHouse fatal report, no MemorySanitizer report, so the fault cannot be attributed.Two places drop the sanitizer's fault handler. The
Poco::Util::Applicationconstructor installsPoco::SignalHandleron SIGSEGV, SIGBUS, SIGILL and SIGSYS, replacing it at startup; that handler can onlyabort(), since nothing in the tree registers its jump buffers. ThenHandledSignals::reset()(from~ClientApplicationBase,~BaseDaemon, ...) sets every handled signal toSIG_DFL, so a fault after it kills the process with no output.This PR removes the Poco install, and
reset()now restores, in reverse order of registration, the action each ClickHouse handler replaced;addSignalHandlerreserves the list before installing, so a failed allocation cannot leave an installed handler that is never restored. In sanitizer builds a teardown fault now prints<Sanitizer>:DEADLYSIGNALwith the stack, so such a fault in a sanitizer job becomes a red with a stack. In release builds the restored action isSIG_DFL, as before. A fault before ClickHouse's handlers are installed, or in a tool that never installs them, now kills the process with its own signal instead of SIGABRT.The fault itself is still unknown: 100,100 runs of the probes with the job's
THREAD_FUZZER_*environment on the PR's amd_msan binary passed. A second fault inside ClickHouse's own fault handler is not covered here; #132186 handles one whose stack capture faults.Validation: with a SIGSEGV injected at the final
exit_group(strace), an ASan build of master exits 139 with empty stderr, and with this PR printsERROR: AddressSanitizer: SEGVwith the stack and exits 134; a debug build exits 139 on both.Workflow [PR]
Sync PR [sync-upstream/pr/133286]