[llvm-bugs] [Bug 44525] New: Attempting to split dwarf info into separate file causes segfault during wasm usecase

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 12 05:20:46 PST 2020


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

            Bug ID: 44525
           Summary: Attempting to split dwarf info into separate file
                    causes segfault during wasm usecase
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: trustthesky at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Created attachment 23012
  --> https://bugs.llvm.org/attachment.cgi?id=23012&action=edit
repro files

pc at debian:~/test/wasm-c-test$ clang-9 -gsplit-dwarf --target=wasm32
--no-standard-libraries -Wl,--export-all -Wl,--no-entry -o add.wasm add.c
Stack dump:
0.      Program arguments: /usr/lib/llvm-9/bin/clang -cc1 -triple wasm32
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name add.c -mrelocation-model static -mthread-model posix
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic
-fvisibility hidden -dwarf-column-info -debug-info-kind=limited
-dwarf-version=4 -debugger-tuning=gdb -ggnu-pubnames -momit-leaf-frame-pointer
-resource-dir /usr/lib/llvm-9/lib/clang/9.0.1 -internal-isystem
/usr/lib/llvm-9/lib/clang/9.0.1/include -internal-isystem /include
-fdebug-compilation-dir /home/pc/test/wasm-c-test -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gnustep -fno-common -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/add-8792ee.o -x c add.c 
1.      <eof> parser at end of file
2.      Code generation
 #0 0x00007f9ade13fdbf llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xb63dbf)
 #1 0x00007f9ade13e1e0 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xb621e0)
 #2 0x00007f9ade1401c1 (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xb641c1)
 #3 0x00007f9ae3e580e0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110e0)
 #4 0x00007f9adefc6d38 llvm::MCWasmStreamer::ChangeSection(llvm::MCSection*,
llvm::MCExpr const*) (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0x19ead38)
 #5 0x00007f9adefc3ded llvm::MCStreamer::SwitchSection(llvm::MCSection*,
llvm::MCExpr const*) (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0x19e7ded)
 #6 0x00007f9ade768d34 llvm::DwarfDebug::emitDebugPubSections()
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0x118cd34)
 #7 0x00007f9ade743751 llvm::AsmPrinter::doFinalization(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0x1167751)
 #8 0x00007f9ade23e451 llvm::FPPassManager::doFinalization(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xc62451)
 #9 0x00007f9ade23e912 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xc62912)
#10 0x00007f9ae2bcca06 EmitAssembly
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/lib/CodeGen/BackendUtil.cpp:899:3
#11 0x00007f9ae2bcca06 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/lib/CodeGen/BackendUtil.cpp:1498:15
#12 0x00007f9ae2e01eed ~unique_ptr
/usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/unique_ptr.h:238:6
#13 0x00007f9ae2e01eed
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/lib/CodeGen/CodeGenAction.cpp:303:7
#14 0x00007f9ae2142893 __normal_iterator
/usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_iterator.h:777:20
#15 0x00007f9ae2142893 begin
/usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_vector.h:549:16
#16 0x00007f9ae2142893
finalize<std::vector<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >,
std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> > > > >
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/include/clang/Sema/TemplateInstCallback.h:54:16
#17 0x00007f9ae2142893 clang::ParseAST(clang::Sema&, bool, bool)
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/lib/Parse/ParseAST.cpp:178:3
#18 0x00007f9ae33d4a48 clang::FrontendAction::Execute()
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/lib/Frontend/FrontendAction.cpp:938:10
#19 0x00007f9ae33952c0 getPtr
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/llvm/include/llvm/Support/Error.h:273:42
#20 0x00007f9ae33952c0 operator bool
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/llvm/include/llvm/Support/Error.h:236:16
#21 0x00007f9ae33952c0
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/lib/Frontend/CompilerInstance.cpp:944:23
#22 0x00007f9ae3437060
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:291:25
#23 0x00000000004a2f06 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/tools/driver/cc1_main.cpp:249:15
#24 0x00000000004a1271 ExecuteCC1Tool
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/tools/driver/driver.cpp:309:12
#25 0x00000000004a1271 main
/build/llvm-toolchain-9-9~+20191205074958+432bf48c08d/clang/tools/driver/driver.cpp:381:12
#26 0x00007f9adc9c02e1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202e1)
#27 0x000000000049e70a _start (/usr/lib/llvm-9/bin/clang+0x49e70a)
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 9.0.1-+20191205074958+432bf48c08d-1~exp1~20191205185557.104 
Target: wasm32
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/add-891092.c
clang: note: diagnostic msg: /tmp/add-891092.sh
clang: note: diagnostic msg:

-- 
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/20200112/f8069e0b/attachment.html>


More information about the llvm-bugs mailing list