[LLVMbugs] [Bug 19334] New: Segmentation fault in llvm::SelectionDAGBuilder::visitBinary(llvm::User const&, unsigned int)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 3 21:28:02 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19334

            Bug ID: 19334
           Summary: Segmentation fault in
                    llvm::SelectionDAGBuilder::visitBinary(llvm::User
                    const&, unsigned int)
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: asolokha at gmx.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang 3.4 segfaults when compiling the following reduced testcase on x86_64:

int fc3 = 0;

static int
xth(int bfy, int nqq)
{
  return bfy + nqq;
}

static int
qd8(short int y80)
{
  static int w41[1][1];
  static int v06;
  int p7c, ed9, o7f;
  int *j3e = &w41[0][0];
  for (p7c = 0; p7c < 6; ++p7c)
    for (ed9 = 0; ed9 < 6; ++ed9)
      for (o7f = 0; o7f < 6; ++o7f)
        y80 = xth((&v06 != j3e) & y80, y80);
  return y80;
}

void
ade(void)
{
  int *g4e = &fc3;
  *g4e ^= qd8(1);
}

% clang -c -O2 -o 42210194.o 42210194.c
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 3.4 (tags/RELEASE_34/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
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: 
********************

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/42210194-fdd77a.c
clang: note: diagnostic msg: /tmp/42210194-fdd77a.sh
clang: note: diagnostic msg: 

********************

Top 6 frames from stack trace:
#0  0x00007f9b76fb870c in llvm::SelectionDAGBuilder::visitBinary(llvm::User
const&, unsigned int) ()
   from /usr/bin/../lib/libLLVM-3.4.so
#1  0x00007f9b76fb409f in llvm::SelectionDAGBuilder::getValueImpl(llvm::Value
const*) () from /usr/bin/../lib/libLLVM-3.4.so
#2  0x00007f9b76fb4d15 in llvm::SelectionDAGBuilder::getValue(llvm::Value
const*) () from /usr/bin/../lib/libLLVM-3.4.so
#3  0x00007f9b76fb8711 in llvm::SelectionDAGBuilder::visitBinary(llvm::User
const&, unsigned int) ()
   from /usr/bin/../lib/libLLVM-3.4.so
#4  0x00007f9b76fb409f in llvm::SelectionDAGBuilder::getValueImpl(llvm::Value
const*) () from /usr/bin/../lib/libLLVM-3.4.so
#5  0x00007f9b76fb4d15 in llvm::SelectionDAGBuilder::getValue(llvm::Value
const*) () from /usr/bin/../lib/libLLVM-3.4.so
#6  0x00007f9b76fb8711 in llvm::SelectionDAGBuilder::visitBinary(llvm::User
const&, unsigned int) ()

The following 20913 frames are completely identical. And at the beginning there
is:
#20920 0x00007f9b76fb409f in
llvm::SelectionDAGBuilder::getValueImpl(llvm::Value const*) () from
/usr/bin/../lib/libLLVM-3.4.so
#20921 0x00007f9b76fb4d15 in llvm::SelectionDAGBuilder::getValue(llvm::Value
const*) () from /usr/bin/../lib/libLLVM-3.4.so
#20922 0x00007f9b76fb9900 in llvm::SelectionDAGBuilder::visitSExt(llvm::User
const&) () from /usr/bin/../lib/libLLVM-3.4.so
#20923 0x00007f9b76fb409f in
llvm::SelectionDAGBuilder::getValueImpl(llvm::Value const*) () from
/usr/bin/../lib/libLLVM-3.4.so
#20924 0x00007f9b76fb4d15 in llvm::SelectionDAGBuilder::getValue(llvm::Value
const*) () from /usr/bin/../lib/libLLVM-3.4.so
#20925 0x00007f9b76fb8727 in llvm::SelectionDAGBuilder::visitBinary(llvm::User
const&, unsigned int) ()
   from /usr/bin/../lib/libLLVM-3.4.so
#20926 0x00007f9b76fd4c14 in llvm::SelectionDAGBuilder::visit(llvm::Instruction
const&) () from /usr/bin/../lib/libLLVM-3.4.so
#20927 0x00007f9b76fe5ed1 in
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) () from
/usr/bin/../lib/libLLVM-3.4.so
#20928 0x00007f9b76fe7659 in
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) () from
/usr/bin/../lib/libLLVM-3.4.so
#20929 0x00007f9b76fe88a1 in
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
   from /usr/bin/../lib/libLLVM-3.4.so
#20930 0x00007f9b76669da9 in
llvm::FPPassManager::runOnFunction(llvm::Function&) () from
/usr/bin/../lib/libLLVM-3.4.so
#20931 0x00007f9b76669e3b in llvm::FPPassManager::runOnModule(llvm::Module&) ()
from /usr/bin/../lib/libLLVM-3.4.so
#20932 0x00007f9b7666c2e9 in llvm::legacy::PassManagerImpl::run(llvm::Module&)
() from /usr/bin/../lib/libLLVM-3.4.so
#20933 0x00000000007de14e in
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) ()
#20934 0x00000000007db801 in ?? ()
#20935 0x0000000000962e33 in clang::ParseAST(clang::Sema&, bool, bool) ()
#20936 0x000000000066b789 in clang::FrontendAction::Execute() ()
#20937 0x0000000000649534 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#20938 0x0000000000631316 in
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#20939 0x000000000062cf38 in cc1_main(char const**, char const**, char const*,
void*) ()
#20940 0x000000000062b5a5 in main ()

When building w/ -emit-llvm, clang hangs indefinitely instead. Interesting perf
top output is:
 18.64%  libLLVM-3.4.so [.]
_ZN4llvm15ValueEnumerator20EnumerateOperandTypeEPKNS_5ValueE
 12.07%  libLLVM-3.4.so [.] _ZN4llvm15ValueEnumerator13EnumerateTypeEPNS_4TypeE
It seems to loop in llvm::ValueEnumerator::EnumerateOperandType(llvm::Value
const*).

-- 
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/20140404/139b53e9/attachment.html>


More information about the llvm-bugs mailing list