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

System.InvalidProgramException on ARM64 in .NET 9 #111094

Open
i255 opened this issue Jan 5, 2025 · 2 comments
Open

System.InvalidProgramException on ARM64 in .NET 9 #111094

i255 opened this issue Jan 5, 2025 · 2 comments
Assignees
Labels
area-Interop-mono os-android untriaged New issue has not been triaged by the area owner

Comments

@i255
Copy link

i255 commented Jan 5, 2025

Description

I get the following error when I call SkiaSharp.SKCodec.Decode in parallel from multiple threads after switching to .NET 9:
TypeInitialization_Type, f.G System.TypeInitializationException: TypeInitialization_Type, f.G
---> System.InvalidProgramException: Invalid IL due to: method f.G:G (intptr,void*) with UnmanagedCallersOnlyAttribute has marshal specs assembly: type: member:(null)

It only happens on ARM/android and .NET 9. X64 and .NET 8 works fine.

Reproduction Steps

I don't have a minimal repro

Expected behavior

No exception

Actual behavior

InvalidProgramException is thrown

Regression?

It works in .NET 8, and .NET 9 on x64. Only .NET 9 arm seems to be affected.

Known Workarounds

No response

Configuration

.NET 9, ARM64, android

Other information

The following code fails:
https://github.com/mono/SkiaSharp/blob/main/binding/SkiaSharp/SKData.cs
public static SKData Create (IntPtr address, int length, SKDataReleaseDelegate releaseProc, object context)
DelegateProxies static constructor fails

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 5, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 5, 2025
@jkotas jkotas removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 5, 2025
Copy link
Contributor

Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

@simonrozsival
Copy link
Member

@mattleibow does this sound familiar? or do we need a repro to diagnose this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Interop-mono os-android untriaged New issue has not been triaged by the area owner
Projects
Status: No status
Development

No branches or pull requests

4 participants