[LLVMbugs] [Bug 23096] New: opt -gvn crash

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 1 02:28:51 PDT 2015


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

            Bug ID: 23096
           Summary: opt -gvn crash
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: bruce.mitchener at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14130
  --> https://llvm.org/bugs/attachment.cgi?id=14130&action=edit
Minimized test case to reproduce crash

When running "opt -gvn" against the attached IR, it crashes with infinite
recursion:

    frame #9000: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9001: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9002: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9003: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9004: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9005: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9006: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9007: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9008: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9009: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9010: 0x0000000100513963
opt`llvm::PHITransAddr::PHITranslateSubExpr(this=0x00007fff5fbfa7d0,
V=0x0000000103405b80, CurBB=0x00000001034044e0, PredBB=0x00000001034044e0,
DT=0x0000000000000000) + 1827 at PHITransAddr.cpp:220
    frame #9011: 0x000000010051468e
opt`llvm::PHITransAddr::PHITranslateValue(this=0x00007fff5fbfa7d0,
CurBB=0x00000001034044e0, PredBB=0x00000001034044e0, DT=0x0000000000000000) +
158 at PHITransAddr.cpp:322
    frame #9012: 0x00000001004fcce4
opt`llvm::MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(this=0x0000000103401f10,
Pointer=0x00007fff5fbfc030, Loc=0x00007fff5fbfb198, isLoad=true,
StartBB=0x00000001034044e0, Result=0x00007fff5fbfd100,
Visited=0x00007fff5fbfc778, SkipFirstBlock=false) + 7620 at
MemoryDependenceAnalysis.cpp:1240
    frame #9013: 0x00000001004fd00f
opt`llvm::MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(this=0x0000000103401f10,
Pointer=0x00007fff5fbfc7b8, Loc=0x00007fff5fbfc890, isLoad=true,
StartBB=0x00000001034047b0, Result=0x00007fff5fbfd100,
Visited=0x00007fff5fbfc778, SkipFirstBlock=false) + 8431 at
MemoryDependenceAnalysis.cpp:1301
    frame #9014: 0x00000001004fae3f
opt`llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(this=0x0000000103401f10,
Loc=0x00007fff5fbfc890, isLoad=true, FromBB=0x00000001034047b0,
Result=0x00007fff5fbfd100) + 367 at MemoryDependenceAnalysis.cpp:876
    frame #9015: 0x0000000100f77230 opt`(anonymous
namespace)::GVN::processNonLocalLoad(this=0x0000000103402dc0,
LI=0x0000000103406258) + 192 at GVN.cpp:1711
    frame #9016: 0x0000000100f73cb8 opt`(anonymous
namespace)::GVN::processLoad(this=0x0000000103402dc0, L=0x0000000103406258) +
1432 at GVN.cpp:1905
    frame #9017: 0x0000000100f72f3f opt`(anonymous
namespace)::GVN::processInstruction(this=0x0000000103402dc0,
I=0x0000000103406258) + 367 at GVN.cpp:2227
    frame #9018: 0x0000000100f72b8b opt`(anonymous
namespace)::GVN::processBlock(this=0x0000000103402dc0, BB=0x00000001034047b0) +
251 at GVN.cpp:2402
    frame #9019: 0x0000000100f6cc51 opt`(anonymous
namespace)::GVN::iterateOnFunction(this=0x0000000103402dc0,
F=0x0000000103404050) + 1361 at GVN.cpp:2657
    frame #9020: 0x0000000100f6c5c2 opt`(anonymous
namespace)::GVN::runOnFunction(this=0x0000000103402dc0, F=0x0000000103404050) +
626 at GVN.cpp:2360
    frame #9021: 0x0000000100b5429b
opt`llvm::FPPassManager::runOnFunction(this=0x0000000103408a30,
F=0x0000000103404050) + 427 at LegacyPassManager.cpp:1541
    frame #9022: 0x0000000100b545a8
opt`llvm::FPPassManager::runOnModule(this=0x0000000103408a30,
M=0x0000000103401410) + 104 at LegacyPassManager.cpp:1561
    frame #9023: 0x0000000100b54fb4 opt`(anonymous
namespace)::MPPassManager::runOnModule(this=0x00000001034041f0,
M=0x0000000103401410) + 1412 at LegacyPassManager.cpp:1619
    frame #9024: 0x0000000100b5485e
opt`llvm::legacy::PassManagerImpl::run(this=0x0000000103401770,
M=0x0000000103401410) + 302 at LegacyPassManager.cpp:1726
    frame #9025: 0x0000000100b55731
opt`llvm::legacy::PassManager::run(this=0x00007fff5fbfeca0,
M=0x0000000103401410) + 33 at LegacyPassManager.cpp:1763
    frame #9026: 0x000000010003a946 opt`main(argc=3, argv=0x00007fff5fbff9b8) +
12630 at opt.cpp:716
    frame #9027: 0x00007fff87ac35c9 libdyld.dylib`start + 1
    frame #9028: 0x00007fff87ac35c9 libdyld.dylib`start + 1

This happens with: LLVM 3.6.0 release, trunk as of earlier this week and the
emscripten-fastcomp branch. (That means it probably also happens with current
PNaCl.)

The crash in our codebase happens in the implementation of wcsstr() which comes
from the MUSL libc as used by emscripten.  I will attach the IR for that
function in case it helps to see that in addition to the minimized test case.

-- 
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/20150401/7dc5e252/attachment.html>


More information about the llvm-bugs mailing list