[llvm-bugs] [Bug 36791] New: The MacOS X linker crashes when inlining functions using LTO, there is a problem with debug info after inlining

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Mar 18 17:47:53 PDT 2018


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

            Bug ID: 36791
           Summary: The MacOS X linker crashes when inlining functions
                    using LTO, there is a problem with debug info after
                    inlining
           Product: libraries
           Version: 5.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Keywords: crash-on-invalid
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: chris.schaf at verizon.net
                CC: aprantl at apple.com, dblaikie at gmail.com,
                    llvm-bugs at lists.llvm.org

Created attachment 20089
  --> https://bugs.llvm.org/attachment.cgi?id=20089&action=edit
An intermediate file from running ld with -save-temps

I am attempting to inline compiled functions C++ functions into llvm-ir
generated by my Common Lisp compiler.   I am doing this on MacOS X using llvm
5.0

When I use LTO to link llvm-ir generated from C++ code with llvm-ir generated
by my Common Lisp compiler it crashes the linker.

I worked with joker-eph and chandlerc on IRC and they suggested I could run the
linker with -save-temps and then run the temporary files through opt and llc
and clang to find where the problem turns up.   I found the following...

clang -c 2.3.imported.bc -O2

Crashes with the following backtrace.

0  clang-5.0                0x0000000106e5f0a8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-5.0                0x0000000106e5e356 llvm::sys::RunSignalHandlers() +
86
2  clang-5.0                0x0000000106e5f60e SignalHandler(int) + 270
3  libsystem_platform.dylib 0x00007fffb6efcb3a _sigtramp + 26
4  libsystem_platform.dylib 0x00007fff59846c38 _sigtramp + 2727649560
5  clang-5.0                0x00000001073b5ada
llvm::DwarfDebug::finishVariableDefinitions() + 170
6  clang-5.0                0x00000001073b5c48
llvm::DwarfDebug::finalizeModuleInfo() + 168
7  clang-5.0                0x00000001073b601c llvm::DwarfDebug::endModule() +
44
8  clang-5.0                0x00000001073955c9
llvm::AsmPrinter::doFinalization(llvm::Module&) + 1017
9  clang-5.0                0x0000000106a4e373
llvm::FPPassManager::doFinalization(llvm::Module&) + 83
10 clang-5.0                0x0000000106a4e838
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1192
11 clang-5.0                0x0000000106fcf999
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions
const&, clang::CodeGenOptions const&, clang::TargetOptions const&,
clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*,
clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) + 12185
12 clang-5.0                0x000000010715951f
clang::CodeGenAction::ExecuteAction() + 1071
13 clang-5.0                0x000000010734d7f3 clang::FrontendAction::Execute()
+ 67
14 clang-5.0                0x000000010730d708
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1112
15 clang-5.0                0x000000010738ebb7
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4007
16 clang-5.0                0x00000001063bb44f cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1183
17 clang-5.0                0x00000001063b96e9 main + 10489
18 libdyld.dylib            0x00007fffb6ced235 start + 1
Stack dump:
0.      Program arguments:
/Users/meister/Development/externals-clasp/build/release/bin/clang-5.0 -cc1
-triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name 2.3.imported.bc
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-masm-verbose -munwind-tables -faligned-alloc-unavailable -target-cpu penryn
-target-linker-version 305 -dwarf-column-info -debugger-tuning=lldb
-coverage-notes-file
/Users/meister/Development/cst-clasp/src/lisp/tests/ta.fasl.thinlto.bcs/2.3.imported.gcno
-resource-dir
/Users/meister/Development/externals-clasp/build/release/lib/clang/5.0.0 -O2
-fdebug-compilation-dir
/Users/meister/Development/cst-clasp/src/lisp/tests/ta.fasl.thinlto.bcs
-ferror-limit 19 -fmessage-length 220 -stack-protector 1 -fblocks
-fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature
-fmax-type-align=16 -fdiagnostics-show-option -vectorize-loops -vectorize-slp
-o 2.3.imported.o -x ir 2.3.imported.bc 
1.      Code generation
clang-5.0: error: unable to execute command: Segmentation fault: 11 (core
dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (http://llvm.org/git/clang.git
8e4862b5be221092291aaf7ea40d72274acb9d96) (http://llvm.org/git/llvm.git
0bc70c306ccbf483a029a25a6fd851bc332accff)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Users/meister/Development/externals-clasp/build/release/bin
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-5.0: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.
meister at MacBook-Pro-7 ta.fasl.thinlto.bcs$

-- 
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/20180319/d7f390ea/attachment-0001.html>


More information about the llvm-bugs mailing list