Skip to content

MonoVM: Type.GetInterfaceMap may return null TargetMethods entries #53933

@rolfbjarne

Description

@rolfbjarne

Description

Type.GetInterfaceMap returns null entries for TargetMethods sometimes.

Test case:
consoleapp-3c50b29.zip

Repro:

  • Install .NET 6.0.100-preview.6.21308.62
  • Download & extract test case
  • Run the run-with-mono.sh script
$ ./run-with-mono.sh 
+ DOTNET=dotnet
+ dotnet publish -r osx-x64 /p:UseMonoRuntime=true
Microsoft (R) Build Engine version 17.0.0-preview-21304-01+a5ea6d2ca for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /Users/rolf/test/dotnet/consoleapp/myproject.csproj (in 93 ms).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  myproject -> /Users/rolf/test/dotnet/consoleapp/bin/Debug/net6.0/osx-x64/myproject.dll
  myproject -> /Users/rolf/test/dotnet/consoleapp/bin/Debug/net6.0/osx-x64/publish/
+ MONO_ENV_OPTIONS=--version
+ ./bin/Debug/net6.0/osx-x64/publish/myproject
Mono JIT compiler version 6.0.0.0 (6.0.21.30601 @Commit: 5b8e1780ad7740e632c285bc2af13a8d0b20c5a9)
Copyright (C) Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           
	SIGSEGV:       normal
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          supported, not enabled.
	Suspend:       hybrid
	GC:            sgen (concurrent by default)
+ ./bin/Debug/net6.0/osx-x64/publish/myproject Xamarin.Mac.dll
Running on .NET 6.0.0-preview.6.21306.1
Loading: /Users/rolf/test/dotnet/consoleapp/Xamarin.Mac.dll
Got interface map for type CoreBluetooth.CBCentralManagerDelegate and interface CoreBluetooth.ICBCentralManagerDelegate with 1 entries:
    1 Void UpdatedState(CoreBluetooth.CBCentralManager) -> null

Compare to when running with .NET:

$ dotnet run *.dll
Running on .NET 6.0.0-preview.6.21306.1
Loading: /Users/rolf/test/dotnet/consoleapp/Xamarin.Mac.dll
Got interface map for type CoreBluetooth.CBCentralManagerDelegate and interface CoreBluetooth.ICBCentralManagerDelegate with 1 entries:
    1 Void UpdatedState(CoreBluetooth.CBCentralManager) -> Void UpdatedState(CoreBluetooth.CBCentralManager)

Configuration

.NET 6.0.100-preview.6.21308.62

Regression?

Yes (since 6.0.100-preview.6.21280.2).

Other information

Our tests ran into this when bumping to the latest .NET version (dotnet/macios#11852).

Looking at the dotnet/runtime commits since it worked, there's a possible cause here: 5d64814 (CC @bholmes).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions