[LLVMbugs] [Bug 21601] New: clang crashes on invalid(?) code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 18 13:24:37 PST 2014


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

            Bug ID: 21601
           Summary: clang crashes on invalid(?) code
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: t.poechtrager at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13366
  --> http://llvm.org/bugs/attachment.cgi?id=13366&action=edit
preprocessed source file + runscript

$ cat crash.cpp
#include <unordered_map>
std::unordered_map<unsigned, unsigned> test[2] = {};
// or std::unordered_map<unsigned, unsigned> test[2]{};

---

Version: r222237 (3.5 seems also affected).

$ clang++ crash.cpp -std=c++11
#0 0x11fcf68 llvm::sys::PrintStackTrace(_IO_FILE*)
(/opt/other/llvm-trunk/bin/clang-3.6+0x11fcf68)
#1 0x11fe4eb SignalHandler(int) (/opt/other/llvm-trunk/bin/clang-3.6+0x11fe4eb)
#2 0x7fa56f41bc90 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xfc90)
#3 0x1e62dd7 (anonymous
namespace)::InitListChecker::PerformEmptyInit(clang::Sema&,
clang::SourceLocation, clang::InitializedEntity const&, bool)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1e62dd7)
#4 0x1e61e94 (anonymous
namespace)::InitListChecker::FillInEmptyInitializations(clang::InitializedEntity
const&, clang::InitListExpr*, bool&)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1e61e94)
#5 0x1e5d50e (anonymous
namespace)::InitListChecker::InitListChecker(clang::Sema&,
clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1e5d50e)
#6 0x1e54426 clang::InitializationSequence::Perform(clang::Sema&,
clang::InitializedEntity const&, clang::InitializationKind const&,
llvm::MutableArrayRef<clang::Expr*>, clang::QualType*)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1e54426)
#7 0x1cb30fa clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*,
bool, bool) (/opt/other/llvm-trunk/bin/clang-3.6+0x1cb30fa)
#8 0x1a6c1a9
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1a6c1a9)
#9 0x1a6a01f clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned
int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1a6a01f)
#10 0x1a593da
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1a593da)
#11 0x1a58eb0
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1a58eb0)
#12 0x1a58281
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/opt/other/llvm-trunk/bin/clang-3.6+0x1a58281)
#13 0x1a57528
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1a57528)
#14 0x1a53ca6 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/other/llvm-trunk/bin/clang-3.6+0x1a53ca6)
#15 0x137a219 clang::FrontendAction::Execute()
(/opt/other/llvm-trunk/bin/clang-3.6+0x137a219)
#16 0x134c7e3 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/other/llvm-trunk/bin/clang-3.6+0x134c7e3)
#17 0x13f0229 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/other/llvm-trunk/bin/clang-3.6+0x13f0229)
#18 0x6bafcc cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/opt/other/llvm-trunk/bin/clang-3.6+0x6bafcc)
#19 0x6b9d69 main (/opt/other/llvm-trunk/bin/clang-3.6+0x6b9d69)
#20 0x7fa56e623ec5 __libc_start_main
/build/buildd/glibc-2.19/csu/libc-start.c:321:0
#21 0x6b6bda _start (/opt/other/llvm-trunk/bin/clang-3.6+0x6b6bda)
Stack dump:
0.      Program arguments: /opt/other/llvm-trunk/bin/clang-3.6 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name crash.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -resource-dir /opt/other/llvm-trunk/bin/../lib/clang/3.6.0
-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
/opt/other/llvm-trunk/bin/../lib/clang/3.6.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/thomas/tmp -ferror-limit 19 -fmessage-length 237
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/crash-13cc96.o -x c++
crash.cpp 
1.      crash.cpp:2:52: current parser token ';'
clang-3.6: error: unable to execute command: Segmentation fault (core dumped)
clang-3.6: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.6: 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-3.6: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.6: note: diagnostic msg: /tmp/crash-a69667.cpp
clang-3.6: note: diagnostic msg: /tmp/crash-a69667.sh
clang-3.6: 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/20141118/edc0cdf9/attachment.html>


More information about the llvm-bugs mailing list