Repository navigation
fix(analysis): fall back to LLVM's demangler when the C++ runtime's fails - #241
Draft
SizzleUnrlsd wants to merge 5 commits into
Draft
SizzleUnrlsd wants to merge 5 commits into
SizzleUnrlsd wants to merge 5 commits into
Conversation
SizzleUnrlsd
added a commit
that referenced
this pull request
Nov 1, 2026
GitHub retires the macos-14 image on November 2, 2026, and fails its jobs during the scheduled brownouts before that (actions/runner-images#13518): "Build on macos-14" was cancelled before any step on #239 and #241 on October 30. The job moves to macos-15 with Xcode 16.0, the oldest Xcode of that image: its AppleClang 16.0.0 is the oldest Apple compiler GitHub's runners still provide. The step fails if the image no longer has Xcode 16.0, rather than building with another one. Two things are then no longer tested: AppleClang 15, the compiler the job was added for (#228), since macos-14 is the only image with Xcode 15; and the macOS 14 C++ runtime, whose demangler predates C++23 explicit object members (#240). These are losses of coverage, not a decision to drop compatibility with either.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #240
Problem
ctrace_tools::isMangledandctrace_tools::demangleread a symbol with the C++ runtime'sabi::__cxa_demangleonly. A runtime whose demangler predates a mangling rejects the symbol, and every caller then shows the symbol: diagnostics throughformatFunctionNameForMessage, the function filters and the stack report. A C++23 explicit object member function,_ZNH6Reader4peekERKS_Pi, is one: macOS 14's runtime and Ubuntu 22.04's (libstdc++ of GCC 11) reject it, while Ubuntu 24.04's, macOS 27's and LLVM 20's demangler read it.Change
src/mangle.cpp:isMangledanddemangleshare one reading. The runtime's__cxa_demanglecomes first, then LLVM'sllvm::itaniumDemanglewhen the runtime's fails. The fallback is generic: it does not depend on the platform or on the symbol. A name that neither reads stays a plain name. Where the runtime already reads a symbol, nothing changes.include/mangle.hpp:isMangledbecomes a declaration taking astd::string_view, defined inmangle.cpp. TheStringLikeconcept, which only this template used, goes. LLVMDemangle already comes with LLVMSupport, so no dependency is added.Tests
testSymbolDemangling(test/unit/analyzer_module_unit_tests.cpp) covers the explicit object member's symbol: it is recognized as mangled, shown demangled, and named demangled in a message. Three controls cover a member's symbol, a C function's name, and a name that no demangler reads.main(f846712), without the fixThe test was compiled on Ubuntu 22.04 as the unit test file has it, against the real
src/mangle.cppandsrc/analysis/AnalyzerUtils.cpp, in a Docker image with LLVM 20 that keeps GCC 11's runtime. Onmacos-14, #239's CI shows the defect through the fixtureconst-suggestion-explicit-object.cppof #217's branch.Validation
At
270955e, on macOS (LLVM 20): built without warning; the unit tests and the ownership tests pass; the suite, as CI runs it, passes 2415/2415, as onmain.CI and code scanning
270955e(merge ref32771e6, intomainatf846712): every check passes. Onmacos-14(Xcode 15.4), whose runtime does not read_ZNH6Reader4peekERKS_Pi, the six checks oftestSymbolDemanglingpass, and the suite passes 2415/2415.mainatf846712. New alerts: none. The 66 alerts open onrefs/pull/241/mergeare the 66 open onmain, alert for alert.