Repository navigation
Do not publish runtime addresses in system tables - #126760
Conversation
Frames outside the main binary are stored as 0 in all trace columns, `trace_log.ptr` is a keyed hash, `processors_profile_log` ids are per-query indices, and `TOO_DEEP_RECURSION` no longer prints stack addresses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [b747f5e] Summary: ✅
AI ReviewSummaryThe PR replaces runtime addresses with executable offsets, hidden frames, keyed allocation identifiers, and per-query processor identifiers. The four earlier findings are addressed, but the address-hiding contract remains incomplete for jemalloc-backed system tables. Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block. Extend address hiding to the jemalloc-backed table outputs and cover those paths with regression tests. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Frames outside the main binary are now stored as 0 in `system.errors`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A cloned step is a separate node in `system.processors_profile_log`. The test no longer `ARRAY JOIN`s `trace` with `symbols`, which can have different sizes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Commit See the job log for details. |
Why not offsets from the object? (I thought we already store them linke this so addr2line work, but we don't expose the ASLR offset) |
It also contains heap addresses, usually pointers to an allocation. Since we only care about matching allocation and free of the same pointer, using a hash seemed like the simplest solution. |
`ErrorLog` now queues runtime addresses and converts them only for the `last_error_trace` column, so frames outside the main binary keep their symbols. Document that raw addresses must never be output. Disable `05408` under MSan and in the flaky check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each `system.stack_trace` snapshot signals every thread it reads, one at a time across all queries, so with many copies of the test in parallel (flaky check under MSan) a single query took over 180 seconds. Reading the `AsyncMetrics` and `ConfigReloader` threads still gives both main binary frames and frames outside it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`thread_local_rng` is seeded from the monotonic clock, the thread id and `uname`, so the key that hides heap addresses could be reconstructed. `std::random_device` reads the OS randomness source and throws if it cannot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The style check forbids `std::random_device`. `getentropy` reads the OS randomness source as well (`getrandom` on Linux, through the glibc compatibility layer) and the error is thrown instead of falling back to a predictable key. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`clang-tidy` reports `cppcoreguidelines-pro-type-member-init` for the uninitialized `std::array`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ppc64le sysroot has an old glibc without `sys/random.h` and `getentropy`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #126760 to 26.10: Do not publish runtime addresses in system tables
system.trace_log,system.stack_trace,system.errors,system.error_log,system.crash_logandsystem.processors_profile_logno longer contain runtime memory addresses. This matters only for builds with PIE, which today means Linux.StackTrace::resolveAddressForStoragedoes this for every trace column, includingtrace_logrows from the query profiler and from XRay instrumentation.trace_log.symbolsandtrace_log.linesare still resolved from the runtime addresses, so frames in libc keep their names.trace_log.ptris a keyed hash, so an allocation and its deallocation still match (e.g. inflameGraph(trace, size, ptr)), but the heap address is not published.flameGraphskips a 0 frame instead of ending the trace there.processors_profile_logid,parent_idsandplan_stepare indices within the query instead of heap addresses of processors and plan steps.MemoryLargeAllocationwrites to the server log is formatted byStackTrace, like any other stack trace.TOO_DEEP_RECURSIONmessage no longer prints the stack and frame addresses.BackgroundSchedulePoolno longer uses the address of a function pointer as the task type id, which it logs.Related: #126039
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
System tables no longer contain runtime memory addresses: stack frames outside the main binary are stored as 0,
system.trace_log.ptris an identifier instead of an address, and the ids insystem.processors_profile_logare indices within the query.Workflow [PR]
Sync PR [sync-upstream/pr/126760]
Version info
26.11.1.572-master(included in26.11and later)26.10.2.82