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

open gl error when moving back from UIViewController while scrolling is on. #1203

Closed
mb12 opened this issue Apr 3, 2015 · 1 comment
Closed
Labels
crash iOS Mapbox Maps SDK for iOS
Milestone

Comments

@mb12
Copy link

mb12 commented Apr 3, 2015

The following steps reproduce this error reasonably consistently.

  1. Flick to start an animated scroll.
  2. Switch/Push a new UIViewController.
  3. Tap on back button before scroll finishes.

It doesn't happen if one lets the scroll finish before pressing back button. Is the error happening because:

  • Map thread is still animating (doing gl Calls)
  • UI Thread calling renderbufferStorageFromDrawable on a context which is in use in a different thread (map Thread).

If this is correct, then its a more fundamental problem that can cause random crashes since MGLMapView has no control on when the setNeedsDisplay will be called in the UIView hierarchy where MGLMapView is embedded. Everytime the code path that triggers [GLKView _display:] -> ...[GLKView _createFramebuffer] is triggered when mapThread is animating will cause a crash.

(lldb) bt
* thread #1: tid = 0x9f60e, 0x00000001012d3f3c libglInterpose.dylib`__GPUTOOLS_HAS_DETECTED_AN_OPENGL_ERROR__, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1 11.1 37.1
    frame #0: 0x00000001012d3f3c libglInterpose.dylib`__GPUTOOLS_HAS_DETECTED_AN_OPENGL_ERROR__
    frame #1: 0x00000001012d3fe4 libglInterpose.dylib`handle_opengl_error + 60
    frame #2: 0x0000000101482140 libglInterpose.dylib`EAGLContext_renderbufferStorageFromDrawable(EAGLContext*, objc_selector*, unsigned long, id<EAGLDrawable>) + 1608
    frame #3: 0x000000018771aa68 GLKit`-[GLKView _createFramebuffer] + 328
    frame #4: 0x000000018771b040 GLKit`-[GLKView _setFramebuffer:] + 144
    frame #5: 0x000000018771b294 GLKit`-[GLKView _display:] + 92
    frame #6: 0x000000018a7e6f74 QuartzCore`CA::Layer::display() + 148
    frame #7: 0x000000018a7c875c QuartzCore`CA::Layer::display_if_needed(CA::Transaction*) + 244
    frame #8: 0x000000018a7c8414 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 44
    frame #9: 0x000000018a7c7c08 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 276
    frame #10: 0x000000018a7c798c QuartzCore`CA::Transaction::commit() + 436
    frame #11: 0x000000018a7c13bc QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
    frame #12: 0x000000018667ea50 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    frame #13: 0x000000018667b9dc CoreFoundation`__CFRunLoopDoObservers + 360
    frame #14: 0x000000018667bdbc CoreFoundation`__CFRunLoopRun + 836
    frame #15: 0x00000001865a90a4 CoreFoundation`CFRunLoopRunSpecific + 396
    frame #16: 0x000000018f70f5a4 GraphicsServices`GSEventRunModal + 168
    frame #17: 0x000000018aede3c0 UIKit`UIApplicationMain + 1488
  * frame #18: 0x00000001000d0768 testapp`main(argc=1, argv=0x000000016fd339e8) + 176 at main.m:15
    frame #19: 0x000000019774aa08 libdyld.dylib`start + 4

@incanus incanus added this to the iOS Beta 1 milestone Apr 6, 2015
@incanus incanus added iOS Mapbox Maps SDK for iOS crash labels Apr 6, 2015
1ec5 added a commit that referenced this issue Apr 10, 2015
Throw a static snapshot up for the app switcher. Hope you didn’t plan on moving markers around while the app is in the background.

Fixes #1050, #1186, #1203, #1243.
@1ec5
Copy link
Contributor

1ec5 commented Apr 15, 2015

Fixed in #1254.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

3 participants