[LLVMbugs] [Bug 14399] New: clang assertion since r167353

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 20 23:07:52 PST 2012


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

             Bug #: 14399
           Summary: clang assertion since  r167353
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgilmore at mips.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Typescript for reproducing the problem:

$ cat bar.c
void foo_aa()
{
#define /* */ BARC(c, /* */b, a, ...) (a+b+/* */c + __VA_ARGS__ +0)
    iequals(__LINE__, BARC(4,3,2,6,8), 8);
}
$ clang  -c bar.c  -emit-llvm
bar.c:4:2: warning: implicit declaration of function 'iequals' is invalid in
C99 [-Wimplicit-function-declaration]
        iequals(__LINE__, BARC(4,3,2,6,8), 8);
        ^
bar.c:4:20: warning: expression result unused [-Wunused-value]
clang:
/scratch/bb-slaves/mipssw005/LLVM_optimize_install/source/tools/clang/lib/Frontend/TextDiagnostic.cpp:1086:
void clang::TextDiagnostic::highlightRange(const clang::CharSourceRange&,
unsigned int, clang::FileID, const SourceColumnMap&, std::string&, const
clang::SourceManager&): Assertion `StartColNo <= EndColNo && "Invalid range!"'
failed.
0  clang           0x00000000020b701f
1  clang           0x00000000020b8f9a
2  libpthread.so.0 0x00007f8dd46a88f0
3  libc.so.6       0x00007f8dd3997a75 gsignal + 53
4  libc.so.6       0x00007f8dd399b5c0 abort + 384
5  libc.so.6       0x00007f8dd3990941 __assert_fail + 241
6  clang           0x000000000071c774
clang::TextDiagnostic::highlightRange(clang::CharSourceRange const&, unsigned
int, clang::FileID, SourceColumnMap const&, std::string&, clang::SourceManager
const&) + 1748
7  clang           0x000000000071daea
clang::TextDiagnostic::emitSnippetAndCaret(clang::SourceLocation,
clang::DiagnosticsEngine::Level,
llvm::SmallVectorImpl<clang::CharSourceRange>&,
llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const&) + 2394
8  clang           0x0000000000712893
clang::DiagnosticRenderer::emitMacroExpansionsAndCarets(clang::SourceLocation,
clang::DiagnosticsEngine::Level,
llvm::SmallVectorImpl<clang::CharSourceRange>&,
llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const&, unsigned int&,
unsigned int) + 211
9  clang           0x0000000000712ee6
clang::DiagnosticRenderer::emitMacroExpansionsAndCarets(clang::SourceLocation,
clang::DiagnosticsEngine::Level,
llvm::SmallVectorImpl<clang::CharSourceRange>&,
llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const&, unsigned int&,
unsigned int) + 1830
10 clang           0x0000000000713637
clang::DiagnosticRenderer::emitDiagnostic(clang::SourceLocation,
clang::DiagnosticsEngine::Level, llvm::StringRef,
llvm::ArrayRef<clang::CharSourceRange>, llvm::ArrayRef<clang::FixItHint>,
clang::SourceManager const*, llvm::PointerUnion<clang::Diagnostic const*,
clang::StoredDiagnostic const*>) + 983
11 clang           0x00000000006dba51
clang::TextDiagnosticPrinter::HandleDiagnostic(clang::DiagnosticsEngine::Level,
clang::Diagnostic const&) + 561
12 clang           0x00000000013da8a4
clang::DiagnosticIDs::EmitDiag(clang::DiagnosticsEngine&,
clang::DiagnosticIDs::Level) const + 52
13 clang           0x00000000013dcbde
clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const + 462
14 clang           0x00000000013d64e4
clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) + 36
15 clang           0x0000000000a3e99e
clang::Sema::EmitCurrentDiagnostic(unsigned int) + 862
16 clang           0x0000000000a4700f
17 clang           0x0000000000b67d0d
clang::Sema::DiagRuntimeBehavior(clang::SourceLocation, clang::Stmt const*,
clang::PartialDiagnostic const&) + 1565
18 clang           0x0000000000c789e8
clang::Sema::DiagnoseUnusedExprResult(clang::Stmt const*) + 456
19 clang           0x0000000000b8aafe
clang::Sema::CreateBuiltinBinOp(clang::SourceLocation,
clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 2862
20 clang           0x0000000000b8aed3 clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) +
259
21 clang           0x0000000000b8b286 clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 278
22 clang           0x00000000009e7dc0
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level) + 2400
23 clang           0x00000000009e9349
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 25
24 clang           0x00000000009ebaa4
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) + 2500
25 clang           0x00000000009e5f3a clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 698
26 clang           0x00000000009e73dd clang::Parser::ParseCastExpression(bool,
bool, clang::Parser::TypeCastState) + 29
27 clang           0x00000000009e8def
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 31
28 clang           0x00000000009e8ec2
clang::Parser::ParseExpressionList(llvm::SmallVectorImpl<clang::Expr*>&,
llvm::SmallVectorImpl<clang::SourceLocation>&, void
(clang::Sema::*)(clang::Scope*, clang::Expr*, llvm::ArrayRef<clang::Expr*>),
clang::Expr*) + 130
29 clang           0x00000000009e96ba
clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*,
true>) + 874
30 clang           0x00000000009e5d78 clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 248
31 clang           0x00000000009e73dd clang::Parser::ParseCastExpression(bool,
bool, clang::Parser::TypeCastState) + 29
32 clang           0x00000000009e8def
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 31
33 clang           0x00000000009e9339
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 9
34 clang           0x0000000000a191e8 clang::Parser::ParseExprStatement() + 72
35 clang           0x0000000000a14605
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 1909
36 clang           0x0000000000a1479e
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 142
37 clang           0x0000000000a15801
clang::Parser::ParseCompoundStatementBody(bool) + 1841
38 clang           0x0000000000a15e6a
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 154
39 clang           0x00000000009b9aa9
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
2617
40 clang           0x00000000009cc64d
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 3085
41 clang           0x00000000009b5099
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 249
42 clang           0x00000000009b56c4
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 804
43 clang           0x00000000009b70ba
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1674
44 clang           0x00000000009b7652
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 194
45 clang           0x00000000009ae548 clang::ParseAST(clang::Sema&, bool, bool)
+ 296
46 clang           0x00000000008336fe clang::CodeGenAction::ExecuteAction() +
78
47 clang           0x00000000006ba8b9 clang::FrontendAction::Execute() + 185
48 clang           0x0000000000697655
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 341
49 clang           0x000000000067f20c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1708
50 clang           0x00000000006767b8 cc1_main(char const**, char const**, char
const*, void*) + 1240
51 clang           0x000000000067d847 main + 7431
52 libc.so.6       0x00007f8dd3982c4d __libc_start_main + 253
53 clang           0x0000000000675749
Stack dump:
0.    Program arguments:
/mips/proj/build-compiler/log.2012-11-19/LLVM-clang/install-master-9eecb35d6b3cd772b57620f37deb065b2f426aae-0c5d005cd383e2d8c2bea388419ac26ace12e0f0/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -disable-free
-main-file-name bar.c -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.20.1 -momit-leaf-frame-pointer -coverage-file
/scratch/dgilmore/delta_bug669/bar.o -resource-dir
/mips/proj/build-compiler/log.2012-11-19/LLVM-clang/install-master-9eecb35d6b3cd772b57620f37deb065b2f426aae-0c5d005cd383e2d8c2bea388419ac26ace12e0f0/bin/../lib/clang/3.3
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/local/include -internal-isystem
/mips/proj/build-compiler/log.2012-11-19/LLVM-clang/install-master-9eecb35d6b3cd772b57620f37deb065b2f426aae-0c5d005cd383e2d8c2bea388419ac26ace12e0f0/bin/../lib/clang/3.3/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /scratch/dgilmore/delta_bug669 -ferror-limit 19
-fmessage-length 154 -mstackrealign -fobjc-runtime=gcc
-fdiagnostics-show-option -o bar.o -x c bar.c 
1.    bar.c:4:20 <Spelling=bar.c:3:67>: current parser token ')'
2.    bar.c:2:1: parsing function body 'foo_aa'
3.    bar.c:2:1: in compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (git://dmz-portal.mips.com/clang.git
0c5d005cd383e2d8c2bea388419ac26ace12e0f0) (git://dmz-portal.mips.com/llvm.git
9eecb35d6b3cd772b57620f37deb065b2f426aae)
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/bar-3QBo5S.c
clang: note: diagnostic msg: /tmp/bar-3QBo5S.sh
clang: note: diagnostic msg: 

********************
$

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list