Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ILLink : error IL1012 with macOS, .NET 7.0 #3157

Open
nilaoda opened this issue Dec 10, 2022 · 4 comments
Open

ILLink : error IL1012 with macOS, .NET 7.0 #3157

nilaoda opened this issue Dec 10, 2022 · 4 comments

Comments

@nilaoda
Copy link

nilaoda commented Dec 10, 2022

  Optimizing assemblies for size. This process might take a while.
ILLink : error IL1012: IL Trimmer has encountered an unexpected error. Please report the issue at https://github.com/dotnet/linker/issues [/Users/runner/work/N_m3u8DL-RE/N_m3u8DL-RE/src/N_m3u8DL-RE/N_m3u8DL-RE.csproj]
  Fatal error in IL Linker
  Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'target')
     at Mono.Cecil.Cil.ILProcessor.InsertAfter(Instruction target, Instruction instruction)
     at Mono.Linker.LinkerILProcessor.InsertAfter(Instruction target, Instruction instruction)
     at Mono.Linker.Steps.MarkStep.ProcessPendingTypeChecks()
     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)
     at Mono.Linker.Driver.Main(String[] args)

Detail here:
https://github.com/nilaoda/N_m3u8DL-RE/actions/runs/3663371272/jobs/6193112246

nilaoda added a commit to nilaoda/N_m3u8DL-RE that referenced this issue Dec 10, 2022
@vitek-karas
Copy link
Member

This was fixed by #3088 but that fix is only available in .NET 8.0 SDK.
Unfortunately the fix is rather large so it raises the risk of taking the fix for servicing. I'll look into it.

In theory there might be a workaround as the bug is order dependent - if the trimmer sees the code in different order it might work, but it's really hard to guess which order will work and which won't.

@nilaoda
Copy link
Author

nilaoda commented Dec 13, 2022

Sad...Thank you for your efforts.

@vitek-karas
Copy link
Member

#3161 is the 7.0 port of the fix.

@vitek-karas
Copy link
Member

vitek-karas commented Dec 13, 2022

Note that this issue is only in the trimmer, it doesn't apply to NativeAOT (which also does triming), so if you manage to get your app working in NativeAOT, this issue should not impact that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants