Solving recurring crashes

Udi_IdanUdi_Idan ILMember ✭✭
edited February 14 in Xamarin.iOS

I have added Microsoft's Appcenter crash reporting and there are 2 crashes which recur multiple times.
I'm trying to make sense of them and I'm not able to reproduce them in QA.

The Xamarin stack trace is different in the two of them, but the raw exception makes me wonder if they might be related, especially because of of the line including GADAdSizeFromNSValue.

CRASH #1

Xamarin Exception Stack:
System.NullReferenceException: Object reference not set to an instance of an object

at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) <0x102936cb0 + 0x00094> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.Tasks.Task.FinishContinuations () <0x102931ba0 + 0x0013f> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.Tasks.Task.FinishStageThree () <0x102930290 + 0x00097> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.Tasks.Task.FinishStageTwo () <0x1029300d0 + 0x0019f> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.Tasks.Task.Finish (System.Boolean bUserDelegateExecuted) <0x10292ff40 + 0x0002b> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) <0x10292e1f0 + 0x0005f> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[TResult].SetException (System.Exception exception) <0x102967720 + 0x0008f>in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0 at System.Net.WebCompletionSource1+d__15[T].MoveNext () <0x102bf5bc0 + 0x002db> in <614ae2fe5b884710984c3e1d50cdd53b#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) <0x102968d00 + 0x0009b> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x10291d170 + 0x00197> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x10291d130 + 0x0002b> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () <0x102968ba0 + 0x000bb> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.Tasks.AwaitTaskContinuation.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x102936980 + 0x0002f> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x1029226a0 + 0x00217> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0
at ObjCRuntime.Runtime.ThreadPoolDispatcher (System.Func`1[TResult] callback) <0x1030352b0 + 0x0003f> in <5782a71edfb44eafb4f946b787faeb4a#fa5c637e818ab23c2fd4587285a4076e>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x1029247c0 + 0x00087> in <e52fabd7a0824ae79d729c82e53f2aa9#fa5c637e818ab23c2fd4587285a4076e>:0

**Thread 14 Crashed:**
0   libsystem_kernel.dylib               0x00000001c06f3104 __pthread_kill + 8
1   libsystem_c.dylib                    0x00000001c064ad78 abort + 136
2   MyAppName                              0x000000010392a3e4 xamarin_get_block_descriptor + 5212
3   MyAppName                              0x000000010381a4f8 GADAdSizeFromNSValue + 1516552
4   MyAppName                              0x000000010389d454 GADAdSizeFromNSValue + 2052964
5   MyAppName                              0x0000000103895e84 GADAdSizeFromNSValue + 2022804
6   MyAppName                              0x0000000103893c60 GADAdSizeFromNSValue + 2014064
7   MyAppName                              0x000000010389de10 GADAdSizeFromNSValue + 2055456
8   MyAppName                              0x000000010389dc94 GADAdSizeFromNSValue + 2055076
9   libsystem_pthread.dylib              0x00000001c077825c _pthread_body + 124
10  libsystem_pthread.dylib              0x00000001c07781bc _pthread_start + 44
11  libsystem_pthread.dylib              0x00000001c077bcf4 thread_start + 0

CRASH #2

**Xamarin Exception Stack:**
System.NullReferenceException: Object reference not set to an instance of an object
  at MyAppName.revealFromBottom.Perform () <0x100a49c30 + 0x001fc> in <298477d80aa44d91a4f49b29398660a0#fa5c637e818ab23c2fd4587285a4076e>:0
  at (wrapper managed-to-native) ObjCRuntime.Messaging.objc_msgSendSuper(intptr,intptr,intptr,intptr)
  at UIKit.UIViewController.PerformSegue (System.String identifier, Foundation.NSObject sender) <0x101311f80 + 0x000f7> in <5782a71edfb44eafb4f946b787faeb4a#fa5c637e818ab23c2fd4587285a4076e>:0
  at MyAppName.GamePlayViewController.<OnTimerElapsed>b__37_1 () <0x100a31090 + 0x00077> in <298477d80aa44d91a4f49b29398660a0#fa5c637e818ab23c2fd4587285a4076e>:0
  at Foundation.NSActionDispatcher.Apply () <0x10132a120 + 0x00023> in <5782a71edfb44eafb4f946b787faeb4a#fa5c637e818ab23c2fd4587285a4076e>:0
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) <0x101303770 + 0x0002b> in <5782a71edfb44eafb4f946b787faeb4a#fa5c637e818ab23c2fd4587285a4076e>:0
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) <0x1013036b0 + 0x000ab> in <5782a71edfb44eafb4f946b787faeb4a#fa5c637e818ab23c2fd4587285a4076e>:0
  at MyAppName.Application.Main (System.String[] args) <0x100a21fe0 + 0x00023> in <298477d80aa44d91a4f49b29398660a0#fa5c637e818ab23c2fd4587285a4076e>:0

**Thread 0 Crashed:**
0   libsystem_kernel.dylib               0x00000001845ff104 __pthread_kill + 8
1   libsystem_c.dylib                    0x0000000184556d78 abort + 136
2   MyAppName                              0x0000000101be63e4 xamarin_get_block_descriptor + 5212
3   MyAppName                              0x0000000101ad64f8 GADAdSizeFromNSValue + 1516552
4   MyAppName                              0x0000000101a8a9e0 GADAdSizeFromNSValue + 1206512
5   MyAppName                              0x0000000101a896e0 GADAdSizeFromNSValue + 1201648
6   MyAppName                              0x0000000101a8076c GADAdSizeFromNSValue + 1164924
7   MyAppName                              0x0000000100a49e24 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 563348
8   MyAppName                              0x0000000100d60638 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 3801256
9   MyAppName                              0x0000000101a9be6c GADAdSizeFromNSValue + 1277308
10  MyAppName                              0x0000000101b1fef0 GADAdSizeFromNSValue + 1818112
11  MyAppName                              0x0000000101b23808 GADAdSizeFromNSValue + 1832728
12  MyAppName                              0x00000001009e6b68 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 157144
13  MyAppName                              0x00000001009f4c80 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 214768
14  UIKitCore                            0x00000001b1ee0f7c -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 288
15  UIKitCore                            0x00000001b1ee0e28 -[UIStoryboardSegueTemplate _perform:] + 88
16  UIKitCore                            0x00000001b17861a4 -[UIViewController performSegueWithIdentifier:sender:] + 104
17  MyAppName                              0x000000010134f9f8 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 10024040
18  MyAppName                              0x0000000101312078 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 9771752
19  MyAppName                              0x0000000100a31108 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 461688
20  MyAppName                              0x000000010132a144 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 9870260
21  MyAppName                              0x0000000100d60638 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 3801256
22  MyAppName                              0x0000000101a9be6c GADAdSizeFromNSValue + 1277308
23  MyAppName                              0x0000000101b1fef0 GADAdSizeFromNSValue + 1818112
24  MyAppName                              0x0000000101b23808 GADAdSizeFromNSValue + 1832728
25  MyAppName                              0x00000001009e6b68 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 157144
26  MyAppName                              0x00000001009e73e8 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 159320
27  Foundation                           0x000000018551c42c __NSThreadPerformPerform + 332
28  CoreFoundation                       0x00000001849f91f0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
29  CoreFoundation                       0x00000001849f9170 __CFRunLoopDoSource0 + 84
30  CoreFoundation                       0x00000001849f8a54 __CFRunLoopDoSources0 + 172
31  CoreFoundation                       0x00000001849f3920 __CFRunLoopRun + 1036
32  CoreFoundation                       0x00000001849f31f0 CFRunLoopRunSpecific + 432
33  GraphicsServices                     0x0000000186c6c584 GSEventRunModal + 96
34  UIKitCore                            0x00000001b1d4ad40 UIApplicationMain + 208
35  MyAppName                              0x000000010135a0b8 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 10066728
36  MyAppName                              0x000000010130379c plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 9712140
37  MyAppName                              0x000000010130375c plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 9712076
38  MyAppName                              0x0000000100a22004 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 399988
39  MyAppName                              0x0000000100d60638 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 3801256
40  MyAppName                              0x0000000101a9be6c GADAdSizeFromNSValue + 1277308
41  MyAppName                              0x0000000101b1fef0 GADAdSizeFromNSValue + 1818112
42  MyAppName                              0x0000000101b25dd4 GADAdSizeFromNSValue + 1842404
43  MyAppName                              0x0000000101a7c344 GADAdSizeFromNSValue + 1147476
44  MyAppName                              0x0000000101bed408 xamarin_release_block_on_main_thread + 24172
45  MyAppName                              0x0000000100a11fc0 plcrash::MS::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next(unsigned int*, plcrash::MS::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 334384
46  libdyld.dylib                        0x00000001844b2bb4 start + 0

revealFromBottom is a custom segue:

public partial class revealFromBottom : UIStoryboardSegue
{
    CATransition transition;

    public revealFromBottom (IntPtr handle) : base (handle)
    {
    }

    public override void Perform()
    {
        CATransaction.Begin();

        CATransaction.CompletionBlock = () =>
        {
        };


        transition = new CATransition();
        transition.Duration = 0.6;
        transition.TimingFunction = CAMediaTimingFunction.FromName(CAMediaTimingFunction.EaseOut);
        transition.Type = CAAnimation.TransitionPush;
        transition.Subtype = CAAnimation.TransitionFromTop;
        SourceViewController.NavigationController.View.Layer.AddAnimation(transition, CALayer.Transition);
        SourceViewController.NavigationController.PushViewController(DestinationViewController, false);
        CATransaction.Commit();

    }
}

Does anyone understand what causes these crashes and how can I solve them or workaround them?

These two crashes are about 95% of crashes in the app and any help would be appreciated.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    If you can't find the accurate error at debug time, we can't know what lines cause this issue from your stack trace too.
    You should 100% percent reproduce this issue on your side first. Post the related code, then we can help you analyze the root cause.

Sign In or Register to comment.