[LLVMbugs] [Bug 17382] New: [-cxx-abi microsoft] bad vftable for llvm::error_category

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 26 14:23:14 PDT 2013


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

            Bug ID: 17382
           Summary: [-cxx-abi microsoft] bad vftable for
                    llvm::error_category
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu,
                    timurrrr at google.com
            Blocks: 12477
    Classification: Unclassified

This manifests as a crash in SupportTests with clang-cl /fallback.

I get a crash with a stack like:
     SupportTests.exe!llvm::error_code::category() Line 767    C++
     SupportTests.exe!llvm::error_category::equivalent(class llvm::error_code
const &,int)    Unknown
>	SupportTests.exe!llvm::operator==(const llvm::error_code & _x, const llvm::error_condition & _y) Line 797	C++
     SupportTests.exe!llvm::operator==(const llvm::error_condition & _x, const
llvm::error_code & _y) Line 801    C++


The equivalent() method implementation was compiled by clang, and I assume the
vftable came from clang as well, but I have not confirmed this yet.

The call to equivalent() came from MSVC, and it loaded vftable offset 0x10,
which should be the (int, error_condition) overload, but instead we called
clang's implementation of the (error_condition, int) overload.  MSVC seems to
think there should be one more vftable slot.

The vftable looks like this in the debugger:
-        _x    {_val_=22 _cat_=SupportTests.exe!0x03e2f0c8 {...} }    const
llvm::error_code &
        _val_    22    int
-        _cat_    SupportTests.exe!0x03e2f0c8 {...}    const
llvm::error_category *
-        __vfptr    0x03e1bcb0 {SupportTests.exe!const
llvm::_generic_error_category::`vftable'} {0x02815630
{SupportTests.exe!llvm::_generic_error_category::`scalar deleting
destructor'(unsigned int)}, ...}    void * *
        [0]    0x02815630
{SupportTests.exe!llvm::_generic_error_category::`scalar deleting
destructor'(unsigned int)}    void *
        [1]    0x013d6db0
{SupportTests.exe!llvm::_generic_error_category::name(void)const }    void *
        [2]    0x013d6c60
{SupportTests.exe!llvm::error_category::default_error_condition(int)const }   
void *
        [3]    0x013d6ca0
{SupportTests.exe!llvm::error_category::equivalent(int,class
llvm::error_condition const &)const }    void *
        [4]    0x013d6d10
{SupportTests.exe!llvm::error_category::equivalent(class llvm::error_code const
&,int)const }    void *
        [5]    0x013d6dd0
{SupportTests.exe!llvm::_generic_error_category::message(int)const }    void *

-- 
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/20130926/a877ee5c/attachment.html>


More information about the llvm-bugs mailing list