Skip to content

[Mono] Regression: amd64 AOT: condition `class1 != ARG_CLASS_NO_CLASS' not met #90955

@Perksey

Description

@Perksey

Description

Unchanged code from .NET 6/7 to .NET 8 no longer compiles against MonoAOT.

Reproduction Steps

  1. Use the following .NET 5 artefact: Silk.NET.SDL.dll.changetheextension.txt (or you can attempt to use the latest Silk.NET.SDL NuGet artefact)
  2. Attempt to compile using Mono on amd64
  3. Observe the assertion fail

Expected behavior

Compiles as it does with .NET 6/7 Mono.

Actual behavior

Does not compile.

Full error logs:

  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\obj\Release\net8.0-android\android-x64\linked\Silk.NET.SDL.dll with exit code -1073740791. [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\AndroidInputDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\obj\Release\net8.0-android\android-x64\linked\Silk.NET.SDL.dll [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\AndroidInputDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID A3075E1A-B18B-3031-4C59-00EC193478B1 [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\AndroidInputDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\dotnet.aotprofile' [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\AndroidInputDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Added 0 methods from profile. [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\AndroidInputDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : * Assertion at D:\a\_work\1\s\src\mono\mono\mini\mini-amd64.c:760, condition `class1 != ARG_CLASS_NO_CLASS' not met [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidInputDemo\AndroidInputDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\obj\Release\net8.0-android\android-x64\linked\Silk.NET.SDL.dll with exit code -1073740791. [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\obj\Release\net8.0-android\android-x64\linked\Silk.NET.SDL.dll [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 214C00ED-E566-A415-E0D8-46AB9AC076CB [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\dotnet.aotprofile' [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Added 0 methods from profile. [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : * Assertion at D:\a\_work\1\s\src\mono\mono\mini\mini-amd64.c:760, condition `class1 != ARG_CLASS_NO_CLASS' not met [C:\runner\_work\Silk.NET\Silk.NET\examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\obj\Release\net8.0-android\android-x64\linked\Silk.NET.SDL.dll with exit code -1073740791. [C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\TriangleNET6.csproj::TargetFramework=net8.0-android]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\obj\Release\net8.0-android\android-x64\linked\Silk.NET.SDL.dll [C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\TriangleNET6.csproj::TargetFramework=net8.0-android]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 3D729075-93D5-64C6-1763-7E3C129EC501 [C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\TriangleNET6.csproj::TargetFramework=net8.0-android]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\dotnet.aotprofile' [C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\TriangleNET6.csproj::TargetFramework=net8.0-android]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Added 0 methods from profile. [C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\TriangleNET6.csproj::TargetFramework=net8.0-android]
  [ERR] Pack: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.359\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : * Assertion at D:\a\_work\1\s\src\mono\mono\mini\mini-amd64.c:760, condition `class1 != ARG_CLASS_NO_CLASS' not met [C:\runner\_work\Silk.NET\Silk.NET\src\Lab\Experiments\TriangleNET6\TriangleNET6.csproj::TargetFramework=net8.0-android]
  [ERR] Pack: Target Pack has thrown an exception

Regression?

Yes, these applications compiled on .NET 7

Known Workarounds

No known workarounds.

Configuration

Running on Windows Server 2022 using workload 34.0.0-preview.6.359. Attempting to compile for amd64. It is specific to that configuration as no other configurations failed. CI job: https://github.com/dotnet/Silk.NET/actions/runs/5933030128/job/16087847725?pr=1591

Other information

Perhaps it is indeed some undefined behaviour exerted by our bindings, but without knowing which specific function is exercising that undefined behaviour and causing Mono to crash, I don't know what I can do to work around this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions