Open SamMonoRT opened 4 years ago
For the AsAnyTest.sh
failures, what's needed is implementation of array marshalling mono_marshal_asany_impl
, Mono's JIT icall used for marshalling under the AsAny scheme. https://github.com/mono/mono/pull/19683 fixes about half of these cases, so the program fails later:
Scenario : Checking Marshal AsAny for sbyte array
Scenario : Checking Marshal AsAny for byte array
Scenario : Checking Marshal AsAny for short array
Scenario : Checking Marshal AsAny for ushort array
Scenario : Checking Marshal AsAny for Int array
Scenario : Checking Marshal AsAny for uint array
Scenario : Checking Marshal AsAny for long array
Scenario : Checking Marshal AsAny for ulong array
Scenario : Checking Marshal AsAny for float array
Scenario : Checking Marshal AsAny for double array
Scenario : Checking Marshal AsAny for char array
System.ArgumentException: No PInvoke conversion exists for value passed to Object-typed parameter.
PR updated with char array implementation; now fails at bool arrays. CoreCLR marshals these to windows BOOLs: https://github.com/dotnet/runtime/blob/a1562933166c55025cf65dc45d72ec423ff83c02/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs#L1067
In general, the failures are because of not implemented features, and not runtime bugs (byref array marshalling, byref delegate marshalling, the above AsAny array variants, some handling of in/out parameter types)
@lambdageek - just fyi - some missing implementations identified here.
Several failures seen when running the Interop/PInvoke* tests. These are CoreCLR tests run on the mono runtime from the dotnet\runtime repo.
Repro : Command to run individual tests :
*** Interop/PInvoke/AsAny/AsAnyTest/AsAnyTest.sh [FAIL]
*** Interop/PInvoke/CriticalHandles/Test/Test/Test.sh [FAIL]
*** Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest/PassingByRefTest.sh [FAIL]
*** Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest/AsDefaultTest.sh [FAIL]
EXEC : Array marshaling error : Index: 0 : Actual:0, Expected:99, [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/runtest.proj] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/mono.proj]
*** Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh [FAIL]
EXEC : warning : Test error - BOOL Equals(T , int, T , int) [T = int] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/runtest.proj] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/mono.proj] Array Length: expected: 100, actual: 117468592 Expected: 100 Actual: 101 END EXECUTION - FAILED Test Harness Exitcode is : 1 To run the test:
*** Interop/PInvoke/CriticalHandles/StructTest/StructTest/StructTest.sh [FAIL]
*** Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh [FAIL]
*** Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest/AsByValArrayTest.sh [FAIL]
EXEC : warning : Test error - BOOL Equals(T , int, T , int) [T = char] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/runtest.proj] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/mono.proj] Array Element Not Equal: index: 1Expected: 100 Actual: 101 END EXECUTION - FAILED Test Harness Exitcode is : 1 To run the test:
*** Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex/InvalidParamIndex.sh [FAIL]
*** Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh [FAIL]
*** Interop/PInvoke/Delegate/DelegateTest/DelegateTest.sh [FAIL]
*** Interop/PInvoke/DateTime/DateTimeTest/DateTimeTest.sh [FAIL] Raw output file: /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/DateTime/DateTimeTest/DateTimeTest.output.txt Raw output: BEGIN EXECUTION /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun DateTimeTest.dll '' Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Type System.DateTime which is passed to unmanaged code must have a StructLayout attribute. at DateTimeTest.Main(String[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/DateTime/DateTimeTest.cs:line 35 Expected: 100 Actual: 101 END EXECUTION - FAILED Test Harness Exitcode is : 1 To run the test:
*** Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest/ArrayTest.sh [FAIL]
*** Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh [FAIL]