ringcentral / engage-digital-messaging-ios

Engage Digital Messaging IOS SDK
Other
10 stars 6 forks source link

EXC_BAD_ACCESS KERN_INVALID_ADDRESS #8

Closed MatthieuPoullin closed 6 years ago

MatthieuPoullin commented 7 years ago

Hello,

We have got some crash when the Dimelo Bot answer to the user. It seems that the error pop from [DimeloChatViewController viewWillDisappear:]

Here is the Crashlytics report:

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000004800000038
 OS Version: 10.3.2 (14F89)
# Device: iPad Air
# RAM Free: 3%
# Disk Free: 16.2%

#0. Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x1851ec15c objc_msgSend + 28
1  mgendimelo                     0x1000ad028 -[DimeloChatViewController viewWillDisappear:] + 4296085544
2  UIKit                          0x18c8b8d34 -[UIViewController _setViewAppearState:isAnimating:] + 952
3  UIKit                          0x18c92ba78 -[UIViewController __viewWillDisappear:] + 100
4  UIKit                          0x18c91c5e4 -[UIViewController viewWillMoveToWindow:] + 484
5  UIKit                          0x18c89babc -[UIView(Hierarchy) _willMoveToWindow:] + 460
6  UIKit                          0x18c89c128 __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke + 88
7  UIKit                          0x18c89c00c -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 448
8  UIKit                          0x18c89c144 __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke + 116
9  UIKit                          0x18c89c00c -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 448
10 UIKit                          0x18c89c144 __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke + 116
11 UIKit                          0x18c89c00c -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 448
12 UIKit                          0x18c89c144 __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke + 116
13 UIKit                          0x18c89c00c -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 448
14 UIKit                          0x18c89c144 __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke + 116
15 UIKit                          0x18c89c00c -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 448
16 UIKit                          0x18cb9607c __UIViewWillBeRemovedFromSuperview + 552
17 UIKit                          0x18c89b654 -[UIView(Hierarchy) removeFromSuperview] + 100
18 UIKit                          0x18c96f3c0 -[UINavigationTransitionView _cleanupTransition] + 708
19 UIKit                          0x18c8d941c -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 312
20 UIKit                          0x18c8d75c8 +[UIViewAnimationState popAnimationState] + 320
21 UIKit                          0x18c962b98 -[UINavigationTransitionView transition:fromView:toView:] + 1860
22 UIKit                          0x18c958b20 -[UINavigationController _startTransition:fromViewController:toViewController:] + 2488
23 UIKit                          0x18c957c2c -[UINavigationController _startDeferredTransitionIfNeeded:] + 856
24 UIKit                          0x18c9577e0 -[UINavigationController __viewWillLayoutSubviews] + 64
25 UIKit                          0x18c957744 -[UILayoutContainerView layoutSubviews] + 188
26 UIKit                          0x18c89e07c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1200
27 QuartzCore                     0x189a8e274 -[CALayer layoutSublayers] + 148
28 QuartzCore                     0x189a82de8 CA::Layer::layout_if_needed(CA::Transaction*) + 292
29 QuartzCore                     0x189a82ca8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
30 QuartzCore                     0x1899fe34c CA::Context::commit_transaction(CA::Transaction*) + 252
31 QuartzCore                     0x189a253ac CA::Transaction::commit() + 504
32 QuartzCore                     0x189a25e78 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
33 CoreFoundation                 0x1867249a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
34 CoreFoundation                 0x186722630 __CFRunLoopDoObservers + 372
35 CoreFoundation                 0x186722a7c __CFRunLoopRun + 956
36 CoreFoundation                 0x186652da4 CFRunLoopRunSpecific + 424
37 GraphicsServices               0x1880bc074 GSEventRunModal + 100
38 UIKit                          0x18c906058 UIApplicationMain + 208
39 mgendimelo                     0x10004c660 main (AppDelegate.swift:16)
40 libdyld.dylib                  0x18566159c start + 4

We use the last version of the SDK.

Can you help us?

Thanks.

jarthod commented 7 years ago

Hello,

Thanks for the detailed report, we're having a look.

jarthod commented 7 years ago

Hello,

In which context did you get this error? is it just when you start a discussion and receive the automated messages? why would it contain viewWillDisappear then, isn't it when you close the chat?

Can you reproduce the issue easily? is it the same in the emulator or another device? Do you have anything hooked to the dimeloChatWillDisappear notification?

MatthieuPoullin commented 7 years ago

Hello, We have got this error on the first installation of the app (most of the time) when the user receive the automated message. This issue does not happen in the emulator, only in physical device and all crashlytics reports comes from 10.3.2 os version. All reports comes from devices with ram free with less than 5%.

Hope it helps.

Thanks.

jarthod commented 7 years ago

Thanks for the precision, if you have several crash reports would you mind sharing them too? unless the stack trace is exactly the same? Are these reports coming from real users? if so how do you know when it happens?

MatthieuPoullin commented 7 years ago

Hello,

Reports are the same. These reports comes from the final client internal testing.

Here is the complete stack trace: issue_1_crash.txt

Thanks.

MatthieuPoullin commented 7 years ago

Hello, did you find something about this issue ?

Thanks.

jarthod commented 7 years ago

@MatthieuPoullin we haven't managed to reproduce the issue nor find any obvious culprit yet, sorry.

jarthod commented 7 years ago

Ok we still haven't managed to reproduce the issue but tried a fix on a part of the code which might be the culprit. We'll release this soon. Will you be able to update the app and let us know if you get any crash on the new version?

MatthieuPoullin commented 7 years ago

Yes sure !

jarthod commented 7 years ago

Hello, we just released 1.7.3 which contains a fix for this issue. Please update and let us know if you have any occurrence on the new version !

666tos commented 6 years ago

@jarthod i'm facing the same issue in another app. Could you briefly describe what was the cause of that crash?

waelba commented 6 years ago

Hi @666tos ,

could you say us which version of our SDK do you use ?

666tos commented 6 years ago

@waelbenabdallah i'm not using your SDK, but i have similar issue in my own app: EXC_BAD_ACCESS KERN_INVALID_ADDRESS crash on devices with low RAM

jarthod commented 6 years ago

@666tos in our case it was a timer object on which we called a method whereas the object could sometime be nil so we fixed it by protecting the call with an if statement. But this is a very generic error there's no universal solution you need to read the backtrace.