[llvm-bugs] [Bug 30380] New: Crash in clang parser while declaring a deprecated struct

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 14 06:08:16 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30380

            Bug ID: 30380
           Summary: Crash in clang parser while declaring a deprecated
                    struct
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: bero at lindev.ch
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ 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
http://llvm.org/bugs/ 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.

-- 
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/20160914/ad540244/attachment.html>


More information about the llvm-bugs mailing list