microsoft / appcenter

Central repository for App Center open source resources and planning.
https://appcenter.ms
Creative Commons Attribution 4.0 International
1.01k stars 224 forks source link

iOS app crash on MSCrashes.channel:didPrepareLog:internalId:flags: #326

Closed ufna closed 5 years ago

ufna commented 5 years ago

What App Center service does this affect? Analytics/Crashes

Describe the bug Just received crash report from internal tester.

To Reproduce Currently looking for WTR.

Expected behavior No crashes inside Crashes module.

Smartphone (please complete the following information):

Additional context Crash id 2518475604700009999-9fe2103b-4c73-47e3-b2fd-13ee556f82bb

Thread 0 Crashed:
0   libsystem_kernel.dylib               0x0000000190deb104 __pthread_kill + 8
1   libsystem_c.dylib                    0x0000000190d42d78 abort + 136
2   libsystem_malloc.dylib               0x0000000190e3f768 malloc_vreport + 568
3   libsystem_malloc.dylib               0x0000000190e3f924 malloc_report + 60
4   libsystem_malloc.dylib               0x0000000190e322d4 free + 372
5   libc++.1.dylib                       0x00000001903ef7fc std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long) + 260
6   Zen                                  0x0000000104ac6f4c -[MSCrashes channel:didPrepareLog:internalId:flags:] (string:1471)
7   Zen                                  0x0000000104a929b8 -[MSChannelGroupDefault enumerateDelegatesForSelector:withBlock:] (MSChannelGroupDefault.m:89)
8   Zen                                  0x0000000104a92c94 -[MSChannelGroupDefault channel:didPrepareLog:internalId:flags:] (MSChannelGroupDefault.m:104)
9   Zen                                  0x0000000104aa441c -[MSChannelUnitDefault enumerateDelegatesForSelector:withBlock:] (MSChannelUnitDefault.m:512)
10  Zen                                  0x0000000104a9fd64 -[MSChannelUnitDefault enqueueItem:flags:] (MSChannelUnitDefault.m:122)
11  Zen                                  0x0000000104ab28f0 -[MSAnalytics sendLog:flags:] (MSAnalytics.m:372)
12  Zen                                  0x0000000104ab3994 -[MSSessionTracker renewSessionId] (MSSessionTracker.m:51)
13  CoreFoundation                       0x00000001911c483c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 16
14  CoreFoundation                       0x00000001911c4808 ___CFXRegistrationPost_block_invoke + 60
15  CoreFoundation                       0x00000001911c3cf8 _CFXRegistrationPost + 388
16  CoreFoundation                       0x00000001911c39a4 ___CFXNotificationPost_block_invoke + 92
17  CoreFoundation                       0x000000019113bb80 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1400
18  CoreFoundation                       0x00000001911c3430 _CFXNotificationPost + 692
19  Foundation                           0x0000000191bd4ca0 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
20  UIKitCore                            0x00000001be5594fc -[UIApplication _sendWillEnterForegroundCallbacks] + 228
21  UIKitCore                            0x00000001bdddb5f4 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 2764
22  UIKitCore                            0x00000001bddd9058 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 768
23  UIKitCore                            0x00000001bddd8d04 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 428
24  UIKitCore                            0x00000001bddddec4 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 216
25  UIKitCore                            0x00000001bdddee24 _performActionsWithDelayForTransitionContext + 108
26  UIKitCore                            0x00000001bddddd7c -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 244
27  UIKitCore                            0x00000001bdde2c68 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 364
28  UIKitCore                            0x00000001be128728 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464
29  FrontBoardServices                   0x0000000193c8d6e4 __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.359 + 224
30  libdispatch.dylib                    0x0000000190c8e484 _dispatch_client_callout + 12
31  libdispatch.dylib                    0x0000000190c653e0 _dispatch_block_invoke_direct$VARIANT$armv81 + 212
32  FrontBoardServices                   0x0000000193ccba9c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
33  FrontBoardServices                   0x0000000193ccb728 -[FBSSerialQueue _performNext] + 412
34  FrontBoardServices                   0x0000000193ccbd44 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
35  CoreFoundation                       0x00000001911e60e0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
36  CoreFoundation                       0x00000001911e6060 __CFRunLoopDoSource0 + 84
37  CoreFoundation                       0x00000001911e5944 __CFRunLoopDoSources0 + 172
38  CoreFoundation                       0x00000001911e0810 __CFRunLoopRun + 1036
39  CoreFoundation                       0x00000001911e00e0 CFRunLoopRunSpecific + 432
40  GraphicsServices                     0x0000000193459584 GSEventRunModal + 96
41  UIKitCore                            0x00000001be540c00 UIApplicationMain + 208
42  Zen                                  0x0000000105289e54 main (LaunchIOS.cpp:408)
43  libdyld.dylib                        0x0000000190c9ebb4 start + 0
ufna commented 5 years ago

Few additional details:

This type of crash will occur if:

  1. Both Analytics and Crashes modules are enabled
  2. I'm sending event in a few moments after MSAppCenter is started.

It looks like some internal race condition.

