Skip to content

Crossgen2 composite framework build emits OptimizedInboxTextEncoder layout mismatched with the CoreCLR runtime #64419

@trylek

Description

@trylek

Architecture: 64-bit
OS: all
Example run: https://dev.azure.com/dnceng/public/_build/results?buildId=1574573&view=results

Diagnostic information:

      Assert failure(PID 1408 [0x00000580], Thread: 2176 [0x0880]): Verify_FieldOffset 'System.Text.Encodings.Web.OptimizedInboxTextEncoder._allowedAsciiCodePoints' Field offset 16!=24(actual) || baseOffset 8!=8(actual)
      
      CORECLR! LoadDynamicInfoEntry + 0x11C1 (0x00007ffb`0ec98e71)
      CORECLR! Module::FixupNativeEntry + 0x280 (0x00007ffb`0eb7d190)
      CORECLR! Module::FixupDelayListAux + 0x6AD (0x00007ffb`0ee0d88d)
      CORECLR! ReadyToRunInfo::GetEntryPoint + 0x64A (0x00007ffb`0ee0ff4a)
      CORECLR! MethodDesc::GetPrecompiledR2RCode + 0xDA (0x00007ffb`0ed5eb1a)
      CORECLR! MethodDesc::GetPrecompiledCode + 0xD1 (0x00007ffb`0ed5e711)
      CORECLR! MethodDesc::PrepareILBasedCode + 0x3B0 (0x00007ffb`0ed62030)
      CORECLR! MethodDesc::PrepareCode + 0xE8 (0x00007ffb`0ed61c28)
      CORECLR! CodeVersionManager::PublishVersionableCodeIfNecessary + 0x3F3 (0x00007ffb`0ebe5433)
      CORECLR! MethodDesc::DoPrestub + 0xC0E (0x00007ffb`0ed5aafe)
          File: D:\a\_work\1\s\src\coreclr\vm\jitinterface.cpp Line: 13642
          Image: C:\h\w\AF87095D\p\corerun.exe

At the first glance it seems to me that this is caused by mismatching classification of the type by Crossgen2 and the runtime. Crossgen2 query for

else if (type.IsSequentialLayout && !type.ContainsGCPointers)

doesn't hit the sequential path because the type does contain GC pointers, however the check in

if (IsBlittable() || IsManagedSequential())

does classify the type as Blittable and enters the sequential layout path.

/cc @dotnet/crossgen-contrib, @jkoritzinsky

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions