[llvm-bugs] [Bug 32445] New: clang++ 4.0 crash

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 27 17:37:50 PDT 2017


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

            Bug ID: 32445
           Summary: clang++ 4.0 crash
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pgsql at j-davis.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Created attachment 18185
  --> https://bugs.llvm.org/attachment.cgi?id=18185&action=edit
Small example

This started out as a large case (preprocessed file was ~5MB) and I cut it down
with creduce. Unfortunately, it's still very sensitive to the environment so I
don't know if others will be able to reproduce it. Changing minor things, like
identifier name lengths, or even the path to the source file, allow it to
succeed.

Perhaps using a debug build or sanitizer build of clang and compiling this will
reveal the problem even if it doesn't crash on a release build.

Clang was compiled with:
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_FLAGS="-D__USE_XOPEN2K8" \
    -DCMAKE_CXX_FLAGS="-D__USE_XOPEN2K8 -O3 -march=core2 -std=gnu++11" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCLANG_ENABLE_STATIC_ANALYZER=1 \
    -DCLANG_HAVE_LIBXML=0 \
    -DLLVM_ENABLE_CXX1Y=1 \
    -DLLVM_ENABLE_RTTI=1 \
    -DLLVM_ENABLE_TERMINFO=0 \
    -DLLVM_ENABLE_ZLIB=0 \
    -DLLVM_USE_INTEL_JITEVENTS=1 \
    -DLLVM_TARGETS_TO_BUILD=X86 \
    -DLLVM_BUILD_LLVM_DYLIB=ON

and uses gcc 4.9.3.

and invoked with:
clang++ \
  -v \
  -o crash.o -c crash2.cpp \
  -std=c++11 -g \
  -flto=thin -O3 -fstrict-vtable-pointers \
  -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-sizeof-pointer-memaccess
-Wno-unused-local-typedefs \
  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-aliasing \
  > outfile 2>&1

The output contains:
...
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'crash2.cpp'.
4.      Running pass 'Global Value Numbering' on function
'@_ZL11dddd_ee_fffP1m'
clang-4.0: error: unable to execute command: Segmentation fault
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: [redacted]
clang-4.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the cr\
ash backtrace, preprocessed source, and associated run script.
clang-4.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-4.0: note: diagnostic msg: /tmp/crash2-1f46f3.cpp
clang-4.0: note: diagnostic msg: /tmp/crash2-1f46f3.sh
clang-4.0: note: diagnostic msg:

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


The shell script in question does not actually reproduce the problem for me,
and it contains some information about my environment that I'd rather not
include in a public report, so I didn't attach those files.

If nobody else can reproduce/solve this issue, then I can put some more time in
later to narrow down exactly how to repro it outside of my environment.

-- 
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/20170328/b7a511ba/attachment.html>


More information about the llvm-bugs mailing list