[llvm-bugs] [Bug 49522] New: DebugInfo Stripping sometimes causes a Broken Input Module

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 10 12:00:21 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49522

            Bug ID: 49522
           Summary: DebugInfo Stripping sometimes causes a Broken Input
                    Module
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: reverett at digital.ai
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

Created attachment 24619
  --> https://bugs.llvm.org/attachment.cgi?id=24619&action=edit
Source code from Boost::Spirit (I think) that leaves Debug Metadata after
stripping

With the latest LLVM source and the recent Xcode 12.5 betas, we've noticed that
stripping debug info from certain object files is broken both in the clang++
frontend and when directly calling llvm::StripDebugInfo or using
llvm::createStripSymbolsPass(true). The error seen after lowering a stripped
object file with embedded bitcode:

DICompileUnit not listed in llvm.dbg.cu
!3714 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !10,
producer: "clang version 13.0.0 (https://github.com/llvm/llvm-project
023b5c1ed8d1577bf0cf298b64a0a047b13fc418)", isOptimized: false, runtimeVersion:
0, emissionKind: FullDebug, enums: !3715, retainedTypes: !3729, globals:
!29030, imports: !29860, splitDebugInlining: false, nameTableKind: None,
sysroot:
"/Applications/Xcode_12.5b2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk",
sdk: "MacOSX.sdk")
warning: ignoring invalid debug info in spirit.stripped.o
DICompileUnit not listed in llvm.dbg.cu
!3714 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !10,
producer: "clang version 13.0.0 (https://github.com/llvm/llvm-project
023b5c1ed8d1577bf0cf298b64a0a047b13fc418)", isOptimized: false, runtimeVersion:
0, emissionKind: FullDebug, enums: !3715, retainedTypes: !3729, globals:
!29030, imports: !29860, splitDebugInlining: false, nameTableKind: None,
sysroot:
"/Applications/Xcode_12.5b2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk",
sdk: "MacOSX.sdk")
llc: error: 'spirit.stripped.o': input module cannot be verified

With the latest Xcode 12.5 beta (or using the swift/release/5.4 branch), the
llc error becomes "error: input module is broken!"

Additionally after performing llvm::StripDebugInfo(), a subsequent call to
llvm::verifyModule() will not report any errors and debug_compile_units() is
empty. However writing the stripped bitcode to a file and then running llvm-dis
on said file, the DICompileUnits are clearly visible in the Debug Metadata.

I've attached a reproducible source file that can compiled with:
clang++ spirit.cpp -c -g -emit-llvm -isysroot "" spirit.o
opt spirit.o -strip-debug -o spirit.stripped.o
lld spirit.stripped.o -o spirit.out
Also I'm sorry the source file is rather large, but it's the only thing I've
found to consistently reproduce the problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210310/0c2386f1/attachment.html>


More information about the llvm-bugs mailing list