<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang++ segfault on invalid code"
href="http://llvm.org/bugs/show_bug.cgi?id=20344">20344</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang++ segfault on invalid code
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>regehr@cs.utah.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>regehr@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@regehr-M51AC:~$ cat foo.cpp
a
{
__builtin_va_start (0, 0)
regehr@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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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:
********************</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>