[LLVMbugs] [Bug 23121] clang segfaults when processing macro code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 5 21:56:50 PDT 2015


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

ryan.burn at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #4 from ryan.burn at gmail.com ---
I tried with 234142. This still crashes. Here's stack trace

0  clang-3.7       0x00000000012d6b9a
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 42
1  clang-3.7       0x00000000012d7f5b
2  libpthread.so.0 0x00007fe6c8fe9b10
3  clang-3.7       0x000000000245f04f
clang::TokenLexer::ExpandFunctionArguments() + 2383
4  clang-3.7       0x000000000245e68f clang::TokenLexer::Init(clang::Token&,
clang::SourceLocation, clang::MacroInfo*, clang::MacroArgs*) + 319
5  clang-3.7       0x000000000244337a
clang::Preprocessor::EnterMacro(clang::Token&, clang::SourceLocation,
clang::MacroInfo*, clang::MacroArgs*) + 154
6  clang-3.7       0x00000000024466c9
clang::Preprocessor::HandleMacroExpandedIdentifier(clang::Token&,
clang::MacroDirective*) + 2185
7  clang-3.7       0x000000000245cb7d
clang::Preprocessor::HandleIdentifier(clang::Token&) + 1293
8  clang-3.7       0x000000000245f8a2 clang::TokenLexer::Lex(clang::Token&) +
850
9  clang-3.7       0x000000000245cbf6 clang::Preprocessor::Lex(clang::Token&) +
102
10 clang-3.7       0x0000000002460f1b
clang::MacroArgs::getPreExpArgument(unsigned int, clang::MacroInfo const*,
clang::Preprocessor&) + 331
11 clang-3.7       0x000000000245e8c1
clang::TokenLexer::ExpandFunctionArguments() + 449
12 clang-3.7       0x000000000245e68f clang::TokenLexer::Init(clang::Token&,
clang::SourceLocation, clang::MacroInfo*, clang::MacroArgs*) + 319
13 clang-3.7       0x000000000244337a
clang::Preprocessor::EnterMacro(clang::Token&, clang::SourceLocation,
clang::MacroInfo*, clang::MacroArgs*) + 154
14 clang-3.7       0x00000000024466c9
clang::Preprocessor::HandleMacroExpandedIdentifier(clang::Token&,
clang::MacroDirective*) + 2185
15 clang-3.7       0x000000000245cb7d
clang::Preprocessor::HandleIdentifier(clang::Token&) + 1293
16 clang-3.7       0x000000000245f8a2 clang::TokenLexer::Lex(clang::Token&) +
850
17 clang-3.7       0x000000000245cbf6 clang::Preprocessor::Lex(clang::Token&) +
102
18 clang-3.7       0x0000000001b2db52
clang::Parser::ParseExpressionList(llvm::SmallVectorImpl<clang::Expr*>&,
llvm::SmallVectorImpl<clang::SourceLocation>&, std::__1::function<void ()>) +
98
19 clang-3.7       0x0000000001b017b9
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 2361
20 clang-3.7       0x0000000001affc88
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 2872
21 clang-3.7       0x0000000001aefb3d
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 733
22 clang-3.7       0x0000000001aef640
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 384
23 clang-3.7       0x0000000001aeea54
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2404
24 clang-3.7       0x0000000001aee028
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 360
25 clang-3.7       0x0000000001aead90 clang::ParseAST(clang::Sema&, bool, bool)
+ 256
26 clang-3.7       0x0000000001441f39 clang::FrontendAction::Execute() + 57
27 clang-3.7       0x00000000014188e3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 803
28 clang-3.7       0x00000000014adb0c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3020
29 clang-3.7       0x000000000070b17f cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 719
30 clang-3.7       0x000000000070a6a1 main + 10865
31 libc.so.6       0x00007fe6c8527b95 __libc_start_main + 245
32 clang-3.7       0x0000000000707b0d
Stack dump:
0.    Program arguments: /usr/local/bin/clang-3.7 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name t.cpp -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 -resource-dir /usr/local/bin/../lib/clang/3.7.0
-internal-isystem
/usr/local/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1
-internal-isystem
/usr/local/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/x86_64-unknown-linux-gnu
-internal-isystem
/usr/local/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.7.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/rnburn/bugs/preprocessor -ferror-limit 19
-fmessage-length 125 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/t-394668.o
-x c++ t.cpp 
1.    t.cpp:97:9 <Spelling=<invalid>>: unknown current parser token
clang-3.7: error: unable to execute command: Segmentation fault
clang-3.7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.7.0 (trunk 234142)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.7: 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-3.7: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.7: note: diagnostic msg: /tmp/t-48fc05.cpp
clang-3.7: note: diagnostic msg: /tmp/t-48fc05.sh
clang-3.7: 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/20150406/3334b1b9/attachment.html>


More information about the llvm-bugs mailing list