[llvm-bugs] [Bug 30799] New: Assertion "mapping to a source type"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 26 11:32:56 PDT 2016


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

            Bug ID: 30799
           Summary: Assertion "mapping to a source type"' failed
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvm-bugs at lists.llvm.org, nicolasweber at gmx.de,
                    peter at pcc.me.uk, rnk at google.com, ruiu at google.com
    Classification: Unclassified

When using lld to do an LTO build of Chrome on Windows, I hit this assert:

lld-link: ../lib/Linker/IRMover.cpp:283: llvm::Type*
{anonymous}::TypeMapTy::get(llvm::Type*, llvm::SmallPtrSet<llvm::StructType*,
8u>&): Assertion `!(Pair.first != Ty && Pair.second == Ty) && "mapping to a
source type"' failed.


Still not sure what's going on, but dumping my notes so far.

The linker has already loaded and linked a bunch of bitcode into a module M1,
and now we're trying to add another one, M2.

The assert fires during IRLinker::computeTypeMapping()

It's trying to map a type in M2 (Src) to one in M1 (Dst).

The type the assert is firing when trying to map from this type in M2 to a type
in M1.

%struct.MojoHandleSignalsState = type { i32, i32 }


Now, the mystery is that this type doesn't originally exist in M2.

If I create a new Context, read M2 and dump it, there's no mention of
%struct.MojoHandleSignalsState.

However, if I create a new Context, read M1, then read M2 afterwards and dump
M2, suddenly the type is there!

Trying to trace where the type comes from, it appears to be used in a
ConstantAsMetadata object (but again, only if M1 has been read into the context
first).


Types from M1 seem to be leaking over to M2 via the Context in some way I don't
understand..

Any ideas for how to debug this would be appreciated.

-- 
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/20161026/9efdc7ba/attachment.html>


More information about the llvm-bugs mailing list