[llvm-bugs] [Bug 33626] New: crash in MemorySSA

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 28 10:21:20 PDT 2017


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

            Bug ID: 33626
           Summary: crash in MemorySSA
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: matthias.krueger at famsik.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 18729
  --> https://bugs.llvm.org/attachment.cgi?id=18729&action=edit
files clang told to attach

There's a crash happening sometimes in MemorySSA when compiling the attached
code at -O3.

It does not always crash for some reason, only one in 10 times crashes for me
(with the reduced version)

I hope I didn't butcher the code too much while trying to reduce.

The binary used is an optimized clang/llvm build (selfhost).
While doing this selfhost, there was no crash to be seen though.


#0 0x0000000001a89a59 PrintStackTraceSignalHandler(void*)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x1a89a59)
#1 0x0000000001a88b56 SignalHandler(int)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x1a88b56)
#2 0x00007f6f676c55b0 __restore_rt (/lib64/libpthread.so.0+0x115b0)
#3 0x000000000189fdf0 llvm::MemorySSA::OptimizeUses::optimizeUses()
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x189fdf0)
#4 0x000000000189e321 llvm::MemorySSA::buildMemorySSA()
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x189e321)
#5 0x000000000189ddfe
llvm::MemorySSAWrapperPass::runOnFunction(llvm::Function&)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x189ddfe)
#6 0x0000000001626026 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x1626026)
#7 0x000000000155b22b (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x155b22b)
#8 0x0000000001626e0c llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x1626e0c)
#9 0x0000000001f21bc9 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> >)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x1f21bc9)
#10 0x0000000003f569c9
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x3f569c9)
#11 0x000000000297e3d4 clang::ParseAST(clang::Sema&, bool, bool)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x297e3d4)
#12 0x00000000021cf0c9 clang::FrontendAction::Execute()
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x21cf0c9)
#13 0x000000000214f838
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x214f838)
#14 0x000000000226972e
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0x226972e)
#15 0x0000000000f86b04 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0xf86b04)
#16 0x0000000000f8584e main
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0xf8584e)
#17 0x00007f6f66218401 __libc_start_main (/lib64/libc.so.6+0x20401)
#18 0x0000000000f8202a _start
(/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0+0xf8202a)
Stack dump:
0.      Program arguments:
/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang-5.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name suppressions.cpp -mrelocation-model static
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer
-dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/home/matthias/vcs/github/cppcheck/lib/suppressions.gcno -resource-dir
/home/matthias/LLVM/LLVM_dev/stage_2/build/lib/clang/5.0.0 -I lib -I
externals/simplecpp -I externals/tinyxml -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../include/c++/6.3.1
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../include/c++/6.3.1/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../include/c++/6.3.1/backward
-internal-isystem /usr/local/include -internal-isystem
/home/matthias/LLVM/LLVM_dev/stage_2/build/lib/clang/5.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-std=c++0x -fdeprecated-macro -fdebug-compilation-dir
/home/matthias/vcs/github/cppcheck -ferror-limit 19 -fmessage-length 316
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o lib/suppressions.o -x
c++ lib/suppressions.cpp 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'lib/suppressions.cpp'.
4.      Running pass 'Memory SSA' on function
'@_ZNSt11_Deque_baseISt4pairIPKcS2_ESaIS3_EE17_M_initialize_mapEm'
clang-5.0: error: unable to execute command: Segmentation fault (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (/home/matthias/LLVM/LLVM_dev/stage_1//llvm/tools/clang
ddb61cae6a5e7f3f0bc5da4290334368d03da2a0)
(/home/matthias/LLVM/LLVM_dev/stage_1//llvm
7a4e530f9e9c0e4bb287b6dc8fdee0eadc34e885)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/matthias/LLVM/LLVM_dev/stage_2/build/bin
clang-5.0: 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-5.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-5.0: note: diagnostic msg: /tmp/suppressions-e4bd4b.cpp
clang-5.0: note: diagnostic msg: /tmp/suppressions-e4bd4b.sh
clang-5.0: note: diagnostic msg: 

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



Original code from github.com/danmar/cppcheck @ 15b0eb4 invocated as
clang++ -Ilib -Iexternals/simplecpp -Iexternals/tinyxml   -O3 -std=c++0x  -c -o
lib/suppressions.o lib/suppressions.cpp

LLVM @ 7a4e530f9e9c0e4bb287b6dc8fdee0eadc34e885 / trunk at 306557
clang @ ddb61cae6a5e7f3f0bc5da4290334368d03da2a0 / trunk at 306555 

Manually (somewhat-)reduced c++ snippet is attached in form of the sources
clang throws into /tmp after crashing.

Thanks

-- 
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/20170628/d3998cec/attachment.html>


More information about the llvm-bugs mailing list