[LLVMbugs] [Bug 21320] New: Assertion "Did not find overrider!" with C++ modules and std::ofstream

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 20 21:20:21 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21320

            Bug ID: 21320
           Summary: Assertion "Did not find overrider!" with C++ modules
                    and std::ofstream
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: comexk at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

% cat help.h
#include <fstream>
void a() {
  std::ofstream ofs;

}
% cat help2.h
#include "help3.h"
% cat help3.h
#include <fstream>
void help3_func() {
  std::ofstream ofs;
}
% cat welp.cpp
#include "help2.h"
#include "help.h"
% cat help.map
module help {
    header "help.h"
    export *
}
module help2 {
    header "help2.h"
    export *
}
module help3 {
    header "help3.h"
    export *
}


(Note: To trigger the assert, welp.cpp must be as specified: changing the order
of the includes or including help3.h directly makes compilation succeed.)

% clang++ -O0 -isystem /usr/src/libcxx/include -Xclang -fmodules -c welp.cpp
-fmodule-map-file=help.map

Assertion failed: (OverridersMap.count(std::make_pair(MD, BaseOffset)) && "Did
not find overrider!"), function getOverrider, file
/Users/comex/src/llvm/tools/clang/lib/AST/VTableBuilder.cpp, line 142.
0  clang                    0x00000001072ff04b void
std::__1::seed_seq::generate<unsigned int*>(unsigned int*, unsigned int*) +
12155
1  clang                    0x00000001072ff7eb void
std::__1::seed_seq::generate<unsigned int*>(unsigned int*, unsigned int*) +
14107
2  libsystem_platform.dylib 0x00007fff861acf1a _sigtramp + 26
3  libsystem_platform.dylib 0x00007fff6cf9b764 _sigtramp + 3873368164
4  clang                    0x00000001072ff556 void
std::__1::seed_seq::generate<unsigned int*>(unsigned int*, unsigned int*) +
13446
5  clang                    0x00000001072ff531 void
std::__1::seed_seq::generate<unsigned int*>(unsigned int*, unsigned int*) +
13409
6  clang                    0x0000000106094dd7 clang::PackExpansionType const*
clang::Type::getAs<clang::PackExpansionType>() const + 149175
7  clang                    0x00000001060924a3 clang::PackExpansionType const*
clang::Type::getAs<clang::PackExpansionType>() const + 138627
8  clang                    0x000000010607ddfe clang::PackExpansionType const*
clang::Type::getAs<clang::PackExpansionType>() const + 55006
9  clang                    0x000000010607d866 clang::PackExpansionType const*
clang::Type::getAs<clang::PackExpansionType>() const + 53574
10 clang                    0x000000010609791e void
llvm::DeleteContainerSeconds<llvm::DenseMap<clang::CXXRecordDecl const*,
clang::VirtualBaseInfo*, llvm::DenseMapInfo<clang::CXXRecordDecl const*> >
>(llvm::DenseMap<clang::CXXRecordDecl const*, clang::VirtualBaseInfo*,
llvm::DenseMapInfo<clang::CXXRecordDecl const*> >&) + 494
11 clang                    0x000000010543ae53
llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned
long long, llvm::DenseMapInfo<clang::BaseSubobject> >, false>::grow(unsigned
long) + 10323
12 clang                    0x0000000105450868
clang::CodeGen::CGBuilderInserter<true>::InsertHelper(llvm::Instruction*,
llvm::Twine const&, llvm::BasicBlock*, llvm::ilist_iterator<llvm::Instruction>)
const + 34584
13 clang                    0x000000010544c28e
clang::CodeGen::CGBuilderInserter<true>::InsertHelper(llvm::Instruction*,
llvm::Twine const&, llvm::BasicBlock*, llvm::ilist_iterator<llvm::Instruction>)
const + 16702
14 clang                    0x000000010544be39
clang::CodeGen::CGBuilderInserter<true>::InsertHelper(llvm::Instruction*,
llvm::Twine const&, llvm::BasicBlock*, llvm::ilist_iterator<llvm::Instruction>)
const + 15593
15 clang                    0x000000010543fa74
llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned
long long, llvm::DenseMapInfo<clang::BaseSubobject> >, false>::grow(unsigned
long) + 29812
16 clang                    0x00000001054d6e34 void
std::__1::vector<clang::CodeGen::LValue,
std::__1::allocator<clang::CodeGen::LValue>
>::__push_back_slow_path<clang::CodeGen::LValue const&>(clang::CodeGen::LValue
const&&&) + 2548
17 clang                    0x000000010543e5eb
llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned
long long, llvm::DenseMapInfo<clang::BaseSubobject> >, false>::grow(unsigned
long) + 24555
18 clang                    0x0000000105144d23
std::__1::__tree<std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>,
std::__1::__map_value_compare<clang::edit::FileOffset,
std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>, std::__1::less<clang::edit::FileOffset>,
true>, std::__1::allocator<std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit> >
>::destroy(std::__1::__tree_node<std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>, void*>*) + 6819
19 clang                    0x000000010511752c void
std::__1::vector<clang::FrontendInputFile,
std::__1::allocator<clang::FrontendInputFile>
>::__push_back_slow_path<clang::FrontendInputFile
const&>(clang::FrontendInputFile const&&&) + 21932
20 clang                    0x00000001050d2c55 void
std::__1::__tree_balance_after_insert<std::__1::__tree_node_base<void*>*>(std::__1::__tree_node_base<void*>*,
std::__1::__tree_node_base<void*>*) + 4533
21 clang                    0x00000001050c9b2d
22 clang                    0x00000001050d0cfc void
std::__1::vector<llvm::SourceMgr::SrcBuffer,
std::__1::allocator<llvm::SourceMgr::SrcBuffer>
>::__push_back_slow_path<llvm::SourceMgr::SrcBuffer>(llvm::SourceMgr::SrcBuffer&&)
+ 11820
23 libdyld.dylib            0x00007fff951d05c9 start + 1
Stack dump:
0.    Program arguments: /opt/lolc/bin/clang -cc1 -triple
x86_64-apple-macosx10.10.0 -emit-obj -mrelax-all -disable-free -main-file-name
welp.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix
-mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 241.8 -dwarf-column-info -coverage-file /tmp/welp.cpp
-resource-dir /opt/lolc/bin/../lib/clang/3.6.0 -isystem /usr/src/libcxx/include
-stdlib=libc++ -O0 -fdeprecated-macro -fdebug-compilation-dir /tmp
-ferror-limit 19 -fmessage-length 160 -stack-protector 1 -mstackrealign
-fblocks -fmodule-map-file=help.map -fobjc-runtime=macosx-10.10.0
-fencode-extended-block-signature -fcxx-exceptions -fexceptions
-fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -fmodules -o
welp.o -x c++ welp.cpp 
1.    <eof> parser at end of file
2.    Per-file LLVM IR generation
3.    /usr/src/libcxx/include/fstream:199:13: Generating code for declaration
'std::__1::basic_filebuf<char, std::__1::char_traits<char> >::~basic_filebuf'
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 (trunk 220255) (llvm/trunk 220254:220256M)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
etc...




clang r220244, libcxx r220157.

-- 
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/20141021/a55d3138/attachment.html>


More information about the llvm-bugs mailing list