Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Linker crashes on interop method with function pointers #1345

Closed

Description

@jkotas
 Mono.Linker.LinkerFatalErrorException: ILLinker: error IL1005: .Interop.Kernel32.EnumSystemLocalesEx(method,UInt32,Void*,IntPtr): Error processing method '.Interop.Kernel32.EnumSystemLocalesEx(method,UInt32,Void*,IntPtr)' in assembly 'System.Private.CoreLib.dll'
   ---> System.NullReferenceException: Object reference not set to an instance of an object.
     at Mono.Linker.Steps.MarkStep.ProcessInteropMethod(MethodDefinition method)
     at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
     at Mono.Linker.Steps.MarkStep.ProcessQueue()
     --- End of inner exception stack trace ---
     at Mono.Linker.Steps.MarkStep.ProcessQueue()
     at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
     at Mono.Linker.Steps.MarkStep.Process()
     at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
     at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
     at Mono.Linker.Pipeline.Process(LinkContext context)
     at Mono.Linker.Driver.Run(ILogger customLogger)

See dotnet/runtime#39082 for repro

Activity

  1. added this to the .NET5.0 milestone on Jul 10, 2020
  2. marek-safar commented on Jul 10, 2020

    @marek-safar
    Contributor

    @MichalStrehovsky could you look into this?

    /cc @vitek-karas

  3. RussKie commented on Aug 12, 2020

    @RussKie

    I'm still hitting this in Microsoft.NET.Sdk.IL: 5.0.0-rc.1.20411.1, SDK: 5.0.100-preview.7.20356.2/5.0.100-preview.8.20359.7

    C:\Development\winforms\.dotnet\sdk\5.0.100-preview.8.20359.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(99,5): error MSB6006: "dotnet.exe" exited with code 1. [C:\Development\winforms\src\System.Windows.Forms\src\System.Windows.Forms.csproj]
    

    How/where do I get the fixed version?

  4. vitek-karas commented on Sep 4, 2020

    @vitek-karas
    Member

    @RussKie Do you still see the failure? I tried something similar with 5.0.100-rc.1.20453.7 and it worked.
    If you still see a failure, could you please paste the exact error and what did you try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions