[clang] [llvm] [dyndbg][Clang] Implement nested-ELF dynamic debugging support (PR #216307)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 16:07:37 PDT 2026


thurstond wrote:

A few buildbots are broken by this patch (e.g., https://lab.llvm.org/buildbot/#/builders/25/builds/19323, https://lab.llvm.org/buildbot/#/builders/169/builds/25682). Could you please take a look?

```
Failed Tests (10):
  Clang :: DebugInfo/DynamicDebugging/EndToEnd/X86/globalopt.c
  Clang :: DebugInfo/DynamicDebugging/EndToEnd/X86/section.c
  Clang :: DebugInfo/DynamicDebugging/attr-outer-tail-pad.c
  Clang :: DebugInfo/DynamicDebugging/attr-outer.c
  Clang :: DebugInfo/DynamicDebugging/compiler-used.cpp
  Clang :: DebugInfo/DynamicDebugging/embed.c
  Clang :: DebugInfo/DynamicDebugging/inner-attrs.c
  Clang :: DebugInfo/DynamicDebugging/symbols-functions.cpp
  Clang :: DebugInfo/DynamicDebugging/symbols-globals.cpp
  Clang :: DebugInfo/DynamicDebugging/symbols-internal-comdat.cpp
```

```
******************** TEST 'Clang :: DebugInfo/DynamicDebugging/compiler-used.cpp' FAILED ********************
Exit Code: -6
Command Output (stdout):
--
# RUN: at line 1
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/clang -cc1 -triple x86_64-unknown-unknown /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/test/DebugInfo/DynamicDebugging/compiler-used.cpp -debug-info-kind=limited -fdynamic-debugging -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/clang/test/DebugInfo/DynamicDebugging/Output/compiler-used.cpp.tmp     -emit-llvm --save-dynamic-debugging-temps --discard-dynamic-debugging-debug-module
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/clang -cc1 -triple x86_64-unknown-unknown /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/test/DebugInfo/DynamicDebugging/compiler-used.cpp -debug-info-kind=limited -fdynamic-debugging -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/clang/test/DebugInfo/DynamicDebugging/Output/compiler-used.cpp.tmp -emit-llvm --save-dynamic-debugging-temps --discard-dynamic-debugging-debug-module
# .---command stderr------------
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
# | Stack dump:
# | 0.	Program arguments: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/clang -cc1 -triple x86_64-unknown-unknown /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/test/DebugInfo/DynamicDebugging/compiler-used.cpp -debug-info-kind=limited -fdynamic-debugging -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/clang/test/DebugInfo/DynamicDebugging/Output/compiler-used.cpp.tmp -emit-llvm --save-dynamic-debugging-temps --discard-dynamic-debugging-debug-module
# | 1.	<eof> parser at end of file
# |  #0 0x00005d6b11d0e536 ___interceptor_backtrace /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:4556:13
# |  #1 0x00005d6b1a1c713b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:931:13
# |  #2 0x00005d6b1a1c18f7 llvm::sys::RunSignalHandlers() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/Signals.cpp:0:5
# |  #3 0x00005d6b1a1c9749 SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:474:38
# |  #4 0x00005d6b1a1c919e end<const int, 10UL> /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__iterator/access.h:29:18
# |  #5 0x00005d6b1a1c919e end_impl<const int (&)[10]> /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/ADL.h:37:10
# |  #6 0x00005d6b1a1c919e adl_end<const int (&)[10]> /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/ADL.h:88:10
# |  #7 0x00005d6b1a1c919e is_contained<const int (&)[10], int> /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1953:40
# |  #8 0x00005d6b1a1c919e SignalHandlerTerminate(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:514:7
# |  #9 0x0000789ab8647e10 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47e10)
# | #10 0x0000789ab86ae3cc pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0xae3cc)
# | #11 0x0000789ab8647cde raise (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47cde)
# | #12 0x0000789ab86288ec abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x288ec)
# | #13 0x00005d6b11d91d1c (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/clang+0xc3a9d1c)
# | #14 0x00005d6b11d8fbae __sanitizer::Die() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
# | #15 0x00005d6b11dabdde (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/clang+0xc3c3dde)
# | #16 0x00005d6b1a06961c llvm::MD5::update(llvm::ArrayRef<unsigned char>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/MD5.cpp:0:7
# | #17 0x00005d6b1bb31a21 getFilename /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/DebugInfoMetadata.h:698:17
# | #18 0x00005d6b1bb31a21 createAndEmbedModuleForDynamicDebugging /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1531:23
# | #19 0x00005d6b1bb31a21 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1654:5
# | #20 0x00005d6b1bb73bed clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:322:3
# | #21 0x00005d6b2056575b clang::ParseAST(clang::Sema&, bool, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/Parse/ParseAST.cpp:0:13
# | #22 0x00005d6b1bb7ff80 clang::CodeGenAction::ExecuteAction() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1248:1
# | #23 0x00005d6b1c926600 clang::FrontendAction::Execute() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1350:10
# | #24 0x00005d6b1c7e41ae getPtr /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Error.h:278:42
# | #25 0x00005d6b1c7e41ae operator bool /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/Error.h:241:16
# | #26 0x00005d6b1c7e41ae clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1035:23
# | #27 0x00005d6b1cb789b0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:0:25
# | #28 0x00005d6b11dbd4d9 SaveAndRestore /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/SaveAndRestore.h:26:55
# | #29 0x00005d6b11dbd4d9 scopedDisable /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/IOSandbox.h:24:48
# | #30 0x00005d6b11dbd4d9 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/tools/driver/cc1_main.cpp:302:26
# | #31 0x00005d6b11db29c4 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/tools/driver/driver.cpp:231:12
# | #32 0x00005d6b11db1964 clang_main(int, char**, llvm::ToolContext const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/tools/driver/driver.cpp:277:12
# | #33 0x00005d6b11dde34a main /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/clang/tools/driver/clang-driver.cpp:17:10
# | #34 0x0000789ab862a8c1 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a8c1)
# | #35 0x0000789ab862a9d8 __libc_start_main (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a9d8)
# | #36 0x00005d6b11cc4ca5 _start (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/clang+0xc2dcca5)
# `-----------------------------
```


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


More information about the llvm-commits mailing list