dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.21k stars 4.72k forks source link

[iOS] StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success fails in System.Runtime.InteropServices.UnitTests #73008

Open steveisok opened 2 years ago

steveisok commented 2 years ago

StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success fails when using Marshal.StructureToPtr fails in AOT mode with the following message:

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper other) void System.Runtime.InteropServices.Tests.PtrToStructureTests/SequentialClass:StructureToPtr (object,intptr,bool)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

   at System.Runtime.InteropServices.Marshal.StructureToPtr[SequentialClass](SequentialClass structure, IntPtr ptr, Boolean fDeleteOld)

The test is being skipped for now.

ghost commented 2 years ago

Tagging subscribers to this area: @dotnet/interop-contrib See info in area-owners.md if you want to be subscribed.

Issue Details
`Marshal.StructureToPtr` fails in AOT mode with a variation of this message: ```
Author: steveisok
Assignees: -
Labels: `area-System.Runtime.InteropServices`
Milestone: -
ghost commented 2 years ago

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.

Issue Details
`Marshal.StructureToPtr` fails in AOT mode with a variation of this message: ``` System.ExecutionEngineException: Attempting to JIT compile method '(wrapper other) void System.Runtime.InteropServices.Tests.PtrToStructureTests/SequentialClass:StructureToPtr (object,intptr,bool)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information. at System.Runtime.InteropServices.Marshal.StructureToPtr[SequentialClass](SequentialClass structure, IntPtr ptr, Boolean fDeleteOld) ``` The following tests are impacted: - [ ] StructureToPtr_NonGenericType_ReturnsExpected - [ ] StructureToPtr_NonGenericObject_ReturnsExpected - [ ] StructureToPtr_GenericObject_ReturnsExpected - [ ] PtrToStructure_GenericLayoutClass_Generic - [ ] PtrToStructure_GenericLayoutClass - [ ] StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success
Author: steveisok
Assignees: vargaz
Labels: `area-System.Runtime.InteropServices`, `untriaged`, `os-ios`
Milestone: -
steveisok commented 2 years ago

@vargaz These are still failing because it's trying to JIT:

https://github.com/dotnet/runtime/blob/aac729ff906a31f327823587748687c0308a4043/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs#L153-L160

https://github.com/dotnet/runtime/blob/aac729ff906a31f327823587748687c0308a4043/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs#L164-L171

https://github.com/dotnet/runtime/blob/aac729ff906a31f327823587748687c0308a4043/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StructureToPtrTests.cs#L261-L282

lambdageek commented 2 years ago

I don't think this was supposed to be closed? @steveisok ?

akoeplinger commented 2 years ago

Interesting, it looks like it was closed because it had the Fixes https://github.com/dotnet/runtime/issues/73008 in the commit message and since @MichalStrehovsky has write permissions it got closed when the commit was merged into the default branch of https://github.com/bflattened/runtime/pull/12

steveisok commented 2 years ago

I don't think this was supposed to be closed? @steveisok ?

No, it was not supposed to be closed. There's one test left that is failing.

MichalStrehovsky commented 2 years ago

Interesting, it looks like it was closed because it had the Fixes https://github.com/dotnet/runtime/issues/73008 in the commit message and since @MichalStrehovsky has write permissions it got closed when the commit was merged into the default branch of https://github.com/bflattened/runtime/pull/12

Wow, thanks Github :(. Sorry about that.