<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 --- - Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed on xmlparse.c"
href="https://llvm.org/bugs/show_bug.cgi?id=26464">26464</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed on xmlparse.c
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>lonico@gmail.com
</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>Created <span class=""><a href="attachment.cgi?id=15818" name="attach_15818" title="zip file containing source file, sh script and log.">attachment 15818</a> <a href="attachment.cgi?id=15818&action=edit" title="zip file containing source file, sh script and log.">[details]</a></span>
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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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:</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>