| Issue |
53166
|
| Summary |
Clang segmentation fault on 11.0.1
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
abbec
|
Using clang 11.0.1 (in a toolchain generated with crosstool-ng): http://cdn.unrealengine.com/Toolchain_Linux/native-linux-v19_clang-11.0.1-centos7.tar.gz crashes when combining the arguments `-emit-obj --compress-debug-sections -debug-info-kind=limited`. If any of them are removed it works fine.
```
clang -cc1 -emit-obj --compress-debug-sections -debug-info-kind=limited -o apa.o -x c apa.c -v
clang -cc1 version 11.0.1 based upon LLVM 11.0.1 default target x86_64-unknown-linux-gnu
#include "..." search starts here:
End of search list.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang @/dev/fd/63
1. <eof> parser at end of file
2. Code generation
#0 0x0000000001a740ba llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x1a740ba)
#1 0x0000000001a720b4 llvm::sys::RunSignalHandlers() (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x1a720b4)
#2 0x0000000001a729dd SignalHandler(int) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x1a729dd)
#3 0x00007f5735e32750 __restore_rt (/lib64/libc.so.6+0x42750)
#4 0x0000000000b22872 llvm::Error llvm::handleErrors<llvm::consumeError(llvm::Error)::'lambda'(llvm::ErrorInfoBase const&)>(llvm::Error, llvm::consumeError(llvm::Error)::'lambda'(llvm::ErrorInfoBase const&)&&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0xb22872)
#5 0x00000000017d082f (anonymous namespace)::ELFWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&) (.constprop.391) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x17d082f)
#6 0x00000000017d1967 (anonymous namespace)::ELFSingleObjectWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x17d1967)
#7 0x0000000001753f99 llvm::MCAssembler::Finish() (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x1753f99)
#8 0x000000000178ee16 llvm::MCStreamer::Finish() (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x178ee16)
#9 0x0000000002390a71 llvm::AsmPrinter::doFinalization(llvm::Module&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x2390a71)
#10 0x00000000014ce76c llvm::FPPassManager::doFinalization(llvm::Module&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x14ce76c)
#11 0x00000000014d8bc0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x14d8bc0)
#12 0x0000000001ca827e (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x1ca827e)
#13 0x0000000001ca9c09 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> >) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x1ca9c09)
#14 0x000000000271f919 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x271f919)
#15 0x0000000003192ac9 clang::ParseAST(clang::Sema&, bool, bool) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x3192ac9)
#16 0x00000000021afa91 clang::FrontendAction::Execute() (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x21afa91)
#17 0x0000000002172b8b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x2172b8b)
#18 0x0000000002266f33 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x2266f33)
#19 0x00000000009a056c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x9a056c)
#20 0x000000000099d49d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x99d49d)
#21 0x000000000091cdfe main (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x91cdfe)
#22 0x00007f5735e1d560 __libc_start_call_main (/lib64/libc.so.6+0x2d560)
#23 0x00007f5735e1d60c __libc_start_main_impl (/lib64/libc.so.6+0x2d60c)
#24 0x000000000099ce15 _start (/nix/store/nwh6np8s9gn51mbspd537svjmhpvg3n8-unreal-toolchain/bin/clang+0x99ce15)
Segmentation fault (core dumped)
```
The C file is this:
```c
int main()
{
return 0;
}
```
Using the same command line with clang 11.1.0 works fine although that one is admittedly not from a crosstool toolchain.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs