<html>
<head>
<base href="http://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 --- - Crash with warnings when deleting incomplete type"
href="http://llvm.org/bugs/show_bug.cgi?id=17162">17162</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash with warnings when deleting incomplete type
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Matthew.Arsenault@amd.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=11167" name="attach_11167" title="Testcase">attachment 11167</a> <a href="attachment.cgi?id=11167&action=edit" title="Testcase">[details]</a></span>
Testcase
This testcase when compiled with -Wall crashes when deleting a pointer with
incomplete type. This only occurs when using the warnings.
This is using r190291
$ /usr/local/bin/clang++ -Wall crash_on_delete_incomplete.cpp -c -o /dev/null
crash_on_delete_incomplete.cpp:16:5: warning: deleting pointer to incomplete
type 'Foo' may cause undefined behavior
[-Wdelete-incomplete]
delete m_foo;
^ ~~~~~
crash_on_delete_incomplete.cpp:3:7: note: forward declaration of 'Foo'
class Foo;
^
0 clang-3.4 0x00000000010b1ec5 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1 clang-3.4 0x00000000010b2323
2 libpthread.so.0 0x00007fb1d4fef870
3 clang-3.4 0x0000000001a6dbd3
4 clang-3.4 0x0000000001a6ee07
5 clang-3.4 0x0000000001a6acfc
6 clang-3.4 0x0000000001a6590d clang::CFG::buildCFG(clang::Decl const*,
clang::Stmt*, clang::ASTContext*, clang::CFG::BuildOptions const&) + 1837
7 clang-3.4 0x0000000001a60c12 clang::AnalysisDeclContext::getCFG() + 98
8 clang-3.4 0x0000000001637177
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
4663
9 clang-3.4 0x000000000139f66f
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 287
10 clang-3.4 0x000000000142cfbe
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 2654
11 clang-3.4 0x000000000138127e
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 270
12 clang-3.4 0x0000000001322f9b
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
1755
13 clang-3.4 0x0000000001331596
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1302
14 clang-3.4 0x00000000013227cb
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 587
15 clang-3.4 0x0000000001322380
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 368
16 clang-3.4 0x0000000001321acd
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2269
17 clang-3.4 0x0000000001321170
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 304
18 clang-3.4 0x000000000131e516 clang::ParseAST(clang::Sema&, bool, bool)
+ 454
19 clang-3.4 0x00000000010c9dd9 clang::CodeGenAction::ExecuteAction() +
73
20 clang-3.4 0x0000000001280357 clang::FrontendAction::Execute() + 87
21 clang-3.4 0x00000000012613dd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 797
22 clang-3.4 0x00000000010b572d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3149
23 clang-3.4 0x00000000006483fd cc1_main(char const**, char const**, char
const*, void*) + 669
24 clang-3.4 0x0000000000646dbc main + 8876
25 libc.so.6 0x00007fb1d4224bc5 __libc_start_main + 245
26 clang-3.4 0x0000000000644a09
Stack dump:
0. Program arguments: /usr/local/bin/clang-3.4 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name crash_on_delete_incomplete.cpp
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-coverage-file /dev/null -resource-dir /usr/local/bin/../lib/clang/3.4
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1/x86_64-unknown-linux-gnu
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1/backward
-internal-isystem
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/x86_64-unknown-linux-gnu/c++/4.8.1
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.4/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -fdeprecated-macro
-fdebug-compilation-dir /home/matt/cods_clang_crash -ferror-limit 19
-fmessage-length 130 -mstackrealign -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /dev/null -x
c++ crash_on_delete_incomplete.cpp
1. <eof> parser at end of file
2. crash_on_delete_incomplete.cpp:15:1: parsing function body '~Bar'
clang-3.4: error: unable to execute command: Segmentation fault (core dumped)</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>