Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Crash in background — glFinish_Exec, gpus_ReturnNotPermittedKillClient, libGPUSupportMercury #1460

Closed

Description

@picciano

I started seeing these that past two days. This was from Crashlytics, so not exactly sure what user was doing at the time.

Thread : Crashed: com.apple.main-thread
0  libGPUSupportMercury.dylib     0x000000018c389f90 gpus_ReturnNotPermittedKillClient + 12
1  libGPUSupportMercury.dylib     0x000000018c38af40 gpusSubmitDataBuffers + 172
2  GLEngine                       0x0000000187078664 glFinish_Exec + 132
3  GLKit                          0x000000018446004c -[GLKView _display:] + 200
4  QuartzCore                     0x0000000187777a34 CA::Layer::display() + 148
5  QuartzCore                     0x0000000187758a7c CA::Layer::display_if_needed(CA::Transaction*) + 244
6  QuartzCore                     0x0000000187758734 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 44
7  QuartzCore                     0x0000000187757ebc CA::Context::commit_transaction(CA::Transaction*) + 276
8  QuartzCore                     0x0000000187757c3c CA::Transaction::commit() + 528
9  UIKit                          0x0000000187e0c56c _afterCACommitHandler + 152
10 CoreFoundation                 0x00000001833902a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
11 CoreFoundation                 0x000000018338d230 __CFRunLoopDoObservers + 360
12 CoreFoundation                 0x000000018338d610 __CFRunLoopRun + 836
13 CoreFoundation                 0x00000001832b92d4 CFRunLoopRunSpecific + 396
14 GraphicsServices               0x000000018cacf6fc GSEventRunModal + 168
15 UIKit                          0x0000000187e7efac UIApplicationMain + 1488
16 TallyGo                        0x00000001001284f0 main (main.m:14)
17 libdyld.dylib                  0x000000019527aa08 start + 4

Activity

  1. friedbunny commented on May 7, 2015

    @friedbunny
    Contributor

    This looks suspiciously similar to the two crashes discussed in #1198, but not quite. @picciano, do you see any hardware/OS patterns for these crashes?

  2. picciano commented on May 7, 2015

    @picciano
    Author

    I've been seeing it on iPhone 6, iOS versions 8.2 and 8.3. This build is using the MBGL codebase from Monday, May 4, late afternoon.

    screen shot 2015-05-07 at 10 56 22 am

  3. friedbunny commented on May 7, 2015

    @friedbunny
    Contributor

    It looks like gpus_ReturnNotPermittedKillClient usually means that the app is trying to render OpenGL in the background, says Apple and variety of Stack Overflow threads (like this one).

    Here is effectively the same crash on VLC's iOS app. It appears they fixed it by checking for a broader range of background notifications.

  4. friedbunny commented on May 7, 2015

    @friedbunny
    Contributor

    @incanus just hardened iOS backgrounding behavior yesterday in #1451. We don't handle UIApplicationWillTerminateNotification, but I'm not sure we need to?

  5. incanus commented on May 7, 2015

    @incanus
    Contributor

    I don't think we need to hit UIApplicationWillTerminateNotification.

    We are still seeing this crash internally, though not in a way that looks like a crash to anyone (because of the state-saving nature of backgrounding). Currently trying to work out what exactly the repro is.

  6. added
    iOS
    on May 7, 2015
  7. added this to the iOS Beta 1 milestone on May 7, 2015
  8. incanus commented on May 7, 2015

    @incanus
    Contributor

    http://stackoverflow.com/a/15814933/977220

    I now keep track of the state of the status bar in relation to the app's active status, and only animate if the application state is UIApplicationStateActive. Having done this, I haven't had a crash since.

  9. picciano commented on May 7, 2015

    @picciano
    Author

    According to Crashlytics, the app was not in background. But perhaps it's just a reporting/timing glitch?

  10. incanus commented on May 7, 2015

    @incanus
    Contributor

    Hmm, @picciano, any way you could share some of the log around that, or explain how you know?

  11. picciano commented on May 7, 2015

    @picciano
    Author

    See screen shot image pasted in above message. Crashlytics is reporting 100% of the 8 crashes were with "app in focus".

  12. 1ec5 commented on May 7, 2015

    @1ec5
    Contributor

    Does Crashlytics rely on the same UIApplicationDidEnterBackgroundNotification/UIApplicationWillEnterForegroundNotification notifications we’ve been using? If so, it’d be misreporting exactly these crashes as being “while in focus”.

  13. incanus commented on May 7, 2015

    @incanus
    Contributor

    We just can't seem to repro this internally. We are "seeing" the crash in Hockey, but no one is reporting any crash problems and we can't repro in Xcode. Maybe we can punt on this?

  14. 39 remaining items

  15. picciano commented on Jul 2, 2015

    @picciano
    Author

    @iec5 i'll drop that into tonight's build and let you know

  16. picciano commented on Jul 3, 2015

    @picciano
    Author

    After bringing in the changes from #1821 I saw this in Crashlytics.

    Thread : Fatal Exception: NSRangeException
    0  CoreFoundation                 0x22220137 __exceptionPreprocess
    1  libobjc.A.dylib                0x302b0c77 objc_exception_throw
    2  CoreFoundation                 0x2222007d -[NSException initWithCoder:]
    3  Foundation                     0x22ebccc9 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:]
    4  Foundation                     0x22ebc6db -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:]
    5  TallyGo                        0x00328bf3 -[MGLMapView dealloc] (MGLMapView.mm:438)
    6  TallyGo                        0x00326787 -[MGLMapView initWithFrame:styleURL:] (MGLMapView.mm:138)
    7  TallyGo                        0x0010d5af -[TGMapUtility init] (TGMapUtility.m:143)
    8  TallyGo                        0x0010cc9d __30+[TGMapUtility sharedInstance]_block_invoke (TGMapUtility.m:24)
    9  libdispatch.dylib              0x3081ac6f _dispatch_client_callout
    10 libdispatch.dylib              0x3082908f dispatch_once_f$VARIANT$mp
    11 TallyGo                        0x0010cc69 +[TGMapUtility sharedInstance] (once.h:68)
    12 TallyGo                        0x0015c66b -[TGMainViewController viewDidLoad] (TGMainViewController.m:109)
    13 UIKit                          0x2585a7ad -[UIViewController loadViewIfRequired]
    14 UIKit                          0x25905545 -[UINavigationController _layoutViewController:]
    15 UIKit                          0x2590546d -[UINavigationController _updateScrollViewFromViewController:toViewController:]
    16 UIKit                          0x259049e1 -[UINavigationController _startTransition:fromViewController:toViewController:]
    17 UIKit                          0x25904717 -[UINavigationController _startDeferredTransitionIfNeeded:]
    18 UIKit                          0x25904485 -[UINavigationController __viewWillLayoutSubviews]
    19 UIKit                          0x25904419 -[UILayoutContainerView layoutSubviews]
    20 UIKit                          0x25857c1b -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
    21 QuartzCore                     0x25276445 -[CALayer layoutSublayers]
    22 QuartzCore                     0x25271c95 CA::Layer::layout_if_needed(CA::Transaction*)
    23 QuartzCore                     0x25271b1d CA::Layer::layout_and_display_if_needed(CA::Transaction*)
    24 QuartzCore                     0x252714bf CA::Context::commit_transaction(CA::Transaction*)
    25 QuartzCore                     0x252712af CA::Transaction::commit()
    26 UIKit                          0x25abe1f5 -[UIApplication _reportMainSceneUpdateFinished:]
    27 UIKit                          0x25abef7d -[UIApplication _runWithMainScene:transitionContext:completion:]
    28 UIKit                          0x25ac9809 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke
    29 UIKit                          0x25abd2e7 -[UIApplication workspaceDidEndTransaction:]
    30 FrontBoardServices             0x28ce0ec1 __31-[FBSSerialQueue performAsync:]_block_invoke_2
    31 CoreFoundation                 0x221e6255 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
    32 CoreFoundation                 0x221e5519 __CFRunLoopDoBlocks
    33 CoreFoundation                 0x221e4073 __CFRunLoopRun
    34 CoreFoundation                 0x2212f9a1 CFRunLoopRunSpecific
    35 CoreFoundation                 0x2212f7b3 CFRunLoopRunInMode
    36 UIKit                          0x258bfab7 -[UIApplication _run]
    37 UIKit                          0x258ba695 UIApplicationMain
    38 TallyGo                        0x0015bb83 main (main.m:14)
    39 libdyld.dylib                  0x30858aaf start
    
  17. 1ec5 commented on Jul 3, 2015

    @1ec5
    Contributor

    Looks like we're getting somewhere, being able to detect background launches now. Should be easy to fix the crash above: there's no need to unregister for KVO registrations before the registrations take place (registration is deferred in this case).

    @picciano, let's continue the conversation in #1821, since that looks promising.

  18. picciano commented on Jul 3, 2015

    @picciano
    Author

    Sorry, meant #1821 (not 1812)

  19. incanus commented on Jul 7, 2015

    @incanus
    Contributor

    @1ec5 is heading this up.

  20. added a commit that references this issue on Jul 8, 2015
    1a3ae88
  21. added a commit that references this issue on Jul 8, 2015
    0fd9fe7
  22. 1ec5 commented on Jul 9, 2015

    @1ec5
    Contributor

    Reopening because the fix was backed out in 2df80af due to #1855. Hopefully we can bring back the fix, sans regression, in a minor update.

  23. reopened this on Jul 9, 2015
  24. modified the milestone: iOS Beta 3 on Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcrashiOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions