[llvm-bugs] [Bug 47864] New: Assertion failure "Did not find base!"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 15 11:06:58 PDT 2020


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

            Bug ID: 47864
           Summary: Assertion failure "Did not find base!"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sunil_srivastava at playstation.sony.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 24067
  --> https://bugs.llvm.org/attachment.cgi?id=24067&action=edit
test case

Following example gives as assertion failure since
https://github.com/llvm/llvm-project/commit/913f6005669cfb

Interestingly there are several bugzillas with same assertion failure, but they
are all fixed long back, so this is a new issue.

$ cat b4.cpp
class A{};
class C;
class C: public A{};
class D: public C {
public:
    int S(int);
};
typedef int(A::*F)(int);
auto x = (F)&D::S;

$ clang -c b4.cpp
clang:
/home/sunil/CLANG-GIT/llvm-project/clang/include/clang/AST/RecordLayout.h:251:
clang::CharUnits clang::ASTRecordLayout::getBaseClassOffset(const
clang::CXXRecordDecl*) const: Assertion `CXXInfo->BaseOffsets.count(Base) &&
"Did not find base!"' 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: clang -c b4.cpp 
1.            <eof> parser at end of file
2.            b4.cpp:9:6: LLVM IR generation of declaration 'x'
3.            b4.cpp:9:6: Generating code for declaration 'x'
#0 0x000055a46e82ddcc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x71d7dcc)
#1 0x000055a46e82ba04 llvm::sys::RunSignalHandlers()
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x71d5a04)
#2 0x000055a46e82bc95 llvm::sys::CleanupOnSignal(unsigned long)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x71d5c95)
#3 0x000055a46e78b798 CrashRecoverySignalHandler(int)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7135798)
#4 0x00007f94998dd8a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x128a0)
#5 0x00007f949858ef47 raise
/build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#6 0x00007f94985908b1 abort /build/glibc-2ORdQG/glibc-2.27/stdlib/abort.c:81:0
#7 0x00007f949858042a __assert_fail_base
/build/glibc-2ORdQG/glibc-2.27/assert/assert.c:89:0
#8 0x00007f94985804a2 (/lib/x86_64-linux-gnu/libc.so.6+0x304a2)
#9 0x000055a46ed1a97f
clang::CodeGen::CGCXXABI::getMemberPointerPathAdjustment(clang::APValue const&)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x76c497f)
#10 0x000055a46eee4eeb (anonymous
namespace)::ItaniumCXXABI::EmitMemberPointer(clang::APValue const&,
clang::QualType) (/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x788eeeb)
#11 0x000055a46ebd2e06
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::APValue const&,
clang::QualType) (/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x757ce06)
#12 0x000055a46ebd4426
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::APValue const&,
clang::QualType) (/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x757e426)
#13 0x000055a46ebd7010
clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl
const&) (/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7581010)
#14 0x000055a46ebd72a1
clang::CodeGen::ConstantEmitter::tryEmitForInitializer(clang::VarDecl const&)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x75812a1)
#15 0x000055a46eb1a750
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool) (/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x74c4750)
#16 0x000055a46eb37841
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x74e1841)
#17 0x000055a46eb380f3
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x74e20f3)
#18 0x000055a46eb3e35c
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.6225)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x74e835c)
#19 0x000055a46f2bc95d (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7c6695d)
#20 0x000055a46f2b1df1
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7c5bdf1)
#21 0x000055a470450704 clang::ParseAST(clang::Sema&, bool, bool)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x8dfa704)
#22 0x000055a46f2bb268 clang::CodeGenAction::ExecuteAction()
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7c65268)
#23 0x000055a46f1c1a49 clang::FrontendAction::Execute()
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7b6ba49)
#24 0x000055a46f1229aa
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7acc9aa)
#25 0x000055a46f28dfc6
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7c37fc6)
#26 0x000055a46c59c2fc cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x4f462fc)
#27 0x000055a46c594db9 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x4f3edb9)
#28 0x000055a46eff7745 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x79a1745)
#29 0x000055a46e78b873
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7135873)
#30 0x000055a46eff82bf
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.161)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x79a22bf)
#31 0x000055a46efcde05
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7977e05)
#32 0x000055a46efce8af
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x79788af)
#33 0x000055a46efd6ff9
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x7980ff9)
#34 0x000055a46c5996d1 main
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x4f436d1)
#35 0x00007f9498571b97 __libc_start_main
/build/glibc-2ORdQG/glibc-2.27/csu/../csu/libc-start.c:344:0
#36 0x000055a46c59491a _start
(/data/sunil/CLANG-ARCHIVE/g32231/bin/clang-12+0x4f3e91a)
clang-12: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
913f6005669cfb590c99865a90bc51ed0983d09d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/sunil/CLANG-ARCHIVE/g32231/bin
clang-12: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/b4-83154d.cpp
clang-12: note: diagnostic msg: /tmp/b4-83154d.sh
clang-12: 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/20201015/cc070b7e/attachment-0001.html>


More information about the llvm-bugs mailing list