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

Share extensions crash on iOS 10 #411

Closed
iwasrobbed-ks opened this issue Sep 16, 2019 · 3 comments · Fixed by #416
Closed

Share extensions crash on iOS 10 #411

iwasrobbed-ks opened this issue Sep 16, 2019 · 3 comments · Fixed by #416
Labels
bug Confirmed bug released This feature/bug fix has been released

Comments

@iwasrobbed-ks
Copy link

iwasrobbed-ks commented Sep 16, 2019

Description

Use Bugsnag within a share extension and support iOS 10

The podfile specifies iOS 8+ is supported

Issue

We experienced a lot of KVO crashes in production

Screen Shot 2019-09-09 at 2 31 56 PM

Screen Shot 2019-09-16 at 3 36 58 PM

Environment

Library versions:

  • Bugsnag version (from your Podfile, Podfile.lock, or elsewhere): 5.22.2
  • CocoaPods version (if any) (pod -v): 1.7.5
  • iOS/tvOS/macOS version(s) 10
  • debug mode or production?: production
  • How are you initializing Bugsnag? Can you share a snippet of your
    AppDelegate where Bugsnag is configured?
    // Apple doc suggests grabbing extensionContext from loadView
    override func loadView() {
        super.loadView()
        guard let extensionContext = self.extensionContext else { return }
        // TODO: this is crashing the extension for KVO dealloc errors
//        Bugsnag.start(withApiKey: "....")
    }

Stack trace

Hardware Model:     iPhone5,1
OS Version:         iOS 10.3.4



NSInternalInconsistencyException: An instance 0x1456e0c0 of class BugsnagConfiguration was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x1476bc20> (
<NSKeyValueObservance 0x1476cca0: Observer: 0x1474eaf0, Key path: releaseStage, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x1476cc60>
)

0  CoreFoundation   ___exceptionPreprocess
1  libobjc.A.dylib  _objc_exception_throw
2  CoreFoundation   +[NSException raise:format:]
3  Foundation       _NSKVODeallocate
4  libobjc.A.dylib  objc_object::sidetable_release(bool)
5  ShareMediaEx     -[BugsnagApiClient .cxx_destruct] (BugsnagApiClient.m:19:17)
6  libobjc.A.dylib  object_cxxDestructFromClass(objc_object*, objc_class*)
7  libobjc.A.dylib  _objc_destructInstance
8  libobjc.A.dylib  _object_dispose
9  ShareMediaEx     -[BugsnagApiClient dealloc] (BugsnagApiClient.m:140:1)
10 libobjc.A.dylib  objc_object::sidetable_release(bool)
11 libobjc.A.dylib  object_cxxDestructFromClass(objc_object*, objc_class*)
12 libobjc.A.dylib  _objc_destructInstance
13 libobjc.A.dylib  _object_dispose
14 libobjc.A.dylib  objc_object::sidetable_release(bool)
15 ShareMediaEx     -[BugsnagCrashSentry install:apiClient:onCrash:] (BugsnagCrashSentry.m:25:34)
16 ShareMediaEx     -[BugsnagNotifier start] (BugsnagNotifier.m:326:5)
17 ShareMediaEx     +[Bugsnag startBugsnagWithConfiguration:] (Bugsnag.m:57:13)
18 ShareMediaEx     +[Bugsnag startBugsnagWithApiKey:] (Bugsnag.m:49:5)
19 ShareMediaEx     loadView (ShareMediaController.swift:25:17)
20 ShareMediaEx     loadView (<compiler-generated>)
21 UIKit            -[UIViewController loadViewIfRequired]
22 UIKit            -[UINavigationController _layoutViewController:]
23 UIKit            -[UINavigationController _updateScrollViewFromViewController:toViewController:]
24 UIKit            -[UINavigationController _startTransition:fromViewController:toViewController:]
25 UIKit            -[UINavigationController _startDeferredTransitionIfNeeded:]
26 UIKit            -[UINavigationController __viewWillLayoutSubviews]
27 UIKit            -[UILayoutContainerView layoutSubviews]
28 UIKit            -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
29 QuartzCore       -[CALayer layoutSublayers]
30 QuartzCore       CA::Layer::layout_if_needed(CA::Transaction*)
31 QuartzCore       CA::Layer::layout_and_display_if_needed(CA::Transaction*)
32 QuartzCore       CA::Context::commit_transaction(CA::Transaction*)
33 QuartzCore       CA::Transaction::commit()
34 QuartzCore       CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
35 CoreFoundation   ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
36 CoreFoundation   ___CFRunLoopDoObservers
37 CoreFoundation   ___CFRunLoopRun
38 CoreFoundation   _CFRunLoopRunSpecific
39 CoreFoundation   _CFRunLoopRunInMode
40 GraphicsServices _GSEventRunModal
41 UIKit            _UIApplicationMain
42 libxpc.dylib     __xpc_objc_main
43 libxpc.dylib     _xpc_main
44 Foundation       -[NSXPCListener resume]
45 PlugInKit        -[PKService run]
46 PlugInKit        +[PKService main]
47 PlugInKit        +[PKService _defaultRun:arguments:]
48 Foundation       _NSExtensionMain
49 libdyld.dylib    _start
@kattrali
Copy link
Contributor

Thanks for the report, @rob-keepsafe. Taking a look. 👀

@kattrali kattrali added the bug Confirmed bug label Sep 16, 2019
@abigailbramble abigailbramble added backlog We hope to fix this feature/bug in the future scheduled Work is starting on this feature/bug and removed backlog We hope to fix this feature/bug in the future labels Sep 16, 2019
kattrali added a commit that referenced this issue Oct 2, 2019
Several object properties were not explicitly marked as retained due to
missing a property retention qualifier. This patch resolves that by
bringing the codebase into conformance with ARC.

ref: https://developer.apple.com/library/archive/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html

Fixes #411
kattrali added a commit that referenced this issue Oct 3, 2019
Several object properties were not explicitly marked as retained due to
missing a property retention qualifier. This patch resolves that by
bringing the codebase into conformance with ARC.

ref: https://developer.apple.com/library/archive/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html

Fixes #411
kattrali added a commit that referenced this issue Oct 3, 2019
Several object properties were not explicitly marked as retained due to
missing a property retention qualifier. This patch resolves that by
bringing the codebase into conformance with ARC.

ref: https://developer.apple.com/library/archive/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html

Fixes #411
@iwasrobbed-ks
Copy link
Author

Thanks @kattrali 🙌

@abigailbramble
Copy link

Released in v5.22.7.

@abigailbramble abigailbramble added released This feature/bug fix has been released and removed scheduled Work is starting on this feature/bug labels Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug released This feature/bug fix has been released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants