Skip to content

Remove object addresses from logical error messages - #126748

Merged
alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
Algunenano:hide-addresses-in-logical-errors
Oct 21, 2026
Merged

alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
Algunenano:hide-addresses-in-logical-errors

Conversation

@Algunenano

@Algunenano Algunenano commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Exception messages of PollingQueue, JoinStepLogical, JoinExpressionActions, the Delta Lake kernel error registry and IAST::dumpTree printed memory addresses. Memory addresses are internal state and do not belong in messages that reach users, so they are removed. PollingQueue now describes tasks by thread number and file descriptor.

The always disabled debug logging of QueryPlanVisitor, which printed plan step addresses, is removed. The bundled expat parser loses its EXPAT_*_DEBUG traces, which wrote parser addresses to stderr and were unused.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Workflow [PR]
Sync PR [sync-upstream/pr/126748]

Version info

  • Merged into: 26.11.1.369-master (included in 26.11 and later)
  • Backported to: 26.10.2.53, 26.9.24.8

Algunenano and others added 2 commits October 19, 2026 18:50
`PollingQueue`, `JoinStepLogical`, `JoinExpressionActions`, the Delta
Lake kernel error registry and `IAST::dumpTree` printed memory
addresses in exception messages. Memory addresses are internal state
and do not belong in messages that reach users. `PollingQueue` now
describes tasks by thread number and file descriptor.

Also remove the always disabled debug logging of `QueryPlanVisitor`,
which printed plan step addresses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The allocation, accounting, entity and entropy traces of `xmlparse.cpp`
are enabled by `EXPAT_*_DEBUG` environment variables and write parser
addresses to stderr. They are unused and only add risk, so remove them
together with the code that drives them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [282b9b7]

Summary: ✅


AI Review

Summary

Removes object addresses from exception messages and IAST::dumpTree, and deletes unused query-plan and Expat debug output. The previous KernelUtils finding is fixed in 282b9b78 and its thread has been resolved. No new actionable issues or unresolved findings remain.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-not-for-changelog This PR should not be mentioned in the changelog comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. labels Oct 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 282b9b78c with master 0b4681811 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 074719710; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

13 translation units recompiled, 52 s compile time in total, 9 of them have a recent master baseline.

Job report

@alexey-milovidov alexey-milovidov self-assigned this Oct 20, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 20, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Idea - override C++ standard library formatting functions so we will trap on every attempt to print a pointer.

Merged via the queue into ClickHouse:master with commit 1f3fb1f Oct 21, 2026
179 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 21, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Oct 21, 2026
robot-clickhouse-ci-2 added a commit that referenced this pull request Oct 21, 2026
Cherry pick #126748 to 26.9: Remove object addresses from logical error messages
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Oct 21, 2026
clickhouse-gh Bot added a commit that referenced this pull request Oct 21, 2026
Backport #126748 to 26.10: Remove object addresses from logical error messages
clickhouse-gh Bot added a commit that referenced this pull request Oct 21, 2026
Backport #126748 to 26.9: Remove object addresses from logical error messages
alexey-milovidov added a commit to groeneai/ClickHouse that referenced this pull request Oct 28, 2026
Memory addresses are internal state and must not leak into exception messages and logs.
Instead of removing them one by one, make printing of a pointer a compile-time error in our own code:

- `contrib/fmtlib`: with `FMT_DISALLOW_POINTERS`, formatting of `void` pointers, `nullptr` and `fmt::ptr` fails with a static assertion. This covers `Exception`, `LOG_*` and every direct use of `fmt`.
- `contrib/llvm-project`: with `_LIBCPP_DISALLOW_POINTERS`, `basic_ostream::operator<<` for `void` pointers and `nullptr_t` is deleted, and `std::format` rejects pointers. `std::to_string`, `toString` and `WriteBuffer` `operator<<` do not accept pointers already.

Both macros are defined for the code in `base`, `src`, `programs` and `utils`, but not for contribs. They are lifted for `unit_tests_dbms`, because googletest prints pointers in its assertion messages.

The remaining places that printed addresses are fixed: the `TOO_DEEP_RECURSION` message, the `IOUringReader` read error, the `NATS` consumers (now identified by a sequential number) and connections, and the `QueryFuzzer` loop check. Where an address is really needed (the fault address in the signal handler, the zero-copy lock watch identifier, debug macros and examples), it is converted to an integer explicitly.

Related: ClickHouse#126748 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
thevar1able added a commit that referenced this pull request Nov 11, 2026
Resolve conflicts in `xmlparse.cpp`: release branch 26.8 still contains the
debug-output code removed on master by #126748, so take upstream expat
2.9.0 -> 2.10.0 changes on top of the branch file instead of the master file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
thevar1able added a commit that referenced this pull request Nov 11, 2026
Resolve conflicts in `xmlparse.cpp`: release branch 26.3 still contains the
debug-output code removed on master by #126748, so take upstream expat
2.9.0 -> 2.10.0 changes on top of the branch file instead of the master file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo v26.9-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants