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

[CLR] Enable more p/invokes #9956

Merged
merged 1 commit into from
Mar 27, 2025
Merged

[CLR] Enable more p/invokes #9956

merged 1 commit into from
Mar 27, 2025

Conversation

grendello
Copy link
Contributor

Enables more p/invokes in our native runtime CLR host.

@grendello grendello requested a review from jonpryor as a code owner March 24, 2025 17:18
@grendello grendello force-pushed the dev/grendel/clr-more-pinvokes branch from c7a8651 to db4eeb4 Compare March 25, 2025 08:36
@grendello
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello grendello force-pushed the dev/grendel/clr-more-pinvokes branch 3 times, most recently from 521c76a to 5f2c2bd Compare March 26, 2025 14:14
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the changes here, Mono.Android-Tests runs successfully and some of the tests pass:

Then it crashes at:

03-26 16:21:04.376 12587 12610 I NUnit   : JavaCast_InterfaceCast 
...
03-26 16:21:04.381 12587 12610 I monodroid-assembly: typemap: unable to find mapping to a managed type from Java type 'net/dot/android/test/Example$1' (hash 6d58b30e6a5f46be)
03-26 16:21:04.381 12587 12610 W monodroid-assembly: typemap: called from
03-26 16:21:04.381 12587 12610 W monodroid-assembly: at Java.Interop.TypeManager.GetJavaToManagedType(String)
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at Java.Interop.TypeManager.CreateInstance(IntPtr, JniHandleOwnership, Type)
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at Android.Runtime.AndroidValueManager.CreatePeer(JniObjectReference&, JniObjectReferenceOptions, Type )
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at Java.Lang.Object._GetObject[T](IntPtr, JniHandleOwnership)
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at Java.InteropTests.JavaObjectExtensionsTests.JavaCast_InterfaceCast()
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack, Void**, ObjectHandleOnStack, BOOL, ObjectHandleOnStack)
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack, Void**, ObjectHandleOnStack, BOOL, ObjectHandleOnStack)
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
03-26 16:21:04.381 12587 12610 W monodroid-assembly:    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at System.Reflection.RuntimeMethodInfo.Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo, Object, Object[] )
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.Commands.TestMethodCommand.RunNonAsyncTestMethod(TestExecutionContext)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.Commands.SetUpTearDownCommand.Execute(TestExecutionContext)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.SimpleWorkItem.PerformWork()
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.WorkItem.RunTest()
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.WorkItem.Execute(TestExecutionContext)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.RunChildren()
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.PerformWork()
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.WorkItem.RunTest()
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.WorkItem.Execute(TestExecutionContext)
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.RunChildren()
03-26 16:21:04.382 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.PerformWork()
03-26 16:21:04.383 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.WorkItem.RunTest()
03-26 16:21:04.383 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.WorkItems.WorkItem.Execute(TestExecutionContext)
03-26 16:21:04.383 12587 12610 W monodroid-assembly:    at NUnit.Framework.Internal.NUnitLiteTestAssemblyRunner.Run(ITestListener, ITestFilter)
03-26 16:21:04.383 12587 12610 W monodroid-assembly:    at Xamarin.Android.UnitTests.NUnit.NUnitTestRunner.Run(IList`1)
03-26 16:21:04.383 12587 12610 W monodroid-assembly:    at Xamarin.Android.UnitTests.TestInstrumentation`1.RunTests(Bundle&)
03-26 16:21:04.383 12587 12610 W monodroid-assembly:    at Xamarin.Android.UnitTests.TestInstrumentation`1.OnStart()
03-26 16:21:04.383 12587 12610 W monodroid-assembly:    at Android.App.Instrumentation.n_OnStart(IntPtr jnienv, IntPtr native__this)

Which seems like a new issue to investigate.

@grendello grendello force-pushed the dev/grendel/clr-more-pinvokes branch from 5f2c2bd to 194ca27 Compare March 27, 2025 09:24
@jonpryor jonpryor merged commit 8ee23d0 into main Mar 27, 2025
57 of 59 checks passed
@jonpryor jonpryor deleted the dev/grendel/clr-more-pinvokes branch March 27, 2025 20:09
grendello added a commit that referenced this pull request Mar 27, 2025
* main:
  [CoreCLR] Enable more P/Invokes (#9956)
  [darc] track previous .NET Android manifests (#9981)
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

Successfully merging this pull request may close these issues.

4 participants