Repository navigation
Do not print runtime addresses in fatal error reports - #126039
Algunenano merged 2 commits into
Conversation
Fatal error reports reach the client through `send_logs_level` and are stored in `system.text_log` and `system.crash_log`. Print addresses only as offsets inside a loaded object: - An address outside every loaded object (e.g. JIT code) is printed as `<unknown>` in the bare stack trace and without an address in the symbolized one. `StackTrace::resolveAddress` no longer returns it. - Before the symbol index is built (`clickhouse local`, or a fault at startup), addresses in the main executable are resolved from its own program headers instead of being printed as runtime addresses. - The fault address is shown below 4096 or as an offset inside a loaded object; `system.crash_log.fault_address` keeps only offsets inside the executable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [6a4f899] Summary: ✅
AI ReviewSummaryThe PR hides unknown stack frames and converts fatal-report fault addresses to object-relative offsets, including before the symbol index is initialized. The signal-sender leak from the previous review is fixed. One address-disclosure path remains on macOS and FreeBSD, and the new masking behavior lacks focused regression coverage. Numeric trace columns are explicitly deferred by the author and are outside this review's remaining findings. Findings❌ Blockers
Tests
Missing context / blind spots
Final VerdictStatus: ❌ Block. Hide runtime addresses on the remaining platform paths and add regression coverage for the masking policy. |
|
|
||
| if (!object) | ||
| return {virtual_addr, {}, StackTrace::AddressKind::UnknownMapping}; | ||
| return {nullptr, {}, StackTrace::AddressKind::UnknownMapping}; |
There was a problem hiding this comment.
[P1] Apply the hiding policy to the numeric crash trace
Returning a null address here does not protect system.crash_log.trace: collectCrashLog calls StackTrace::resolveAddressForStorage at src/Interpreters/CrashLog.cpp:127–128, and that helper still returns the original virtual_addr whenever the kind is not MainObject (src/Common/StackTrace.cpp:479–480). Consequently, ordinary libc frames and unknown/JIT frames still persist their runtime addresses in this column, even though trace_full and fault_address are sanitized. This leaves the crash report's numeric representation exposing the addresses the PR promises to hide.
Apply a safe representation when collecting the crash log, such as a sentinel for non-main frames or an object-qualified offset, and cover the numeric column in the regression test. The existing crash-log test explicitly permits non-main runtime addresses.
There was a problem hiding this comment.
🤖 Agreed. resolveAddressForStorage also feeds system.stack_trace, system.errors and system.error_log, so system.crash_log.trace will be fixed in a future PR for all the tables that store traces. The PR description now states that this PR covers the text of the report and system.crash_log.fault_address only.
For a fault, `si_pid` and `si_uid` overlap `si_addr`, so printing them as the sender published the fault address that is hidden in `Address:`. They are set only for signals sent by a process (`si_code <= 0`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ackTrace::tryResolveAddress` ClickHouse#126039 changed `StackTrace::tryResolveAddress` to return `ResolvedAddress` by value, with a null address for an address that does not resolve, while `formatStackTrace` in `gtest_functions_stress.cpp`, added in parallel, used it as an optional. `unit_tests_dbms` does not compile on `master` since then. Print the resolved address like `writeResolvedAddress` in `SignalHandlers.cpp` does: `<unknown>` for an address that does not resolve, and the name of the object for an address in a shared library. https://github.com/ClickHouse/ClickHouse/actions/runs/38884911247/job/116920919005 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit c14207b)
…ackTrace::tryResolveAddress` #126039 changed `StackTrace::tryResolveAddress` to return `ResolvedAddress` by value, with a null address for an address that does not resolve, while `formatStackTrace` in `gtest_functions_stress.cpp`, added in parallel, used it as an optional. `unit_tests_dbms` does not compile on `master` since then. Print the resolved address like `writeResolvedAddress` in `SignalHandlers.cpp` does: `<unknown>` for an address that does not resolve, and the name of the object for an address in a shared library. https://github.com/ClickHouse/ClickHouse/actions/runs/38884911247/job/116920919005 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit c14207b)
…ackTrace::tryResolveAddress` #126039 changed `StackTrace::tryResolveAddress` to return `ResolvedAddress` by value, with a null address for an address that does not resolve, while `formatStackTrace` in `gtest_functions_stress.cpp`, added in parallel, used it as an optional. `unit_tests_dbms` does not compile on `master` since then. Print the resolved address like `writeResolvedAddress` in `SignalHandlers.cpp` does: `<unknown>` for an address that does not resolve, and the name of the object for an address in a shared library. https://github.com/ClickHouse/ClickHouse/actions/runs/38884911247/job/116920919005 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ryResolveAddress` ClickHouse#126039 made `StackTrace::tryResolveAddress` return `ResolvedAddress` instead of `std::optional<ResolvedAddress>`, while ClickHouse#126137 started using it as an optional in `gtest_functions_stress.cpp`, so master does not compile `unit_tests_dbms`. The same change as ClickHouse#126269, to unblock CI here. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126134&sha=latest&name_0=PR&name_1=Build%20(arm_tidy%2C%203%2F4) PR: ClickHouse#126134
…ackTrace::tryResolveAddress` ClickHouse#126039 changed `StackTrace::tryResolveAddress` to return `ResolvedAddress` by value, with a null address for an address that does not resolve, while `formatStackTrace` in `gtest_functions_stress.cpp`, added in parallel, used it as an optional. `unit_tests_dbms` does not compile on `master` since then. Print the resolved address like `writeResolvedAddress` in `SignalHandlers.cpp` does: `<unknown>` for an address that does not resolve, and the name of the object for an address in a shared library. https://github.com/ClickHouse/ClickHouse/actions/runs/38884911247/job/116920919005 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #126039 to 26.10: Do not print runtime addresses in fatal error reports
Cherry pick #126039 to 26.9: Do not print runtime addresses in fatal error reports
Backport #126039 to 26.9: Do not print runtime addresses in fatal error reports
Fatal error reports reach the client through
send_logs_leveland are stored insystem.text_logandsystem.crash_log, so they should not contain runtime memory addresses. In the text of the report and insystem.crash_log.fault_address, addresses are now printed only as offsets inside a loaded object, which is also the formaddr2line/llvm-symbolizerneed. The numericsystem.crash_log.tracecolumn will be handled in a separate PR, together with the other tables that store traces:<unknown>in the bareStack trace:line and without an address in the symbolized trace.StackTrace::resolveAddressreturns a null address for it, so no consumer can print it.clickhouse localand other tools that are not a daemon, or a fault at startup), main-executable frames are resolved from the executable's own program headers (__ehdr_start), without the index and without taking the loader lock, instead of being printed as runtime addresses. Frames in other objects are<unknown>in that line; the symbolized trace after it still names them.si_pid/si_uidas the sender: they overlapsi_addr, so they disclosed the fault address. The sender is printed only for signals sent by a process.Address:is shown below 4096 (a null pointer with an offset) or as an offset inside a loaded object (0x... in libc.so.6).system.crash_log.fault_addresskeeps only offsets inside the executable, since an offset into another object cannot be told apart in a bare number.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fatal error reports no longer contain runtime memory addresses: stack frames and the fault address are printed as offsets inside the executable or a library, which can be passed to
addr2line, and other addresses are hidden.system.crash_log.fault_addressnow contains the offset inside the executable, orNULLwhen the address is elsewhere.Workflow [PR]
Sync PR [sync-upstream/pr/126039]
Version info
26.11.1.53-master(included in26.11and later)26.10.2.17,26.9.23.6