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

[nativeaot][ios] DynamicGenerics tests failed on apple mobile platforms #89436

Closed
kotlarmilos opened this issue Jul 25, 2023 · 6 comments
Closed

Comments

@kotlarmilos
Copy link
Member

Description

The TestLdTokenResults and testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset tests failed with Native AOT on apple mobile platforms in #89301.

The TestLdTokenResults test log.

2023-07-25 15:28:08.950229+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] Running Test: Expressions.ExpressionsTesting.TestLdTokenResults
2023-07-25 15:28:09.006706+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] Caught Unexpected exception:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.PlatformNotSupportedException: Dynamic code generation is not supported on this platform.
2023-07-25 15:28:09.006844+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at System.Reflection.Emit.ReflectionEmitThrower.ThrowPlatformNotSupportedException() + 0x30
   at System.Dynamic.Utils.DelegateHelpers.CreateObjectArrayDelegateRefEmit(Type, Func`2) + 0x1ec
   at System.Linq.Expressions.Expression`1.Compile() + 0x40
2023-07-25 15:28:09.006881+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at Expressions.TestRunner`1.RunTest[U](T tval1, T tval2, U uval1, U uval2) + 0x12c
   at nativeaot_SmokeTests_DynamicGenerics!<BaseAddress>+0x2a2f8c
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0x154
2023-07-25 15:28:09.006907+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    --- End of inner exception stack trace ---
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0x344
2023-07-25 15:28:09.006933+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at Internal.Reflection.Execution.MethodInvokers.InstanceMethodInvoker.Invoke(Object, Object[], BinderBundle, Boolean) + 0x5c
   at Internal.Reflection.Core.Execution.MethodInvoker.Invoke(Object, Object[], Binder, BindingFlags, CultureInfo) + 0x54
   at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) + 0x70
2023-07-25 15:28:09.006957+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at Expressions.ExpressionsTesting.TestLdTokenResults() + 0x200
   at CoreFXTestLibrary.Internal.Runner.RunTestMethod(TestInfo) + 0x368
   at CoreFXTestLibrary.Internal.Runner.RunTest(TestInfo) + 0x20
2023-07-25 15:28:09.006981+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] ---- Test FAILED ---------------

The testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset test log.

2023-07-25 15:28:10.187408+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] Running Test: B282745.testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset
(lldb) bt
* thread #3, queue = 'com.apple.root.default-qos', stop reason = signal SIGSEGV
  * frame #0: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::get_BaseSize(this=0x0000000000000000) at MethodTable.h:180:18 [opt]
    frame #1: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::GetBaseSize(this=0x0000000000000000) at MethodTable.h:349:37 [opt]
    frame #2: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::my_get_size(ob=0x0000000116421d40) at gc.cpp:11403:17 [opt]
    frame #3: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::gc_heap::add_to_promoted_bytes(object="\U00000001", thread=0) at gc.cpp:25684:23 [opt]
    frame #4: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(po=<unavailable>) at gc.cpp:27046:17 [opt]
    frame #5: 0x00000001046542f4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(ppObject=0x000000016b8f6a88, sc=<unavailable>, flags=0) at gc.cpp:48620:5 [opt]
    frame #6: 0x0000000104684c64 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(REGDISPLAY*, bool, unsigned int, void (*)(void*, void**, unsigned int), void*) [inlined] GcInfoDecoder::ReportSlotToGC(this=0x000000016b8f6218, slotDecoder=0x000000016b8f5e68, slotIndex=3, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:0 [opt]
    frame #7: 0x0000000104684c50 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(this=0x000000016b8f6218, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:804:21 [opt]
    frame #8: 0x0000000104686fac nativeaot_SmokeTests_DynamicGenerics`UnixNativeCodeManager::EnumGcRefs(this=<unavailable>, pMethodInfo=0x000000016b8f6500, safePointAddress=<unavailable>, pRegisterSet=0x000000016b8f63a8, hCallback=0x000000016b8f62c0, isActiveStackFrame=false) at UnixNativeCodeManager.cpp:238:18 [opt]
    frame #9: 0x0000000104625168 nativeaot_SmokeTests_DynamicGenerics`RedhawkGCInterface::EnumGcRefs(pCodeManager=<unavailable>, pMethodInfo=<unavailable>, safePointAddress=<unavailable>, pRegisterSet=<unavailable>, pfnEnumCallback=<unavailable>, pvCallbackData=<unavailable>, isActiveStackFrame=<unavailable>) at gcrhenv.cpp:386:19 [opt]
    frame #10: 0x000000010462b3e8 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRootsWorker(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0, frameIterator=0x000000016b8f6388) at thread.cpp:496:17 [opt]
    frame #11: 0x000000010462b164 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRoots(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0) at thread.cpp:386:5 [opt]
    frame #12: 0x0000000104626330 nativeaot_SmokeTests_DynamicGenerics`GCToEEInterface::GcScanRoots(fn=(nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(Object**, ScanContext*, unsigned int) at gc.cpp:48554), condemned=<unavailable>, max_gen=<unavailable>, sc=0x000000016b8f66f0)(Object**, ScanContext*, unsigned int), int, int, ScanContext*) at gcrhscan.cpp:73:22 [opt]
    frame #13: 0x0000000104648030 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_phase(condemned_gen_number=2, mark_only_p=NO) at gc.cpp:28932:9 [opt]
    frame #14: 0x00000001046451d0 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::gc1() at gc.cpp:22018:13 [opt]
    frame #15: 0x000000010464fc5c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::garbage_collect(n=<unavailable>) at gc.cpp:0:21 [opt]
    frame #16: 0x00000001046401d4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollectGeneration(this=<unavailable>, gen=2, reason=reason_induced) at gc.cpp:50082:9 [opt]
    frame #17: 0x000000010466a6a0 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(int, bool, int) [inlined] WKS::GCHeap::GarbageCollectTry(this=<unavailable>, generation=<unavailable>, low_memory_p=<unavailable>, mode=<unavailable>) at gc.cpp:49321:12 [opt]
    frame #18: 0x000000010466a694 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(this=<unavailable>, generation=<unavailable>, low_memory_p=false, mode=2) at gc.cpp:49251:30 [opt]
    frame #19: 0x0000000104622f14 nativeaot_SmokeTests_DynamicGenerics`::RhpCollect(uGeneration=<unavailable>, uMode=<unavailable>) at GCHelpers.cpp:38:35 [opt]
    frame #20: 0x0000000104799c30 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Runtime_InternalCalls__RhCollect(generation=<unavailable>, mode=<unavailable>) at InternalCalls.cs:65
    frame #21: 0x0000000104850ce0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745_GenericTypeForStructWithNonGCValuesAtZeroOffset_1<System___Canon>__test at B282745.cs:206
    frame #22: 0x00000001048b2cbc nativeaot_SmokeTests_DynamicGenerics`Internal_CompilerGenerated__Module___<DynamicInvoke>Static<S_P_CoreLib_System_Void> + 44
    frame #23: 0x00000001047a09c0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_DynamicInvokeInfo__Invoke(this=0x0000000116421800, thisPtr=<unavailable>, methodToCall=<unavailable>, parameters=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=true) at DynamicInvokeInfo.cs:234
    frame #24: 0x00000001046a6dbc nativeaot_SmokeTests_DynamicGenerics`_S_P_Reflection_Execution_Internal_Reflection_Execution_MethodInvokers_StaticMethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=<unavailable>) at StaticMethodInvoker.cs:36
    frame #25: 0x00000001047c2734 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_Internal_Reflection_Core_Execution_MethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binder=<unavailable>, invokeAttr=<unavailable>, cultureInfo=<unavailable>) at MethodInvoker.cs:30
    frame #26: 0x00000001047a78e0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_Runtime_MethodInfos_RuntimeMethodInfo__Invoke(this=<unavailable>, obj=<unavailable>, invokeAttr=<unavailable>, binder=<unavailable>, parameters=<unavailable>, culture=<unavailable>) at RuntimeMethodInfo.cs:167
    frame #27: 0x00000001046c92d4 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745__testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset at B282745.cs:230
    frame #28: 0x00000001046e0560 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTestMethod(t=<unavailable>) at Runner.cs:117
    frame #29: 0x00000001046e02d0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTest(t=<unavailable>) at Runner.cs:66
    frame #30: 0x00000001046e01b0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTests(allTests=<unavailable>, args=<unavailable>) at Runner.cs:29
    frame #31: 0x00000001046cc68c nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_EntryPointMain__Main(args=<unavailable>) at DynamicGenerics.main.cs:164
    frame #32: 0x000000010487d20c nativeaot_SmokeTests_DynamicGenerics`DynamicGenerics__Module___StartupCodeMain + 76
    frame #33: 0x0000000104620adc nativeaot_SmokeTests_DynamicGenerics`__29-[ViewController viewDidLoad]_block_invoke(.block_descriptor=0x0000000104afca18) at main.m:62:23
    frame #34: 0x0000000106560520 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #35: 0x0000000106562038 libdispatch.dylib`_dispatch_client_callout + 20
    frame #36: 0x0000000106564b60 libdispatch.dylib`_dispatch_queue_override_invoke + 1052
    frame #37: 0x000000010657643c libdispatch.dylib`_dispatch_root_queue_drain + 408
    frame #38: 0x0000000106576e34 libdispatch.dylib`_dispatch_worker_thread2 + 196
    frame #39: 0x00000001fc6acda0 libsystem_pthread.dylib`_pthread_wqthread + 228
* thread #3, queue = 'com.apple.root.default-qos', stop reason = signal SIGSEGV
  * frame #0: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::get_BaseSize(this=0x0000000000000000) at MethodTable.h:180:18 [opt]
    frame #1: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::GetBaseSize(this=0x0000000000000000) at MethodTable.h:349:37 [opt]
    frame #2: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::my_get_size(ob=0x0000000116421d40) at gc.cpp:11403:17 [opt]
    frame #3: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::gc_heap::add_to_promoted_bytes(object="\U00000001", thread=0) at gc.cpp:25684:23 [opt]
    frame #4: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(po=<unavailable>) at gc.cpp:27046:17 [opt]
    frame #5: 0x00000001046542f4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(ppObject=0x000000016b8f6a88, sc=<unavailable>, flags=0) at gc.cpp:48620:5 [opt]
    frame #6: 0x0000000104684c64 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(REGDISPLAY*, bool, unsigned int, void (*)(void*, void**, unsigned int), void*) [inlined] GcInfoDecoder::ReportSlotToGC(this=0x000000016b8f6218, slotDecoder=0x000000016b8f5e68, slotIndex=3, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:0 [opt]
    frame #7: 0x0000000104684c50 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(this=0x000000016b8f6218, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:804:21 [opt]
    frame #8: 0x0000000104686fac nativeaot_SmokeTests_DynamicGenerics`UnixNativeCodeManager::EnumGcRefs(this=<unavailable>, pMethodInfo=0x000000016b8f6500, safePointAddress=<unavailable>, pRegisterSet=0x000000016b8f63a8, hCallback=0x000000016b8f62c0, isActiveStackFrame=false) at UnixNativeCodeManager.cpp:238:18 [opt]
    frame #9: 0x0000000104625168 nativeaot_SmokeTests_DynamicGenerics`RedhawkGCInterface::EnumGcRefs(pCodeManager=<unavailable>, pMethodInfo=<unavailable>, safePointAddress=<unavailable>, pRegisterSet=<unavailable>, pfnEnumCallback=<unavailable>, pvCallbackData=<unavailable>, isActiveStackFrame=<unavailable>) at gcrhenv.cpp:386:19 [opt]
    frame #10: 0x000000010462b3e8 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRootsWorker(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0, frameIterator=0x000000016b8f6388) at thread.cpp:496:17 [opt]
    frame #11: 0x000000010462b164 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRoots(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0) at thread.cpp:386:5 [opt]
    frame #12: 0x0000000104626330 nativeaot_SmokeTests_DynamicGenerics`GCToEEInterface::GcScanRoots(fn=(nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(Object**, ScanContext*, unsigned int) at gc.cpp:48554), condemned=<unavailable>, max_gen=<unavailable>, sc=0x000000016b8f66f0)(Object**, ScanContext*, unsigned int), int, int, ScanContext*) at gcrhscan.cpp:73:22 [opt]
    frame #13: 0x0000000104648030 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_phase(condemned_gen_number=2, mark_only_p=NO) at gc.cpp:28932:9 [opt]
    frame #14: 0x00000001046451d0 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::gc1() at gc.cpp:22018:13 [opt]
    frame #15: 0x000000010464fc5c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::garbage_collect(n=<unavailable>) at gc.cpp:0:21 [opt]
    frame #16: 0x00000001046401d4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollectGeneration(this=<unavailable>, gen=2, reason=reason_induced) at gc.cpp:50082:9 [opt]
    frame #17: 0x000000010466a6a0 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(int, bool, int) [inlined] WKS::GCHeap::GarbageCollectTry(this=<unavailable>, generation=<unavailable>, low_memory_p=<unavailable>, mode=<unavailable>) at gc.cpp:49321:12 [opt]
    frame #18: 0x000000010466a694 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(this=<unavailable>, generation=<unavailable>, low_memory_p=false, mode=2) at gc.cpp:49251:30 [opt]
    frame #19: 0x0000000104622f14 nativeaot_SmokeTests_DynamicGenerics`::RhpCollect(uGeneration=<unavailable>, uMode=<unavailable>) at GCHelpers.cpp:38:35 [opt]
    frame #20: 0x0000000104799c30 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Runtime_InternalCalls__RhCollect(generation=<unavailable>, mode=<unavailable>) at InternalCalls.cs:65
    frame #21: 0x0000000104850ce0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745_GenericTypeForStructWithNonGCValuesAtZeroOffset_1<System___Canon>__test at B282745.cs:206
    frame #22: 0x00000001048b2cbc nativeaot_SmokeTests_DynamicGenerics`Internal_CompilerGenerated__Module___<DynamicInvoke>Static<S_P_CoreLib_System_Void> + 44
    frame #23: 0x00000001047a09c0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_DynamicInvokeInfo__Invoke(this=0x0000000116421800, thisPtr=<unavailable>, methodToCall=<unavailable>, parameters=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=true) at DynamicInvokeInfo.cs:234
    frame #24: 0x00000001046a6dbc nativeaot_SmokeTests_DynamicGenerics`_S_P_Reflection_Execution_Internal_Reflection_Execution_MethodInvokers_StaticMethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=<unavailable>) at StaticMethodInvoker.cs:36
    frame #25: 0x00000001047c2734 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_Internal_Reflection_Core_Execution_MethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binder=<unavailable>, invokeAttr=<unavailable>, cultureInfo=<unavailable>) at MethodInvoker.cs:30
    frame #26: 0x00000001047a78e0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_Runtime_MethodInfos_RuntimeMethodInfo__Invoke(this=<unavailable>, obj=<unavailable>, invokeAttr=<unavailable>, binder=<unavailable>, parameters=<unavailable>, culture=<unavailable>) at RuntimeMethodInfo.cs:167
    frame #27: 0x00000001046c92d4 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745__testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset at B282745.cs:230
    frame #28: 0x00000001046e0560 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTestMethod(t=<unavailable>) at Runner.cs:117
    frame #29: 0x00000001046e02d0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTest(t=<unavailable>) at Runner.cs:66
    frame #30: 0x00000001046e01b0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTests(allTests=<unavailable>, args=<unavailable>) at Runner.cs:29
    frame #31: 0x00000001046cc68c nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_EntryPointMain__Main(args=<unavailable>) at DynamicGenerics.main.cs:164
    frame #32: 0x000000010487d20c nativeaot_SmokeTests_DynamicGenerics`DynamicGenerics__Module___StartupCodeMain + 76
    frame #33: 0x0000000104620adc nativeaot_SmokeTests_DynamicGenerics`__29-[ViewController viewDidLoad]_block_invoke(.block_descriptor=0x0000000104afca18) at main.m:62:23
    frame #34: 0x0000000106560520 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #35: 0x0000000106562038 libdispatch.dylib`_dispatch_client_callout + 20
    frame #36: 0x0000000106564b60 libdispatch.dylib`_dispatch_queue_override_invoke + 1052
    frame #37: 0x000000010657643c libdispatch.dylib`_dispatch_root_queue_drain + 408
    frame #38: 0x0000000106576e34 libdispatch.dylib`_dispatch_worker_thread2 + 196
    frame #39: 0x00000001fc6acda0 libsystem_pthread.dylib`_pthread_wqthread + 228
(lldb) 

Reproduction steps

  1. Build the runtime
./build.sh -ci -arch arm64 -os ios  --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c Release
  1. Build the tests
./src/tests/build.sh  ci os ios arm64 Release -nativeaot tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true  /p:LibrariesConfiguration=Release
  1. Run the app using the Xharness or Xcode.
@ghost
Copy link

ghost commented Jul 25, 2023

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

Issue Details

Description

The TestLdTokenResults and testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset tests failed with Native AOT on apple mobile platforms in #89301.

The TestLdTokenResults test log.

2023-07-25 15:28:08.950229+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] Running Test: Expressions.ExpressionsTesting.TestLdTokenResults
2023-07-25 15:28:09.006706+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] Caught Unexpected exception:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.PlatformNotSupportedException: Dynamic code generation is not supported on this platform.
2023-07-25 15:28:09.006844+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at System.Reflection.Emit.ReflectionEmitThrower.ThrowPlatformNotSupportedException() + 0x30
   at System.Dynamic.Utils.DelegateHelpers.CreateObjectArrayDelegateRefEmit(Type, Func`2) + 0x1ec
   at System.Linq.Expressions.Expression`1.Compile() + 0x40
2023-07-25 15:28:09.006881+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at Expressions.TestRunner`1.RunTest[U](T tval1, T tval2, U uval1, U uval2) + 0x12c
   at nativeaot_SmokeTests_DynamicGenerics!<BaseAddress>+0x2a2f8c
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0x154
2023-07-25 15:28:09.006907+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    --- End of inner exception stack trace ---
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0x344
2023-07-25 15:28:09.006933+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at Internal.Reflection.Execution.MethodInvokers.InstanceMethodInvoker.Invoke(Object, Object[], BinderBundle, Boolean) + 0x5c
   at Internal.Reflection.Core.Execution.MethodInvoker.Invoke(Object, Object[], Binder, BindingFlags, CultureInfo) + 0x54
   at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) + 0x70
2023-07-25 15:28:09.006957+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562]    at Expressions.ExpressionsTesting.TestLdTokenResults() + 0x200
   at CoreFXTestLibrary.Internal.Runner.RunTestMethod(TestInfo) + 0x368
   at CoreFXTestLibrary.Internal.Runner.RunTest(TestInfo) + 0x20
2023-07-25 15:28:09.006981+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] ---- Test FAILED ---------------

The testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset test log.

2023-07-25 15:28:10.187408+0200 nativeaot_SmokeTests_DynamicGenerics[3551:597562] Running Test: B282745.testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset
(lldb) bt
* thread #3, queue = 'com.apple.root.default-qos', stop reason = signal SIGSEGV
  * frame #0: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::get_BaseSize(this=0x0000000000000000) at MethodTable.h:180:18 [opt]
    frame #1: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::GetBaseSize(this=0x0000000000000000) at MethodTable.h:349:37 [opt]
    frame #2: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::my_get_size(ob=0x0000000116421d40) at gc.cpp:11403:17 [opt]
    frame #3: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::gc_heap::add_to_promoted_bytes(object="\U00000001", thread=0) at gc.cpp:25684:23 [opt]
    frame #4: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(po=<unavailable>) at gc.cpp:27046:17 [opt]
    frame #5: 0x00000001046542f4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(ppObject=0x000000016b8f6a88, sc=<unavailable>, flags=0) at gc.cpp:48620:5 [opt]
    frame #6: 0x0000000104684c64 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(REGDISPLAY*, bool, unsigned int, void (*)(void*, void**, unsigned int), void*) [inlined] GcInfoDecoder::ReportSlotToGC(this=0x000000016b8f6218, slotDecoder=0x000000016b8f5e68, slotIndex=3, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:0 [opt]
    frame #7: 0x0000000104684c50 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(this=0x000000016b8f6218, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:804:21 [opt]
    frame #8: 0x0000000104686fac nativeaot_SmokeTests_DynamicGenerics`UnixNativeCodeManager::EnumGcRefs(this=<unavailable>, pMethodInfo=0x000000016b8f6500, safePointAddress=<unavailable>, pRegisterSet=0x000000016b8f63a8, hCallback=0x000000016b8f62c0, isActiveStackFrame=false) at UnixNativeCodeManager.cpp:238:18 [opt]
    frame #9: 0x0000000104625168 nativeaot_SmokeTests_DynamicGenerics`RedhawkGCInterface::EnumGcRefs(pCodeManager=<unavailable>, pMethodInfo=<unavailable>, safePointAddress=<unavailable>, pRegisterSet=<unavailable>, pfnEnumCallback=<unavailable>, pvCallbackData=<unavailable>, isActiveStackFrame=<unavailable>) at gcrhenv.cpp:386:19 [opt]
    frame #10: 0x000000010462b3e8 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRootsWorker(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0, frameIterator=0x000000016b8f6388) at thread.cpp:496:17 [opt]
    frame #11: 0x000000010462b164 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRoots(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0) at thread.cpp:386:5 [opt]
    frame #12: 0x0000000104626330 nativeaot_SmokeTests_DynamicGenerics`GCToEEInterface::GcScanRoots(fn=(nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(Object**, ScanContext*, unsigned int) at gc.cpp:48554), condemned=<unavailable>, max_gen=<unavailable>, sc=0x000000016b8f66f0)(Object**, ScanContext*, unsigned int), int, int, ScanContext*) at gcrhscan.cpp:73:22 [opt]
    frame #13: 0x0000000104648030 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_phase(condemned_gen_number=2, mark_only_p=NO) at gc.cpp:28932:9 [opt]
    frame #14: 0x00000001046451d0 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::gc1() at gc.cpp:22018:13 [opt]
    frame #15: 0x000000010464fc5c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::garbage_collect(n=<unavailable>) at gc.cpp:0:21 [opt]
    frame #16: 0x00000001046401d4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollectGeneration(this=<unavailable>, gen=2, reason=reason_induced) at gc.cpp:50082:9 [opt]
    frame #17: 0x000000010466a6a0 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(int, bool, int) [inlined] WKS::GCHeap::GarbageCollectTry(this=<unavailable>, generation=<unavailable>, low_memory_p=<unavailable>, mode=<unavailable>) at gc.cpp:49321:12 [opt]
    frame #18: 0x000000010466a694 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(this=<unavailable>, generation=<unavailable>, low_memory_p=false, mode=2) at gc.cpp:49251:30 [opt]
    frame #19: 0x0000000104622f14 nativeaot_SmokeTests_DynamicGenerics`::RhpCollect(uGeneration=<unavailable>, uMode=<unavailable>) at GCHelpers.cpp:38:35 [opt]
    frame #20: 0x0000000104799c30 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Runtime_InternalCalls__RhCollect(generation=<unavailable>, mode=<unavailable>) at InternalCalls.cs:65
    frame #21: 0x0000000104850ce0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745_GenericTypeForStructWithNonGCValuesAtZeroOffset_1<System___Canon>__test at B282745.cs:206
    frame #22: 0x00000001048b2cbc nativeaot_SmokeTests_DynamicGenerics`Internal_CompilerGenerated__Module___<DynamicInvoke>Static<S_P_CoreLib_System_Void> + 44
    frame #23: 0x00000001047a09c0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_DynamicInvokeInfo__Invoke(this=0x0000000116421800, thisPtr=<unavailable>, methodToCall=<unavailable>, parameters=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=true) at DynamicInvokeInfo.cs:234
    frame #24: 0x00000001046a6dbc nativeaot_SmokeTests_DynamicGenerics`_S_P_Reflection_Execution_Internal_Reflection_Execution_MethodInvokers_StaticMethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=<unavailable>) at StaticMethodInvoker.cs:36
    frame #25: 0x00000001047c2734 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_Internal_Reflection_Core_Execution_MethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binder=<unavailable>, invokeAttr=<unavailable>, cultureInfo=<unavailable>) at MethodInvoker.cs:30
    frame #26: 0x00000001047a78e0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_Runtime_MethodInfos_RuntimeMethodInfo__Invoke(this=<unavailable>, obj=<unavailable>, invokeAttr=<unavailable>, binder=<unavailable>, parameters=<unavailable>, culture=<unavailable>) at RuntimeMethodInfo.cs:167
    frame #27: 0x00000001046c92d4 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745__testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset at B282745.cs:230
    frame #28: 0x00000001046e0560 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTestMethod(t=<unavailable>) at Runner.cs:117
    frame #29: 0x00000001046e02d0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTest(t=<unavailable>) at Runner.cs:66
    frame #30: 0x00000001046e01b0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTests(allTests=<unavailable>, args=<unavailable>) at Runner.cs:29
    frame #31: 0x00000001046cc68c nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_EntryPointMain__Main(args=<unavailable>) at DynamicGenerics.main.cs:164
    frame #32: 0x000000010487d20c nativeaot_SmokeTests_DynamicGenerics`DynamicGenerics__Module___StartupCodeMain + 76
    frame #33: 0x0000000104620adc nativeaot_SmokeTests_DynamicGenerics`__29-[ViewController viewDidLoad]_block_invoke(.block_descriptor=0x0000000104afca18) at main.m:62:23
    frame #34: 0x0000000106560520 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #35: 0x0000000106562038 libdispatch.dylib`_dispatch_client_callout + 20
    frame #36: 0x0000000106564b60 libdispatch.dylib`_dispatch_queue_override_invoke + 1052
    frame #37: 0x000000010657643c libdispatch.dylib`_dispatch_root_queue_drain + 408
    frame #38: 0x0000000106576e34 libdispatch.dylib`_dispatch_worker_thread2 + 196
    frame #39: 0x00000001fc6acda0 libsystem_pthread.dylib`_pthread_wqthread + 228
* thread #3, queue = 'com.apple.root.default-qos', stop reason = signal SIGSEGV
  * frame #0: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::get_BaseSize(this=0x0000000000000000) at MethodTable.h:180:18 [opt]
    frame #1: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] MethodTable::GetBaseSize(this=0x0000000000000000) at MethodTable.h:349:37 [opt]
    frame #2: 0x0000000104651f8c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::my_get_size(ob=0x0000000116421d40) at gc.cpp:11403:17 [opt]
    frame #3: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(unsigned char**) [inlined] WKS::gc_heap::add_to_promoted_bytes(object="\U00000001", thread=0) at gc.cpp:25684:23 [opt]
    frame #4: 0x0000000104651f84 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_object_simple(po=<unavailable>) at gc.cpp:27046:17 [opt]
    frame #5: 0x00000001046542f4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(ppObject=0x000000016b8f6a88, sc=<unavailable>, flags=0) at gc.cpp:48620:5 [opt]
    frame #6: 0x0000000104684c64 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(REGDISPLAY*, bool, unsigned int, void (*)(void*, void**, unsigned int), void*) [inlined] GcInfoDecoder::ReportSlotToGC(this=0x000000016b8f6218, slotDecoder=0x000000016b8f5e68, slotIndex=3, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:0 [opt]
    frame #7: 0x0000000104684c50 nativeaot_SmokeTests_DynamicGenerics`GcInfoDecoder::EnumerateLiveSlots(this=0x000000016b8f6218, pRD=0x000000016b8f63a8, reportScratchSlots=false, inputFlags=0, pCallBack=(nativeaot_SmokeTests_DynamicGenerics`EnumGcRefsCallback(void*, void**, unsigned int) at gcrhenv.cpp:365), hCallBack=0x000000016b8f62c0)(void*, void**, unsigned int), void*) at gcinfodecoder.cpp:804:21 [opt]
    frame #8: 0x0000000104686fac nativeaot_SmokeTests_DynamicGenerics`UnixNativeCodeManager::EnumGcRefs(this=<unavailable>, pMethodInfo=0x000000016b8f6500, safePointAddress=<unavailable>, pRegisterSet=0x000000016b8f63a8, hCallback=0x000000016b8f62c0, isActiveStackFrame=false) at UnixNativeCodeManager.cpp:238:18 [opt]
    frame #9: 0x0000000104625168 nativeaot_SmokeTests_DynamicGenerics`RedhawkGCInterface::EnumGcRefs(pCodeManager=<unavailable>, pMethodInfo=<unavailable>, safePointAddress=<unavailable>, pRegisterSet=<unavailable>, pfnEnumCallback=<unavailable>, pvCallbackData=<unavailable>, isActiveStackFrame=<unavailable>) at gcrhenv.cpp:386:19 [opt]
    frame #10: 0x000000010462b3e8 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRootsWorker(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0, frameIterator=0x000000016b8f6388) at thread.cpp:496:17 [opt]
    frame #11: 0x000000010462b164 nativeaot_SmokeTests_DynamicGenerics`Thread::GcScanRoots(this=0x0000000106705348, pfnEnumCallback=0x00000001046541e4, pvCallbackData=0x000000016b8f66f0) at thread.cpp:386:5 [opt]
    frame #12: 0x0000000104626330 nativeaot_SmokeTests_DynamicGenerics`GCToEEInterface::GcScanRoots(fn=(nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::Promote(Object**, ScanContext*, unsigned int) at gc.cpp:48554), condemned=<unavailable>, max_gen=<unavailable>, sc=0x000000016b8f66f0)(Object**, ScanContext*, unsigned int), int, int, ScanContext*) at gcrhscan.cpp:73:22 [opt]
    frame #13: 0x0000000104648030 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::mark_phase(condemned_gen_number=2, mark_only_p=NO) at gc.cpp:28932:9 [opt]
    frame #14: 0x00000001046451d0 nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::gc1() at gc.cpp:22018:13 [opt]
    frame #15: 0x000000010464fc5c nativeaot_SmokeTests_DynamicGenerics`WKS::gc_heap::garbage_collect(n=<unavailable>) at gc.cpp:0:21 [opt]
    frame #16: 0x00000001046401d4 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollectGeneration(this=<unavailable>, gen=2, reason=reason_induced) at gc.cpp:50082:9 [opt]
    frame #17: 0x000000010466a6a0 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(int, bool, int) [inlined] WKS::GCHeap::GarbageCollectTry(this=<unavailable>, generation=<unavailable>, low_memory_p=<unavailable>, mode=<unavailable>) at gc.cpp:49321:12 [opt]
    frame #18: 0x000000010466a694 nativeaot_SmokeTests_DynamicGenerics`WKS::GCHeap::GarbageCollect(this=<unavailable>, generation=<unavailable>, low_memory_p=false, mode=2) at gc.cpp:49251:30 [opt]
    frame #19: 0x0000000104622f14 nativeaot_SmokeTests_DynamicGenerics`::RhpCollect(uGeneration=<unavailable>, uMode=<unavailable>) at GCHelpers.cpp:38:35 [opt]
    frame #20: 0x0000000104799c30 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Runtime_InternalCalls__RhCollect(generation=<unavailable>, mode=<unavailable>) at InternalCalls.cs:65
    frame #21: 0x0000000104850ce0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745_GenericTypeForStructWithNonGCValuesAtZeroOffset_1<System___Canon>__test at B282745.cs:206
    frame #22: 0x00000001048b2cbc nativeaot_SmokeTests_DynamicGenerics`Internal_CompilerGenerated__Module___<DynamicInvoke>Static<S_P_CoreLib_System_Void> + 44
    frame #23: 0x00000001047a09c0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_DynamicInvokeInfo__Invoke(this=0x0000000116421800, thisPtr=<unavailable>, methodToCall=<unavailable>, parameters=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=true) at DynamicInvokeInfo.cs:234
    frame #24: 0x00000001046a6dbc nativeaot_SmokeTests_DynamicGenerics`_S_P_Reflection_Execution_Internal_Reflection_Execution_MethodInvokers_StaticMethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binderBundle=<unavailable>, wrapInTargetInvocationException=<unavailable>) at StaticMethodInvoker.cs:36
    frame #25: 0x00000001047c2734 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_Internal_Reflection_Core_Execution_MethodInvoker__Invoke(this=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, binder=<unavailable>, invokeAttr=<unavailable>, cultureInfo=<unavailable>) at MethodInvoker.cs:30
    frame #26: 0x00000001047a78e0 nativeaot_SmokeTests_DynamicGenerics`_S_P_CoreLib_System_Reflection_Runtime_MethodInfos_RuntimeMethodInfo__Invoke(this=<unavailable>, obj=<unavailable>, invokeAttr=<unavailable>, binder=<unavailable>, parameters=<unavailable>, culture=<unavailable>) at RuntimeMethodInfo.cs:167
    frame #27: 0x00000001046c92d4 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_B282745__testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset at B282745.cs:230
    frame #28: 0x00000001046e0560 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTestMethod(t=<unavailable>) at Runner.cs:117
    frame #29: 0x00000001046e02d0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTest(t=<unavailable>) at Runner.cs:66
    frame #30: 0x00000001046e01b0 nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_CoreFXTestLibrary_Internal_Runner__RunTests(allTests=<unavailable>, args=<unavailable>) at Runner.cs:29
    frame #31: 0x00000001046cc68c nativeaot_SmokeTests_DynamicGenerics`_DynamicGenerics_EntryPointMain__Main(args=<unavailable>) at DynamicGenerics.main.cs:164
    frame #32: 0x000000010487d20c nativeaot_SmokeTests_DynamicGenerics`DynamicGenerics__Module___StartupCodeMain + 76
    frame #33: 0x0000000104620adc nativeaot_SmokeTests_DynamicGenerics`__29-[ViewController viewDidLoad]_block_invoke(.block_descriptor=0x0000000104afca18) at main.m:62:23
    frame #34: 0x0000000106560520 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #35: 0x0000000106562038 libdispatch.dylib`_dispatch_client_callout + 20
    frame #36: 0x0000000106564b60 libdispatch.dylib`_dispatch_queue_override_invoke + 1052
    frame #37: 0x000000010657643c libdispatch.dylib`_dispatch_root_queue_drain + 408
    frame #38: 0x0000000106576e34 libdispatch.dylib`_dispatch_worker_thread2 + 196
    frame #39: 0x00000001fc6acda0 libsystem_pthread.dylib`_pthread_wqthread + 228
(lldb) 

Reproduction steps

  1. Build the runtime
./build.sh -ci -arch arm64 -os ios  --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c Release
  1. Build the tests
./src/tests/build.sh  ci os ios arm64 Release -nativeaot tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true  /p:LibrariesConfiguration=Release
  1. Run the app using the Xharness or Xcode.
Author: kotlarmilos
Assignees: -
Labels:

os-ios, area-NativeAOT-coreclr

Milestone: 9.0.0

@steveisok
Copy link
Member

Is that by design? It's throwing PNSE in the stack trace.

@kotlarmilos
Copy link
Member Author

Correct, the TestLdTokenResults throws PlatformNotSupportedException. The testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset seems to access a MethodTable instance which is NULL.

@MichalStrehovsky
Copy link
Member

Are you sure your runtime/libs build was up to date with the test code?

  1. TestLdTokenResults should have been fixed with @ivanpovazan's [libs][iOS] Unify System.Linq.Expression.dll build for all platforms #88723
  2. As Jan pointed out, testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset is a new regression test that was checked in along with the fix. If your compiler build was stale as 1 suggests, it would also explain why it's failing (because you have the new test, but the compiler build is old).

@MichalStrehovsky MichalStrehovsky modified the milestones: 9.0.0, 8.0.0 Jul 25, 2023
@MichalStrehovsky
Copy link
Member

I'm moving this to 8.0 because TestLdTokenResults failing would mean Linq expressions don't work at all. We need to understand if that's the case.

@kotlarmilos
Copy link
Member Author

kotlarmilos commented Jul 26, 2023

@MichalStrehovsky Thanks for the hint! After compiling against the latest bits the both failures are gone. Sorry for the false alert, we can close this issue.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants