[LLVMbugs] [Bug 20344] New: clang++ segfault on invalid code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 17 11:11:43 PDT 2014


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

            Bug ID: 20344
           Summary: clang++ segfault on invalid code
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

regehr at regehr-M51AC:~$ clang++ -v
clang version 3.5.0 (trunk 213276)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
regehr at regehr-M51AC:~$ cat foo.cpp 
a
{
    __builtin_va_start (0, 0)
regehr at regehr-M51AC:~$ clang++ -std=c++11 foo.cpp
foo.cpp:1:1: error: C++ requires a type specifier for all declarations
a
^
0  clang           0x00000000026fbef5 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1  clang           0x00000000026fc643
2  libpthread.so.0 0x00007fc1a29ec340
3  clang           0x0000000000b7a483
clang::Sema::SemaBuiltinVAStart(clang::CallExpr*) + 1379
4  clang           0x0000000000b78cc7
clang::Sema::CheckBuiltinFunctionCall(unsigned int, clang::CallExpr*) + 1591
5  clang           0x0000000000cf8594
clang::Sema::BuildResolvedCallExpr(clang::Expr*, clang::NamedDecl*,
clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation,
clang::Expr*, bool) + 612
6  clang           0x0000000000ce5427 clang::Sema::ActOnCallExpr(clang::Scope*,
clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool) + 2071
7  clang           0x0000000000ae2a6f
clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*,
true>) + 4255
8  clang           0x0000000000ae494c clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 6460
9  clang           0x0000000000ae05bd
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 125
10 clang           0x0000000000afc47a clang::Parser::ParseBraceInitializer() +
634
11 clang           0x0000000000abe1a8
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 4520
12 clang           0x0000000000abbede
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1774
13 clang           0x0000000000aa9728
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 792
14 clang           0x0000000000aa9103
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 403
15 clang           0x0000000000aa81e0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 3024
16 clang           0x0000000000aa7519
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 505
17 clang           0x0000000000aa31c0 clang::ParseAST(clang::Sema&, bool, bool)
+ 256
18 clang           0x00000000008c83d6 clang::CodeGenAction::ExecuteAction() +
198
19 clang           0x00000000006f907e clang::FrontendAction::Execute() + 62
20 clang           0x00000000006ce593
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 867
21 clang           0x00000000006b2439
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3065
22 clang           0x00000000006a9881 cc1_main(char const**, char const**, char
const*, void*) + 657
23 clang           0x00000000006b0279 main + 9241
24 libc.so.6       0x00007fc1a19e4ec5 __libc_start_main + 245
25 clang           0x00000000006a952d
Stack dump:
0.    Program arguments:
/home/regehr/z/compiler-install/llvm-r213276-install/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
foo.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 2.24 -dwarf-column-info -resource-dir
/home/regehr/z/compiler-install/llvm-r213276-install/bin/../lib/clang/3.5.0
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem /usr/local/include -internal-isystem
/home/regehr/z/compiler-install/llvm-r213276-install/bin/../lib/clang/3.5.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/regehr
-ferror-limit 19 -fmessage-length 100 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/foo-a42d35.o -x c++ foo.cpp 
1.    foo.cpp:3:29: current parser token ')'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (trunk 213276)
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/foo-5f62ed.cpp
clang: note: diagnostic msg: /tmp/foo-5f62ed.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/20140717/82f82652/attachment.html>


More information about the llvm-bugs mailing list