[llvm-bugs] [Bug 47270] New: clang crashes on not finding a destructor during pch deserialization
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Aug 21 06:19:39 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=47270
Bug ID: 47270
Summary: clang crashes on not finding a destructor during pch
deserialization
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: hokein at google.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
$ cat /tmp/t5.cpp
#ifndef HEADER
#define HEADER
class Base {
public:
~Base();
};
class Body : public Base {
~Body() {}
};
class Face : public Base {
public:
~Body() {};
};
#else
Face f;
#endif
$ ./bin/clang -cc1 -emit-pch -std=c++17 -fallow-pch-with-compiler-errors -o
/tmp/test.pch /tmp/t5.cpp
<<<
/tmp/t5.cpp:14:3: error: expected the class name after '~' to name the
enclosing class
~Body() {};
^
$ ./bin/clang -cc1 -include-pch /tmp/test.pch -ast-dump-all -std=c++17
-fno-validate-pch -o - /tmp/t5.cpp
<<<
clang: llvm-project/llvm/include/llvm/Support/Casting.h:104: static bool
llvm::isa_impl_cl<clang::CXXDestructorDecl, const clang::CXXMethodDecl
*>::doit(const From *) [To = clang::CXXDestructorDecl, From = const
clang::CXXMethodDecl *]: Assertion `Val && "isa<> used on a null pointer"'
failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: ./bin/clang -cc1 -include-pch /tmp/test.pch
-ast-dump-all -std=c++17 -fno-validate-pch -o - /tmp/t5.cpp
1. /tmp/t5.cpp:20:7: current parser token ';'
#0 0x00000000026b89ff llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm-project/llvm/lib/Support/Unix/Signals.inc:563:13
#1 0x00000000026b6bd0 llvm::sys::RunSignalHandlers()
llvm-project/llvm/lib/Support/Signals.cpp:69:18
#2 0x00000000026b8e75 SignalHandler(int)
llvm-project/llvm/lib/Support/Unix/Signals.inc:395:3
#3 0x00007f741d52f110 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14110)
#4 0x00007f741d009761 raise
/build/glibc-M65Gwz/glibc-2.30/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f741cff355b abort /build/glibc-M65Gwz/glibc-2.30/stdlib/abort.c:81:7
#6 0x00007f741cff342f get_sysdep_segment_value
/build/glibc-M65Gwz/glibc-2.30/intl/loadmsgcat.c:509:8
#7 0x00007f741cff342f _nl_load_domain
/build/glibc-M65Gwz/glibc-2.30/intl/loadmsgcat.c:970:34
#8 0x00007f741d002092 (/lib/x86_64-linux-gnu/libc.so.6+0x34092)
#9 0x00000000043b9816 llvm::cast_retty<clang::CXXDestructorDecl,
clang::CXXMethodDecl*>::ret_type llvm::cast<clang::CXXDestructorDecl,
clang::CXXMethodDecl>(clang::CXXMethodDecl*)
llvm-project/llvm/include/llvm/Support/Casting.h:269:3
#10 0x00000000043b9816 clang::Sema::LookupDestructor(clang::CXXRecordDecl*)
llvm-project/clang/lib/Sema/SemaLookup.cpp:3308:10
#11 0x000000000413f476 clang::Sema::FinalizeVarWithDestructor(clang::VarDecl*,
clang::RecordType const*) llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:15105:35
#12 0x000000000407f302
clang::Sema::CheckCompleteVariableDeclaration(clang::VarDecl*)
llvm-project/clang/lib/Sema/SemaDecl.cpp:0:5
#13 0x000000000405917e clang::Sema::ActOnUninitializedDecl(clang::Decl*)
llvm-project/clang/lib/Sema/SemaDecl.cpp:0:5
#14 0x0000000003e60317
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
llvm-project/clang/lib/Parse/ParseDecl.cpp:0:13
#15 0x0000000003e5e940 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
llvm-project/clang/lib/Parse/ParseDecl.cpp:1986:21
#16 0x0000000003e43a0d
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
llvm-project/clang/lib/Parse/Parser.cpp:1100:10
#17 0x0000000003e433bc
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
llvm-project/clang/lib/Parse/Parser.cpp:1116:12
#18 0x0000000003e422c4
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) llvm-project/clang/lib/Parse/Parser.cpp:936:12
#19 0x0000000003e40451
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
llvm-project/clang/lib/Parse/Parser.cpp:684:10
#20 0x0000000003e3fcf7
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
llvm-project/clang/lib/Parse/Parser.cpp:556:26
#21 0x0000000003e3b9e1 clang::ParseAST(clang::Sema&, bool, bool)
llvm-project/clang/lib/Parse/ParseAST.cpp:0:25
#22 0x0000000002e10a94 clang::FrontendAction::Execute()
llvm-project/clang/lib/Frontend/FrontendAction.cpp:954:10
#23 0x0000000002dc2143 llvm::Error::getPtr() const
llvm-project/llvm/include/llvm/Support/Error.h:274:42
#24 0x0000000002dc2143 llvm::Error::operator bool()
llvm-project/llvm/include/llvm/Support/Error.h:236:16
#25 0x0000000002dc2143
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
llvm-project/clang/lib/Frontend/CompilerInstance.cpp:984:23
#26 0x0000000002eba7d8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:25
#27 0x00000000009e032a cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) llvm-project/clang/tools/driver/cc1_main.cpp:240:15
#28 0x00000000009de4f9 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
llvm-project/clang/tools/driver/driver.cpp:330:12
#29 0x00000000009de125 main llvm-project/clang/tools/driver/driver.cpp:407:12
#30 0x00007f741cff4e0b __libc_start_main
/build/glibc-M65Gwz/glibc-2.30/csu/../csu/libc-start.c:342:3
#31 0x00000000009db2ea _start (./bin/clang+0x9db2ea)
[1] 1638648 abort ./bin/clang -cc1 -include-pch /tmp/test.pch
-ast-dump-all -std=c++17 -o -
--
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/20200821/6a684ad9/attachment.html>
More information about the llvm-bugs
mailing list