Repository navigation
Remove object addresses from logical error messages - #126748
alexey-milovidov merged 3 commits into
Conversation
`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]>
|
Workflow [PR], commit [282b9b7] Summary: ✅
AI ReviewSummaryRemoves object addresses from exception messages and 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 units13 translation units recompiled, 52 s compile time in total, 9 of them have a recent master baseline. |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Idea - override C++ standard library formatting functions so we will trap on every attempt to print a pointer. |
Cherry pick #126748 to 26.9: Remove object addresses from logical error messages
Backport #126748 to 26.10: Remove object addresses from logical error messages
Backport #126748 to 26.9: Remove object addresses from logical error messages
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]>
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]>
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]>
Exception messages of
PollingQueue,JoinStepLogical,JoinExpressionActions, the Delta Lake kernel error registry andIAST::dumpTreeprinted memory addresses. Memory addresses are internal state and do not belong in messages that reach users, so they are removed.PollingQueuenow 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 itsEXPAT_*_DEBUGtraces, which wrote parser addresses to stderr and were unused.Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/126748]
Version info
26.11.1.369-master(included in26.11and later)26.10.2.53,26.9.24.8