Thread 0 Crashed:
0   libsystem_kernel.dylib               0x00000001a695e0dc __pthread_kill + 8
1   libsystem_c.dylib                    0x00000001a68b7ea8 abort + 136
2   libsystem_malloc.dylib               0x00000001a69b1780 malloc_vreport + 560
3   libsystem_malloc.dylib               0x00000001a69b1938 malloc_report + 56
4   libsystem_malloc.dylib               0x00000001a69a45e8 free + 528
5   libc++.1.dylib                       0x00000001a5f6c2f0 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long) + 256
6   Zen                                  0x0000000104d6b3f4 -[MSCrashes channel:didPrepareLog:internalId:flags:] (string:1471)
7   Zen                                  0x0000000104d36e60 -[MSChannelGroupDefault enumerateDelegatesForSelector:withBlock:] (MSChannelGroupDefault.m:89)
8   Zen                                  0x0000000104d3713c -[MSChannelGroupDefault channel:didPrepareLog:internalId:flags:] (MSChannelGroupDefault.m:104)
9   Zen                                  0x0000000104d488c4 -[MSChannelUnitDefault enumerateDelegatesForSelector:withBlock:] (MSChannelUnitDefault.m:512)
10  Zen                                  0x0000000104d4420c -[MSChannelUnitDefault enqueueItem:flags:] (MSChannelUnitDefault.m:122)
11  Zen                                  0x0000000104d56d98 -[MSAnalytics sendLog:flags:] (MSAnalytics.m:372)
12  Zen                                  0x0000000104d565f0 -[MSAnalytics trackEvent:withTypedProperties:forTransmissionTarget:flags:] (MSAnalytics.m:305)
13  Zen                                  0x0000000104d5625c -[MSAnalytics trackEvent:withProperties:forTransmissionTarget:flags:] (MSAnalytics.m:255)
14  Zen                                  0x0000000104d55d7c +[MSAnalytics trackEvent:withProperties:forTransmissionTarget:flags:] (MSAnalytics.m:199)
15  Zen                                  0x0000000104d55c30 +[MSAnalytics trackEvent:withProperties:flags:] (MSAnalytics.m:184)
16  libdispatch.dylib                    0x00000001a6800a38 _dispatch_call_block_and_release + 20
17  libdispatch.dylib                    0x00000001a68017d4 _dispatch_client_callout + 12
18  libdispatch.dylib                    0x00000001a67af004 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1064
19  CoreFoundation                       0x00000001a6d51ec0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
20  CoreFoundation                       0x00000001a6d4cdf8 __CFRunLoopRun + 1920
21  CoreFoundation                       0x00000001a6d4c354 CFRunLoopRunSpecific + 432
22  GraphicsServices                     0x00000001a8f4c79c GSEventRunModal + 100
23  UIKitCore                            0x00000001d3303b68 UIApplicationMain + 208
24  Zen                                  0x000000010552e2fc main (LaunchIOS.cpp:408)
25  libdyld.dylib                        0x00000001a68128e0 start + 0
winnie commented 5 years ago

Hi @ufna - thanks for reporting this. Our engineering team will need to take a deeper look. Can you start a conversation in the blue chat bubble on the bottom right corner of App Center? You can mention this ticket and we will get this routed to the proper team. Thank you!

AnastasiaKubova commented 5 years ago

Hi, @ufna! Could you please update SDK to the latest version and try to reproduce this problem again.

ufna commented 5 years ago

Hi, @AnastasiaKubova ,

I've checked the 2.0.1 version right now and it has the same issue:

8bf54199c3f8e31bbf05f89624530503

jaeklim commented 5 years ago

@ufna Can you capture device logs at the time it crashes? I need to see what happened in [MSCrashes channel:didPrepareLog:internalId:flags:] while it was processing events.

ufna commented 5 years ago

@jaelim-ms , sure, here it is. I've set log level to verbose also. If you need, I can provide test build.

crashlog.txt

jaeklim commented 5 years ago

@ufna Thanks for the log! Would you mind if you can capture all logs (without modifying/truncating) from first launch (that causes a crash) all the way thru the second launch (that shows handling the previous crash)? Launch the app -> Crash -> Launch the app again. I would like to see logs that shows "App Center SDK configured successfully." twice in logs. Thanks in advance.

ufna commented 5 years ago

@jaelim-ms , Clean install and two launches.

logs2.txt

annakocheshkova commented 5 years ago

Hi @ufna! Could you please send us two separate sets of verbose logs: 1st launch where the crash happens 2nd launch where the crash should be sent

We can't see enough information in the logs you sent. Basically we want to spot two places where SDK configuration (on start) occurs.

pushkindev commented 5 years ago

@annakocheshkova

annakocheshkova commented 5 years ago

@pushkindev in the first file, I see only one entry from App Center and no crash, any chance these logs get somehow filtered out?

ufna commented 5 years ago

@annakocheshkova, it's all logs from XCode console, no filters applied. I can provide the app build itself (signed with enterprize cert)

annakocheshkova commented 5 years ago

@ufna quite strange, do you start the app after the console is opened? Yes please provide the test build if it's possible.

ufna commented 5 years ago

@ufna I've sent you e-mail with build url.

jaeklim commented 5 years ago

We've discussed the issue in App Center support channel. The issue is caused by using UE4 custom allocator, the customer's issue is temporarily fixed by a workaround to use ANSI allocator. The root cause is not in App Center SDK but in UE4, it should be fixed by the platform.

tianpeili commented 2 years ago

Hi, We repo this bug in version 3.4.6 . What should I do? or what should I provide? We can not repo in local. But AppCenter crash reports have a lot of this crash.

image

AnatolyPristensky commented 2 years ago

Hello, @tianpeili, Could you please try to update the AppCenter to the latest version and try to reproduce the issue?

If it doesn't help, please, create a new issue with filled template and add a separate sets of verbose logs: 1st launch where the crash happens 2nd launch where the crash should be sent

Also, It would be great and help us a lot if you able to create and share a demo app reproducing the issue.