[llvm-bugs] [Bug 36626] New: unable to execute command: Segmentation fault (core dumped) (llvm::MachineBasicBlock::addPredecessor)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 6 23:15:47 PST 2018


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

            Bug ID: 36626
           Summary: unable to execute command: Segmentation fault (core
                    dumped) (llvm::MachineBasicBlock::addPredecessor)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vegard.nossum at gmail.com
                CC: llvm-bugs at lists.llvm.org

Input:

void a() {
  alignof(({
    b: 0;
  }));
  goto b;
}

Output:

<source>:2:3: warning: 'alignof' applied to an expression is a GNU extension
[-Wgnu-alignof-expression]
  alignof(({
  ^
<source>:2:3: warning: expression result unused [-Wunused-value]
  alignof(({
  ^~~~~~~~~~
#0 0x0000000001fba65a
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x1fba65a)
#1 0x0000000001fb873e
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x1fb873e)
#2 0x0000000001fb888c
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x1fb888c)
#3 0x00007fa728527390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00000000017a7340
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x17a7340)
#5 0x0000000002836d8d
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x2836d8d)
#6 0x000000000283bb0f
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x283bb0f)
#7 0x0000000002840ec3
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x2840ec3)
#8 0x00000000028f469c
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x28f469c)
#9 0x00000000028f6bf2
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x28f6bf2)
#10 0x0000000001389084
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x1389084)
#11 0x00000000017e3ae1
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x17e3ae1)
#12 0x0000000001ac842a
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x1ac842a)
#13 0x0000000001ac84d3
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x1ac84d3)
#14 0x0000000001ac7fe4
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x1ac7fe4)
#15 0x000000000218de3e
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x218de3e)
#16 0x000000000218ff22
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x218ff22)
#17 0x00000000029adc14
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x29adc14)
#18 0x0000000002edf120
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x2edf120)
#19 0x00000000029ad1f7
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x29ad1f7)
#20 0x000000000255402e
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x255402e)
#21 0x000000000251f846
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x251f846)
#22 0x00000000025e771c
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x25e771c)
#23 0x0000000000a2c818
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0xa2c818)
#24 0x0000000000990537
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0x990537)
#25 0x00007fa7274ac830 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#26 0x0000000000a29d69
(/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0+0xa29d69)
Stack dump:
0.      Program arguments:
/opt/compiler-explorer/clang-trunk-20180306/bin/clang-7.0 -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name example.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fno-escaping-block-tail-calls
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited
-dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file
/tmp/compiler-explorer-compiler11827-63-1sc8gyt.b70t/output.gcno -resource-dir
/opt/compiler-explorer/clang-trunk-20180306/lib/clang/7.0.0 -c-isystem
/usr/include/x86_64-linux-gnu -cxx-isystem /usr/include/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-7.2.0/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0
-internal-isystem
/opt/compiler-explorer/gcc-7.2.0/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-7.2.0/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/compiler-explorer/clang-trunk-20180306/lib/clang/7.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /compiler-explorer -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -mllvm --x86-asm-syntax=intel -o
/tmp/compiler-explorer-compiler11827-63-1sc8gyt.b70t/output.s -x c++ <source> 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '<source>'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z1av'
clang-7.0: error: unable to execute command: Segmentation fault (core dumped)
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 326767)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-trunk/bin
clang-7.0: 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-7.0: note: diagnostic msg: 
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7.0: note: diagnostic msg: /tmp/example-7bbf6a.cpp
clang-7.0: note: diagnostic msg: /tmp/example-7bbf6a.sh
clang-7.0: note: diagnostic msg: 
********************
Compiler returned: 254

On an older version:

$ clang++-5.0 -std=c++11 input.cc
input.cc:2:3: warning: 'alignof' applied to an expression is a GNU extension
[-Wgnu-alignof-expression]
  alignof(({
  ^
input.cc:2:3: warning: expression result unused [-Wunused-value]
  alignof(({
  ^~~~~~~~~~
#0 0x00007fc49f2b6eea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0x7fbeea)
#1 0x00007fc49f2b506e llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0x7fa06e)
#2 0x00007fc49f2b51bc (/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0x7fa1bc)
#3 0x00007fc4a2086390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007fc49f4d1e94
llvm::MachineBasicBlock::addPredecessor(llvm::MachineBasicBlock*)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xa16e94)
#5 0x00007fc49f4d1f13
llvm::MachineBasicBlock::addSuccessorWithoutProb(llvm::MachineBasicBlock*)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xa16f13)
#6 0x00007fc49f70d1ed llvm::FastISel::fastEmitBranch(llvm::MachineBasicBlock*,
llvm::DebugLoc const&) (/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xc521ed)
#7 0x00007fc49f71276f llvm::FastISel::selectOperator(llvm::User const*,
unsigned int) (/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xc5776f)
#8 0x00007fc49f717a63 llvm::FastISel::selectInstruction(llvm::Instruction
const*) (/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xc5ca63)
#9 0x00007fc49f8428f9
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xd878f9)
#10 0x00007fc49f844681
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xd89681)
#11 0x00007fc4a0bf83b4 (/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0x213d3b4)
#12 0x00007fc49f512991
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0xa57991)
#13 0x00007fc49f382ac2 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0x8c7ac2)
#14 0x00007fc49f382b73 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0x8c7b73)
#15 0x00007fc49f38270f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1+0x8c770f)
#16 0x000000000083c4a5 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> >)
(/usr/lib/llvm-5.0/bin/clang+0x83c4a5)
#17 0x0000000000d05d70 (/usr/lib/llvm-5.0/bin/clang+0xd05d70)
#18 0x0000000000e296c8 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm-5.0/bin/clang+0xe296c8)
#19 0x0000000000d054f7 clang::CodeGenAction::ExecuteAction()
(/usr/lib/llvm-5.0/bin/clang+0xd054f7)
#20 0x0000000000ba21ce clang::FrontendAction::Execute()
(/usr/lib/llvm-5.0/bin/clang+0xba21ce)
#21 0x0000000000b6f1a6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm-5.0/bin/clang+0xb6f1a6)
#22 0x0000000000c28e02
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm-5.0/bin/clang+0xc28e02)
#23 0x00000000007fbc78 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-5.0/bin/clang+0x7fbc78)
#24 0x00000000007e9dc7 main (/usr/lib/llvm-5.0/bin/clang+0x7e9dc7)
#25 0x00007fc49dc38830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#26 0x00000000007f9b39 _start (/usr/lib/llvm-5.0/bin/clang+0x7f9b39)
Stack dump:
0.      Program arguments: /usr/lib/llvm-5.0/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name input.cc -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/lib/llvm-5.0/lib/clang/5.0.0 -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/x86_64-linux-gnu
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/backward
-internal-isystem /usr/include/clang/5.0.0/include/ -internal-isystem
/usr/local/include -internal-isystem /usr/lib/llvm-5.0/lib/clang/5.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir
/home/vegard/git/prog-fuzz/creduce -ferror-limit 19 -fmessage-length 159
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/input-b9796e.o -x c++ input.cc 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'input.cc'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z1av'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0-3~16.04.1 (tags/RELEASE_500/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: 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: 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/20180307/9e18812f/attachment-0001.html>


More information about the llvm-bugs mailing list