[clang-tools-extra] Reapply "[clang-doc] Move Info types into arenas (#190054)" (PR #192495)

Erick Velez via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 01:29:15 PDT 2026


evelez7 wrote:

Well... at least we're getting different errors right @ilovepi?

```
# | /Users/evelez/code/llvm-project/clang-tools-extra/clang-doc/JSONGenerator.cpp:211:22: runtime error: reference binding to misaligned address 0x2e6666fffff096e9 for type 'const value_type' (aka 'const clang::doc::CommentInfo'), which requires 8 byte alignment
# | 0x2e6666fffff096e9: note: pointer points here
# | <memory cannot be printed>
# | SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/evelez/code/llvm-project/clang-tools-extra/clang-doc/JSONGenerator.cpp:211:22
# |  #0 0x000000011001478b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x1002a078b)
# |  #1 0x00000001100170ea SignalHandler(int, __siginfo*, void*) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x1002a30ea)
# |  #2 0x00007ff80da3f31d (/usr/lib/system/libsystem_platform.dylib+0x7ff801f0c31d)
# |  #3 0x0000000000000000
# |  #4 0x00007ff80d9255c6 (/usr/lib/system/libsystem_c.dylib+0x7ff801df25c6)
# |  #5 0x0000000118fa9c28 (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0xc5c28)
# |  #6 0x0000000118fa9371 (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0xc5371)
# |  #7 0x0000000118fbc90b (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0xd890b)
# |  #8 0x00000001119d206f clang::doc::serializeComment(clang::doc::CommentInfo const&, llvm::json::Object&) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x101c5e06f)
# |  #9 0x00000001119b804f clang::doc::serializeDescription(llvm::simple_ilist<clang::doc::CommentInfo> const&, llvm::json::Object&, llvm::StringRef) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x101c4404f)
# | #10 0x00000001119b75d8 clang::doc::JSONGenerator::serializeCommonAttributes(clang::doc::Info const&, llvm::json::Object&) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x101c435d8)
# | #11 0x00000001119bd83f clang::doc::JSONGenerator::serializeInfo(clang::doc::FunctionInfo const&, llvm::json::Object&) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x101c4983f)
# | #12 0x00000001119c585b clang::doc::JSONGenerator::serializeInfo(clang::doc::NamespaceInfo const&, llvm::json::Object&) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x101c5185b)
# | #13 0x00000001119cc97d clang::doc::JSONGenerator::generateDocForInfo(clang::doc::Info*, llvm::raw_ostream&, clang::doc::ClangDocContext const&) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x101c5897d)
# | #14 0x00000001119cc1b3 clang::doc::JSONGenerator::generateDocumentation(llvm::StringRef, llvm::StringMap<clang::doc::Info*, llvm::MallocAllocator>, clang::doc::ClangDocContext const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x101c581b3)
# | #15 0x000000010fd79ed2 main (/Users/evelez/code/llvm-project/cmake-build-sanitizers-clang-doc/bin/clang-doc+0x100005ed2)
# | #16 0x00007ff80d661530
# `-----------------------------
# error: command failed with exit status: -6
```

Since this is happening in JSONGenerator, then I'm guessing the CommentInfos aren't being properly allocated in BitcodeReader

https://github.com/llvm/llvm-project/pull/192495


More information about the cfe-commits mailing list