[LLVMbugs] [Bug 19993] New: clang crashes on invalid code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 10 05:19:06 PDT 2014


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

            Bug ID: 19993
           Summary: clang crashes on invalid code
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm-bugs at skybert.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12634
  --> http://llvm.org/bugs/attachment.cgi?id=12634&action=edit
the run script

This simple thing makes clang crash:
-----
class test
{
public:
    static int bob = delete;
};
-----
Removing 'static' removes crash.

# clang++ -std=c++11 test.cpp
test.cpp:4:22: error: only functions can have deleted definitions
    static int bob = delete;
                     ^
clang: /home/build/rpmwork/BUILD/llvm-3.4/include/llvm/Support/Casting.h:97:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
clang::ParenListExpr; From = clang::Expr]: Assertion `Val && "isa<> used on a
null pointer"' failed.
0  clang           0x0000000001e50c62 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang           0x0000000001e50929
2  libpthread.so.0 0x00007ff6a554f7c0
3  libc.so.6       0x00007ff6a43f4b55 gsignal + 53
4  libc.so.6       0x00007ff6a43f6131 abort + 385
5  libc.so.6       0x00007ff6a43eda10 __assert_fail + 240
6  clang           0x0000000000aba8fb
clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool, bool) +
6251
7  clang           0x00000000009c5099
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 3081
8  clang           0x00000000009c70b1
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 1681
9  clang           0x00000000009c8ea7
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 4519
10 clang           0x00000000009b0dba
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4490
11 clang           0x000000000099e684
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 84
12 clang           0x000000000099edb6
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 1030
13 clang           0x00000000009a314a
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 330
14 clang           0x00000000009a36c5
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 181
15 clang           0x000000000099c320 clang::ParseAST(clang::Sema&, bool, bool)
+ 352
16 clang           0x0000000000811caf clang::CodeGenAction::ExecuteAction() +
79
17 clang           0x00000000006910d9 clang::FrontendAction::Execute() + 249
18 clang           0x00000000006708fa
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 346
19 clang           0x0000000000659a79
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1785
20 clang           0x0000000000652598 cc1_main(char const**, char const**, char
const*, void*) + 984
21 clang           0x0000000000656ebc main + 700
22 libc.so.6       0x00007ff6a43e0c36 __libc_start_main + 230
23 clang           0x00000000006513e9
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-suse-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name test.cpp -mrelocation-model
static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 11
-resource-dir /usr/bin/../lib/clang/3.4 -internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/x86_64-suse-linux
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/backward
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/x86_64-suse-linux/c++/4.9
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.4/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/magne/work/packages/meos-utils++/test
-ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o
/tmp/test-e47058.o -x c++ test.cpp 
1.    test.cpp:4:28: current parser token ';'
2.    test.cpp:1:1: parsing struct/union/class body 'test'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-suse-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/test-07fba5.cpp
clang: note: diagnostic msg: /tmp/test-07fba5.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/20140610/04b85c77/attachment.html>


More information about the llvm-bugs mailing list