[llvm-bugs] [Bug 25815] New: frontend segfault with clang-3.6 -g -std=c++14 -fsanitize=memory -O2

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 13 10:56:52 PST 2015


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

            Bug ID: 25815
           Summary: frontend segfault with clang-3.6 -g -std=c++14
                    -fsanitize=memory -O2
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bsilver16384+llvm at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15436
  --> https://llvm.org/bugs/attachment.cgi?id=15436&action=edit
preprocessed source code

Clang crashes when compiling gperftools with "-g -std=c++14 -fsanitize=memory
-O2". I simplified the relevant source file a lot, and the only interesting
part I see is defining a custom "void operator delete(void* p) throw()".

I can reproduce the crash with the official clang-3.6.2 build and Debian's
version 1:3.6.2~svn240577-1~exp1, but not the official 3.7.0 build.

$ /tmp/new_clang/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/bin/clang -g
-std=c++14 -fsanitize=memory -O2 -c /tmp/tcmalloc.cc -o /tmp/tcmalloc.o
0  clang           0x00000000024482f8 llvm::sys::PrintStackTrace(_IO_FILE*) +
40
1  clang           0x000000000244973b
2  libpthread.so.0 0x00007f82592cf8d0
3  clang           0x0000000001e3d6e9 llvm::DwarfUnit::addType(llvm::DIE&,
llvm::DIType, llvm::dwarf::Attribute) + 25
4  clang           0x0000000001e549b9
llvm::DwarfCompileUnit::applyVariableAttributes(llvm::DbgVariable const&,
llvm::DIE&) + 249
5  clang           0x0000000001e23a3f
llvm::DwarfDebug::finishVariableDefinitions() + 47
6  clang           0x0000000001e23f04 llvm::DwarfDebug::finalizeModuleInfo() +
100
7  clang           0x0000000001e2470f llvm::DwarfDebug::endModule() + 47
8  clang           0x0000000001e16d15
llvm::AsmPrinter::doFinalization(llvm::Module&) + 1829
9  clang           0x00000000023e1978
llvm::FPPassManager::doFinalization(llvm::Module&) + 72
10 clang           0x00000000023e1d77
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 999
11 clang           0x00000000008f05fd
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) +
7773
12 clang           0x00000000008e64ab
13 clang           0x0000000000a6a2a3 clang::ParseAST(clang::Sema&, bool, bool)
+ 483
14 clang           0x0000000000716c79 clang::FrontendAction::Execute() + 57
15 clang           0x00000000006eba03
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 803
16 clang           0x00000000006d1e5b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2795
17 clang           0x00000000006c9b7e cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 702
18 clang           0x00000000006d0b82 main + 11506
19 libc.so.6       0x00007f8258512b45 __libc_start_main + 245
20 clang           0x00000000006c97f1
Stack dump:
0.    Program arguments:
/tmp/new_clang/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-main-file-name tcmalloc.cc -mrelocation-model pic -pic-level 2 -pie-level 2
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.24
-momit-leaf-frame-pointer -g -dwarf-column-info -coverage-file /tmp/tcmalloc.o
-resource-dir
/tmp/new_clang/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/bin/../lib/clang/3.6.2
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward
-internal-isystem /usr/local/include -internal-isystem
/tmp/new_clang/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/bin/../lib/clang/3.6.2/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-std=c++14 -fdeprecated-macro -fdebug-compilation-dir
/home/brian/Desktop/peloton-tech-code -ferror-limit 19 -fmessage-length 211
-fsanitize=memory -fno-assume-sane-operator-new -mstackrealign
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-vectorize-loops -vectorize-slp -o /tmp/tcmalloc.o -x c++ /tmp/tcmalloc.cc 
1.    <eof> parser at end of file
2.    Code generation
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.2 (tags/RELEASE_362/final)
Target: x86_64-unknown-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/tcmalloc-e2e0f7.cpp
clang: note: diagnostic msg: /tmp/tcmalloc-e2e0f7.sh
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/20151213/e5114066/attachment.html>


More information about the llvm-bugs mailing list