v.19.14New Feature

Show Private Symbols in Stack Traces (this Is Done via Parsing Symbol Tables of ELF Files)

Show private symbols in stack traces (this is done via parsing symbol tables of ELF files). Added information about file and line number in stack traces if debug info is present. Speedup symbol name lookup with indexing symbols present in program. Added new SQL functions for introspection: demangle and addressToLine. Renamed function symbolizeAddress to addressToSymbol for consistency. Function addressToSymbol will return mangled name for performance reasons and you have to apply demangle. Added setting allow_introspection_functions which is turned off by default. #6201 (alexey-milovidov)
Enhanced stack trace introspection in ClickHouse by showing private symbols and adding file and line number information when debug info is available. Introduces new SQL functions for symbol demangling and address-to-line translation, along with performance improvements in symbol lookup.

Why it matters

This feature improves the visibility and readability of stack traces by exposing private symbols through ELF symbol table parsing and augmenting traces with precise file and line number details. It helps developers and DBAs diagnose issues more effectively by making stack traces more informative and easier to interpret. The new SQL functions facilitate on-demand introspection of program symbols, enhancing debugging capabilities while controlling security with a dedicated setting.

How to use it

Enable the feature by setting the allow_introspection_functions setting to true (it is off by default). Use the new SQL functions <code>demangle</code> to convert mangled symbol names to human-readable form, and <code>addressToLine</code> to map program addresses to source file and line numbers. Note that the existing <code>symbolizeAddress</code> function has been renamed to <code>addressToSymbol</code> and now returns mangled names for improved performance, so <code>demangle</code> should be applied when needed.