[llvm-bugs] [Bug 26464] New: Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed on xmlparse.c

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 3 14:31:13 PST 2016


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

            Bug ID: 26464
           Summary: Assertion `!isNull() && "Cannot retrieve a NULL type
                    pointer"' failed on xmlparse.c
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lonico at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15818
  --> https://llvm.org/bugs/attachment.cgi?id=15818&action=edit
zip file containing source file, sh script and log.

I could reproduce the issue on a small sample:

#define poolChop(pool) ((void)--(pool->ptr))

typedef struct {
    char *ptr;
} STRING_POOL;

int main(void) {

    STRING_POOL apool = {"abcd"};
    STRING_POOL *pool = &apool;
    poolChop(pool);
    return 0;
}

This was compiling OK on Monday, but fails this morning.  Changing to ((void)
(--(pool->ptr))) is a work-around.


clang-3.9:
/x/eng/build8/scratch/laurentn/llvm-play/sources/llvm_netapp_integration_prod2/llvm/tools/clang/include/clang/AST/Type.h:589:
const clang::ExtQualsTypeCommonBase *clang::QualType::getCommonPtr() const:
Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed.
0  clang-3.9       0x0000000000f7b098
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-3.9       0x0000000000f79876 llvm::sys::RunSignalHandlers() + 54
2  clang-3.9       0x0000000000f7b77a
3  libpthread.so.0 0x00007f787184caa0
4  libc.so.6       0x00007f7870b4e22b gsignal + 59
5  libc.so.6       0x00007f7870b4f6e8 abort + 328
6  libc.so.6       0x00007f7870b46e7f __assert_fail + 223
7  clang-3.9       0x0000000001e073d3 clang::Sema::BuildUnaryOp(clang::Scope*,
clang::SourceLocation, clang::UnaryOperatorKind, clang::Expr*) + 867
8  clang-3.9       0x0000000001a89b48 clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 488
9  clang-3.9       0x0000000001a90cb8
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) + 7320
10 clang-3.9       0x0000000001a89e58 clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 1272
11 clang-3.9       0x0000000001a86bfc
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 156
12 clang-3.9       0x0000000001a8f8df
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) + 2239
13 clang-3.9       0x0000000001a89e58 clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 1272
14 clang-3.9       0x0000000001a86bfc
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 156
15 clang-3.9       0x0000000001a86b49
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 9
16 clang-3.9       0x0000000001acd5c9 clang::Parser::ParseExprStatement() + 41
17 clang-3.9       0x0000000001acc83c
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&) + 1532
18 clang-3.9       0x0000000001acc1b1
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*) + 145
19 clang-3.9       0x0000000001ad3a94
clang::Parser::ParseCompoundStatementBody(bool) + 1780
20 clang-3.9       0x0000000001ad43dc
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 428
21 clang-3.9       0x0000000001a45a02
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
2162
22 clang-3.9       0x0000000001a5dc5b
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 2603
23 clang-3.9       0x0000000001a44fa6
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 790
24 clang-3.9       0x0000000001a44970
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 416
25 clang-3.9       0x0000000001a4374a
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1642
26 clang-3.9       0x0000000001a42fcc
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 540
27 clang-3.9       0x0000000001a3eb26 clang::ParseAST(clang::Sema&, bool, bool)
+ 518
28 clang-3.9       0x00000000013d79c5 clang::FrontendAction::Execute() + 69
29 clang-3.9       0x00000000013a3a41
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1153
30 clang-3.9       0x00000000014561db
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3019
31 clang-3.9       0x00000000006847da cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 1018
32 clang-3.9       0x00000000006833eb main + 12523
33 libc.so.6       0x00007f7870b3a675 __libc_start_main + 245
34 clang-3.9       0x00000000006801cd
Stack dump:
0.    Program arguments:
/x/eng/build8/scratch/laurentn/llvm-play/install_dirs/llvm_netapp_integration_prod2_03/bin/clang-3.9
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name testme.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
/x/eng/build8/scratch/laurentn/llvm-play/install_dirs/llvm_netapp_integration_prod2_03/bin/../lib/clang/3.9.0
-internal-isystem /usr/local/include -internal-isystem
/x/eng/build8/scratch/laurentn/llvm-play/install_dirs/llvm_netapp_integration_prod2_03/bin/../lib/clang/3.9.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /u/laurentn/p4/dev-Jan29-utestossh -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fdiagnostics-show-option -o
/tmp/testme-4206a7.o -x c testme.c 
1.    testme.c:12:5 <Spelling=testme.c:2:44>: current parser token ')'
2.    testme.c:8:16: parsing function body 'main'
3.    testme.c:8:16: in compound statement ('{}')
clang-3.9: error: unable to execute command: Aborted
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/x/eng/build8/scratch/laurentn/llvm-play/install_dirs/llvm_netapp_integration_prod2_03/bin
clang-3.9: 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.9: 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.9: note: diagnostic msg: /tmp/testme-e0098e.c
clang-3.9: note: diagnostic msg: /tmp/testme-e0098e.sh
clang-3.9: 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/20160203/4507a85b/attachment.html>


More information about the llvm-bugs mailing list