<html>
<head>
<base href="https://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 --- - Crash in clang parser while declaring a deprecated struct"
href="https://llvm.org/bugs/show_bug.cgi?id=30380">30380</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash in clang parser while declaring a deprecated struct
</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>bero@lindev.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ cat test.c
struct __attribute__((__deprecated__)) a A;
$ clang test.c
test.c:1:40: warning: 'a' is deprecated [-Wdeprecated-declarations]
struct __attribute__((__deprecated__)) a A;
^
test.c:1:40: note: 'a' has been explicitly marked deprecated here
#0 0x00007fbdb1b78959 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib64/libLLVMSupport.so.4.0+0xb4959)
#1 0x00007fbdb1b77636 llvm::sys::RunSignalHandlers()
(/usr/lib64/libLLVMSupport.so.4.0+0xb3636)
#2 0x00007fbdb1b78e32 (/usr/lib64/libLLVMSupport.so.4.0+0xb4e32)
#3 0x00007fbdb1414f60 __restore_rt (/lib64/libc.so.6+0x2ef60)
#4 0x00007fbdb0268c96 clang::sema::DelayedDiagnostic::Destroy()
(/usr/lib64/libclangSema.so.4.0+0xccc96)
#5 0x00007fbdb0805672 (/usr/lib64/libclangParse.so.4.0+0x45672)
#6 0x00007fbdb07fa35f clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/lib64/libclangParse.so.4.0+0x3a35f)
#7 0x00007fbdb085562b
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/lib64/libclangParse.so.4.0+0x9562b)
#8 0x00007fbdb08551cf
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/lib64/libclangParse.so.4.0+0x951cf)
#9 0x00007fbdb0854aa5
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/lib64/libclangParse.so.4.0+0x94aa5)
#10 0x00007fbdb08541d3
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/lib64/libclangParse.so.4.0+0x941d3)
#11 0x00007fbdb0853dde
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/lib64/libclangParse.so.4.0+0x93dde)
#12 0x00007fbdb07ec7d9 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib64/libclangParse.so.4.0+0x2c7d9)
#13 0x00007fbdb2d371b9 clang::CodeGenAction::ExecuteAction()
(/usr/lib64/libclangCodeGen.so.4.0+0x1da1b9)
#14 0x00007fbdb29a7cbc clang::FrontendAction::Execute()
(/usr/lib64/libclangFrontend.so.4.0+0x9acbc)
#15 0x00007fbdb297cd93
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib64/libclangFrontend.so.4.0+0x6fd93)
#16 0x00007fbdb2906c8b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib64/libclangFrontendTool.so.4.0+0x5c8b)
#17 0x0000000000410329 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-4.0+0x410329)
#18 0x000000000040e570 main (/usr/bin/clang-4.0+0x40e570)
#19 0x00007fbdb1406dbe __libc_start_main (/lib64/libc.so.6+0x20dbe)
#20 0x000000000040c4ca _start (/usr/bin/clang-4.0+0x40c4ca)
Stack dump:
0. Program arguments: /usr/bin/clang-4.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
kservicetest-e6210b.c -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
-debugger-tuning=gdb -resource-dir /usr/bin/../lib64/clang/4.0.0
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib64/clang/4.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdebug-compilation-dir /tmp
-ferror-limit 19 -fmessage-length 108 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/kservicetest-e6210b-e62607.o -x c test.c
1. <eof> parser at end of file
clang-4.0: error: unable to execute command: Segmentation fault (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-4.0: 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-4.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/test-3fa455.c
clang-4.0: note: diagnostic msg: /tmp/test-3fa455.sh
clang-4.0: note: diagnostic msg:
********************
The test case is invalid code, but it's extracted from valid code showing the
same crash.</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>