xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.42k stars 507 forks source link

Xamarin iOS App Crash on iPad Air 5 - iOS 17.5.1 #20766

Closed mmazmy closed 4 days ago

mmazmy commented 4 days ago

Steps to Reproduce

  1. Build App from Mac OS 14.5.0 - Visual Studio 17.6.12 (build 410) - Xamarin.IOS 16.4.0.23 xcode14.3
  2. check app on most devices working ok
  3. Submit for apple review
  4. Apple returns that app crashes on iPad Air 5 iOS 17.51 and also later added iPhone 13 Mini

Expected Behavior

App should work on all iPads ... we already tested it on iPad Pro and works fine

Actual Behavior

aer per apple app crashes on iPad Air 5 iOS 17.51

Environment

Mac OS 14.5.0 - Visual Studio 17.6.12 (build 410) - Xamarin.IOS 16.4.0.23 xcode14.3

Version information ``` Visual Studio Community 2022 for Mac Version 17.6.12 (build 410) Installation UUID: 8c6889c8-c026-4bb1-9637-cf13e76ba962 Runtime .NET 7.0.3 (64-bit) Architecture: X64 Microsoft.macOS.Sdk 13.1.1007; git-rev-head:8afca776a0a96613dfb7200e0917bb57f9ed5583; git-branch:release/7.0.1xx-xcode14.2 Roslyn (Language Service) 4.6.0-3.23180.6+99e956e42697a6dd886d1e12478ea2b27cceacfa NuGet Version: 6.4.0.117 .NET SDK (x64) SDK: /usr/local/share/dotnet/sdk/7.0.316/Sdks SDK Versions: 7.0.316 7.0.315 6.0.422 6.0.421 MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET Runtime (x64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 7.0.19 7.0.18 6.0.30 6.0.29 Xamarin.Profiler Version: 1.8.0.49 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater Version: 11 Apple Developer Tools Xcode: 15.4 22622 Build: 15F31d Xamarin.Mac Not Installed Xamarin.iOS Version: 16.4.0.23 Visual Studio Community Hash: 9defd91b3 Branch: xcode14.3 Build date: 2023-10-23 16:15:00-0400 Xamarin Designer Version: 17.6.3.9 Hash: 2648399ae8 Branch: remotes/origin/d17-6 Build date: 2024-05-08 22:24:17 UTC Xamarin.Android Not Installed Microsoft Build of OpenJDK Java SDK: Not Found Eclipse Temurin JDK Java SDK: Not Found Android SDK Manager Version: 17.6.0.50 Hash: a715dca Branch: HEAD Build date: 2024-05-08 22:24:22 UTC Android Device Manager Version: 0.0.0.1309 Hash: 06e3e77 Branch: HEAD Build date: 2024-05-08 22:24:22 UTC Build Information Release ID: 1706120410 Git revision: 2f8e0518dd80a933901821bac53f7398d4b61c0f Build date: 2024-05-08 22:22:37+00 Build branch: release-17.6 Build lane: release-17.6 Operating System Mac OS X 14.5.0 Darwin 23.5.0 Darwin Kernel Version 23.5.0 Wed May 1 20:09:52 PDT 2024 root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64 ```

Build Logs

Example Project (If Possible)

rolfbjarne commented 4 days ago

Please attach the crash reports provided by Apple to start investigating this.

Also, does the app work on your iPad Pro if you test it through TestFlight?

mmazmy commented 4 days ago

crashlog-DC0D8C6F-12C0-4783-A353-B3B26E311BDE.txt crashlog-3FCC2F27-7423-46E0-B238-08D4D6DCFC07 1.txt crashlog-7567820E-9129-4E47-85A2-8CCAC60FDAB2 1.txt crashlog-7567820E-9129-4E47-85A2-8CCAC60FDAB2.txt crashlog-DC0D8C6F-12C0-4783-A353-B3B26E311BDE 1.txt crashlog-04F97BF7-234D-4DCA-ABC3-2DF89A1FF857 1.txt crashlog-3FCC2F27-7423-46E0-B238-08D4D6DCFC07.txt crashlog-04F97BF7-234D-4DCA-ABC3-2DF89A1FF857.txt

Apple provided many crash log files on iPad Air 5 and also for iPhone 13 Mini

And yes we tested the app from test flight on iPad Pro and iPhone 15 and 13 and all working ok

rolfbjarne commented 4 days ago

The same thing happens in all crash reports: your main thread blocks for more than 20s, and the app is terminated.


Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-create watchdog transgression: app<FransiMobile(7C1FF739-4529-4175-B15F-0CA0B9C03FEF)>:459 exhausted real (wall clock) time allowance of 19.71 seconds
ProcessVisibility: Foreground
ProcessState: Running
WatchdogEvent: scene-create
WatchdogVisibility: Foreground
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 57.680 (user 41.990, system 15.690), 49% CPU",
"Elapsed application CPU time (seconds): 0.756, 1% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

Thread 0 name:  tid_103 Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib                 0x1ea5c4808 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1ea5c8008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1ea5c7f20 mach_msg_overwrite + 436
3   libsystem_kernel.dylib                 0x1ea5c7d60 mach_msg + 24
4   libdispatch.dylib                      0x1a93d4b18 _dispatch_mach_send_and_wait_for_reply + 544
5   libdispatch.dylib                      0x1a93d4eb8 dispatch_mach_send_with_result_and_wait_for_reply + 60
6   libxpc.dylib                           0x1fe3bbac8 xpc_connection_send_message_with_reply_sync + 264
7   Foundation                             0x1a03a3998 __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ + 16
8   Foundation                             0x1a03a0004 -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2160
9   Foundation                             0x1a041815c -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:arg3:] + 136
10  Foundation                             0x1a0417dec _NSXPCDistantObjectSimpleMessageSend3 + 76
11  CoreLocation                           0x1ae6cda84 0x1ae6b3000 + 109188
12  CoreLocation                           0x1ae6cd980 0x1ae6b3000 + 108928
13  CoreLocation                           0x1ae6cbffc 0x1ae6b3000 + 102396
14  GIBMobileSdk                           0x106f2cde4 LocationCapability.run() + 120
15  GIBMobileSdk                           0x106f04d60 protocol witness for GIBCapabilityProtocol.run() in conformance GIBCapability + 36
16  GIBMobileSdk                           0x106f27da8 GIBSwiftManager.enableCapability(_:) + 168
17  GIBMobileSdk                           0x106f27df8 @objc GIBSwiftManager.enableCapability(_:) + 32
18  GIBMobileSdk                           0x106ef5158 +[GIBMobileSDK enableCapability:] + 64
19  BSFIOSApp                              0x1063b7c28 0x104ba8000 + 25230376
20  BSFIOSApp                              0x1063b6860 0x104ba8000 + 25225312
21  BSFIOSApp                              0x104c37394 0x104ba8000 + 586644
22  BSFIOSApp                              0x104c37280 0x104ba8000 + 586368
23  BSFIOSApp                              0x104fcf590 0x104ba8000 + 4355472
24  Mono                                   0x1072e7c4c mono_jit_runtime_invoke + 1136
25  Mono                                   0x1073a241c mono_runtime_invoke_checked + 148
26  Mono                                   0x1073a5c5c mono_runtime_invoke + 144
[...]

You call [GIBMobileSdk enableCapability] (frame 18), which then goes on to do something that seems to be network related (xpc), which apparently takes a long time.

You might be able to reproduce yourself if you disable network access on your iPad, or otherwise simulate a really slow network.

My suggestion would be to call [GIBMobileSdk enableCapability] in a background thread.

In any case, this is not an issue in our SDK, so I'm closing this.