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 on launch after updating to ios-v3.4.0-beta.2 from ios-v3.4.0-beta.1 #6883

Closed

Description

@JesseCrocker

Platform:
iOS Simulator
Mapbox SDK version:
ios-v3.4.0-beta.2, installed with podspec https://raw.githubusercontent.com/mapbox/mapbox-gl-native/ios-v3.4.0-beta.2/platform/ios/Mapbox-iOS-SDK-symbols.podspec

Steps to trigger behavior

App was working properly on ios-v3.4.0-beta.1, after updating to os-v3.4.0-beta.2 it crashes on launch. The stack trace led me to believe it was related to showing user location, but disabling showing user location did not fix it.

Console output

2016-11-02 13:57:31.198 GaiaGPS[44461:4344987] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x608000229380> to GL_RENDERBUFFER 1
2016-11-02 13:57:31.198 GaiaGPS[44461:4344987] Failed to make complete framebuffer object 8cd6
2016-11-02 13:57:31.221 GaiaGPS[44461:4344987] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x608000229380> to GL_RENDERBUFFER 1
2016-11-02 13:57:31.221 GaiaGPS[44461:4344987] Failed to make complete framebuffer object 8cd6
objc[44461]: EXCEPTIONS: terminating
objc[44461]: EXCEPTIONS: searching through frame [ip=0x115938466 sp=0x7fff52e85e00] for exception 0x608000111f38
objc[44461]: EXCEPTIONS: skipping catch(?)
objc[44461]: EXCEPTIONS: unwinding through frame [ip=0x115938466 sp=0x7fff52e85e00] for exception 0x608000111f38
objc[44461]: EXCEPTIONS: handling exception 0x608000111f38 at 0x115938485
libc++abi.dylib: terminating with uncaught exception of type mbgl::gl::Error: glBindTexture(GL_TEXTURE_2D, value): Error GL_INVALID_ENUM at /Users/boundsj/mapbox-gl-native/src/mbgl/gl/value.cpp:284

Disassembly

Mapbox`::-[MGLMapView glkView:drawInRect:](GLKView *, CGRect):
    0x110ebc42f <+0>:  pushq  %rbp
    0x110ebc430 <+1>:  movq   %rsp, %rbp
    0x110ebc433 <+4>:  pushq  %r14
    0x110ebc435 <+6>:  pushq  %rbx
    0x110ebc436 <+7>:  movq   %rdi, %rbx
    0x110ebc439 <+10>: movq   0x6c0cc0(%rip), %rsi      ; "isDormant"
    0x110ebc440 <+17>: callq  *0x6a17d2(%rip)           ; (void *)0x000000011594eac0: objc_msgSend
    0x110ebc446 <+23>: testb  %al, %al
    0x110ebc448 <+25>: jne    0x110ebc47e               ; <+79> at MGLMapView.mm:885
    0x110ebc44a <+27>: movq   0x6c2a2f(%rip), %r14      ; MGLMapView._mbglView
    0x110ebc451 <+34>: movq   (%rbx,%r14), %rdi
    0x110ebc455 <+38>: callq  0x110ed938c               ; MBGLView::updateViewBinding at MGLMapView.mm:5040
    0x110ebc45a <+43>: movq   0x6c29ff(%rip), %rax      ; MGLMapView._mbglMap
    0x110ebc461 <+50>: movq   (%rbx,%rax), %rdi
    0x110ebc465 <+54>: movq   (%rbx,%r14), %rsi
    0x110ebc469 <+58>: callq  0x1110f5a40               ; mbgl::Map::render(mbgl::View&)
    0x110ebc46e <+63>: movq   0x6c0c93(%rip), %rsi      ; "updateUserLocationAnnotationView"
    0x110ebc475 <+70>: movq   %rbx, %rdi
    0x110ebc478 <+73>: callq  *0x6a179a(%rip)           ; (void *)0x000000011594eac0: objc_msgSend
    0x110ebc47e <+79>: popq   %rbx
    0x110ebc47f <+80>: popq   %r14
    0x110ebc481 <+82>: popq   %rbp
    0x110ebc482 <+83>: retq   

Stack Trace

#0	0x00000001162faf06 in __pthread_kill ()
#1	0x000000011632f4ec in pthread_kill ()
#2	0x0000000116077fd7 in abort ()
#3	0x0000000115e4295a in abort_message ()
#4	0x0000000115e67ce7 in default_terminate_handler() ()
#5	0x00000001159384b4 in _objc_terminate() ()
#6	0x0000000115e64e69 in std::__terminate(void (*)()) ()
#7	0x0000000115e64ee3 in std::terminate() ()
#8	0x0000000110ed938b in __clang_call_terminate ()
#9	0x00000001110a073c in mbgl::gl::value::BindTexture::Set(unsigned int const&)::$_47::operator()() const::__MBGL_C_E::~__MBGL_C_E() ()
#10	0x00000001110a06f5 in mbgl::gl::value::BindTexture::Set(unsigned int const&)::$_47::operator()() const::__MBGL_C_E::~__MBGL_C_E() ()
#11	0x000000011109f169 in mbgl::gl::value::BindTexture::Set(unsigned int const&)::$_47::operator()() const ()
#12	0x000000011109f130 in mbgl::gl::value::BindTexture::Set(unsigned int const&) ()
#13	0x000000011116d0a2 in mbgl::gl::State<mbgl::gl::value::BindTexture>::operator=(unsigned int const&) ()
#14	0x000000011113c52d in mbgl::FrameHistory::bind(mbgl::gl::Context&, unsigned int) ()
#15	0x000000011113c236 in mbgl::FrameHistory::upload(mbgl::gl::Context&, unsigned int) ()
#16	0x000000011114ac63 in mbgl::Painter::render(mbgl::style::Style const&, mbgl::FrameData const&, mbgl::View&, mbgl::SpriteAtlas&) ()
#17	0x00000001110f64a8 in mbgl::Map::Impl::render(mbgl::View&) ()
#18	0x00000001110f5c0c in mbgl::Map::render(mbgl::View&) ()
#19	0x0000000110ebc46e in ::-[MGLMapView glkView:drawInRect:](GLKView *, CGRect) at /Users/boundsj/mapbox-gl-native/platform/ios/src/MGLMapView.mm:881
#20	0x000000011f98d148 in -[GLKView _display:] ()
#21	0x0000000110ebcde2 in ::-[MGLMapView updateFromDisplayLink]() at /Users/boundsj/mapbox-gl-native/platform/ios/src/MGLMapView.mm:1009
#22	0x0000000112457c35 in CA::Display::DisplayLinkItem::dispatch(unsigned long long) ()
#23	0x0000000112457af5 in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()
#24	0x000000010f066964 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#25	0x000000010f0665f3 in __CFRunLoopDoTimer ()
#26	0x000000010f06617a in __CFRunLoopDoTimers ()
#27	0x000000010f05df01 in __CFRunLoopRun ()
#28	0x000000010f05d494 in CFRunLoopRunSpecific ()
#29	0x00000001177fda6f in GSEventRunModal ()
#30	0x00000001128a6964 in UIApplicationMain ()
#31	0x000000010cee7c0c in main at /Users/jesse/projects/Gaia-GPS-iPhone-mapbox/Classes/main.m:24
#32	0x0000000115fcf68d in start ()
#33	0x0000000115fcf68d in start ()

Activity

  1. jfirebaugh commented on Nov 2, 2016

    @jfirebaugh
    Contributor

    This looks like a recurrence of #1550.

    I'm confused why the GL error checking is in this build though. @boundsj, the podspec should be a release build right? We don't check OpenGL errors in release builds, and ios-v3.4.0-beta.2 does not include a commit like 3e6d067 (right?)

  2. changed the title [-]Crash on launch after updating to ios-v3.4.0-beta.1 from ios-v3.4.0-beta.2[/-] [+]Crash on launch after updating to ios-v3.4.0-beta.2 from ios-v3.4.0-beta.1[/+] on Nov 2, 2016
  3. added
    iOSMapbox Maps SDK for iOS
    and removed on Nov 2, 2016
  4. added this to the ios-v3.4.0 milestone on Nov 2, 2016
  5. self-assigned this
    on Nov 2, 2016
  6. boundsj commented on Nov 2, 2016

    @boundsj
    Contributor

    @jfirebaugh

    ios-v3.4.0-beta.2 does not include a commit like 3e6d067 (right?)

    That is correct.

    the podspec should be a release build right?

    That is correct.

    @JesseCrocker

    I just pointed a demo project I have at beta.2 with pod 'Mapbox-iOS-SDK', :podspec => 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/ios-v3.4.0-beta.2/platform/ios/Mapbox-iOS-SDK-symbols.podspec and everything looks fine. Does the crash happen for you consistently? Does reverting to beta.1 stop the crash?

  7. JesseCrocker commented on Nov 2, 2016

    @JesseCrocker
    ContributorAuthor

    @boundsj Yes, crash happens every time, and reverting back to beta.1 fixes it.

  8. boundsj commented on Nov 2, 2016

    @boundsj
    Contributor

    @jfirebaugh here is the diff between beta.1 and beta.2. There were a few core changes like #3563 and #6773 in this version.

    @JesseCrocker would it be possible to share a sample project that reproduces the crash? I'm not seeing this on a few different apps that I'm now using beta 2 in.

  9. JesseCrocker commented on Nov 2, 2016

    @JesseCrocker
    ContributorAuthor

    @boundsj I'm seeing the crash on a closed-source project, but i'll try and come up with a test case to send over tomorrow morning.

  10. boundsj commented on Nov 2, 2016

    @boundsj
    Contributor

    Thanks @JesseCrocker! Even if it is just a list of what you are doing (Mapbox iOS SDK related) when the app starts and details about your environment (i.e. Xcode version, Swift or Objective-C) that would be helpful. And, if you can manage, an Xcode project that reproduces the issue would help the most.

  11. naluhh commented on Nov 3, 2016

    @naluhh

    From what I've seen, Initing with no frame cause MapBox to crash.
    MGLMapView() -> Crash
    MGLMapView(frame:frame) works

  12. JesseCrocker commented on Nov 3, 2016

    @JesseCrocker
    ContributorAuthor

    I can confirm what @naluhh said, it's related to the frame.

    I was calling [[MGLMapView alloc] initWithFrame:CGRectZero]; then let constraints set the proper size, if i change that to [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; it no longer crashes.

  13. 2 remaining items

  14. assigned and unassigned on Nov 3, 2016
  15. incanus commented on Nov 3, 2016

    @incanus
    Contributor

    I do see this crash with the repro mentioned above, and a CGRectZero frame triggers it. But interestingly, in the GL project proper, the occurs when no contextual info in the -glkView:drawInRect: has a zero frame—not view.frame, rect, or the parent MGLMapView's frame. Still digging.

  16. incanus commented on Nov 3, 2016

    @incanus
    Contributor

    Weirdly, in manually disabling GL error checking for a local dev copy, both setting an initial CGRectZero as well as subsequently changing the size via the constraints activation above log some CAEAGLLayer warnings, but nothing is fatal and no crashes happen. The crash is only in the active MBGL_CHECK_ERROR.

  17. incanus commented on Nov 4, 2016

    @incanus
    Contributor

    Similarly, adding -DNDEBUG to the Debug configuration also does not disable GL error checking. Related: #6887 (comment)

  18. incanus commented on Nov 4, 2016

    @incanus
    Contributor

    Current status on debugging this is something outside of MGLMapView.mm is binding the GL context, I think. Because it's not a routine like [_glView bindDrawable] or getContext().bindFramebuffer.setCurrentValue(0) that is triggering these log lines around bind problems. It could be some sort of implicit bind that's triggered in GLKView internals. If I can find out where, I can add a check for proper state before proceeding.

  19. kkaefer commented on Nov 4, 2016

    @kkaefer
    Member

    @incanus The worrying part here is that the stack trace contains __MBGL_C_E, which is only present when compiled in Debug mode.

  20. incanus commented on Nov 4, 2016

    @incanus
    Contributor

    Yeah, I am seeing that as a separate issue though—that we possibly rolled a build wrong. If I disable GL error checking, things don't crash, but we still get GL framebuffer bind warnings, which I want to get rid of. That's basically the core issue here now, though it should not technically be a crash.

  21. 1ec5 commented on Nov 4, 2016

    @1ec5
    Contributor

    #1572 tracks the GL framebuffer bind warnings specifically. (That ticket notes that some users have experienced crashes due to that issue, but the crash is unreproducible.)

  22. incanus commented on Nov 4, 2016

    @incanus
    Contributor

    #1572 tracks the GL framebuffer bind warnings specifically

    In that case, I think we can close here in favor of #1572 and #6887. I will move #1572 to the milestone.

  23. 1ec5 commented on Nov 4, 2016

    @1ec5
    Contributor

    We should still get to the bottom of why @JesseCrocker was seeing this crash only on v3.4.0-beta.2 but not v3.4.0-beta.1 with the same CGRectZero. Does #6883 (comment) prove that we inadvertently built beta 2 as a Debug build? We did make changes to the SDK build script between the last alpha and beta 1 (like #6581), but I’m unaware of any changes to the deployment script after beta 1.

  24. nitrag commented on Nov 7, 2016

    @nitrag
    Contributor

    I have this issue about 1 of 5 launches, when it happens I rebuild and it works.

    Mapbox`::-[MGLMapView glkView:drawInRect:](GLKView *, CGRect):
        0x10e43742f <+0>:  pushq  %rbp
        0x10e437430 <+1>:  movq   %rsp, %rbp
        0x10e437433 <+4>:  pushq  %r14
        0x10e437435 <+6>:  pushq  %rbx
        0x10e437436 <+7>:  movq   %rdi, %rbx
        0x10e437439 <+10>: movq   0x6c0cc0(%rip), %rsi      ; "isDormant"
        0x10e437440 <+17>: callq  *0x6a17d2(%rip)           ; (void *)0x0000000110f29ac0: objc_msgSend
        0x10e437446 <+23>: testb  %al, %al
        0x10e437448 <+25>: jne    0x10e43747e               ; <+79> at MGLMapView.mm:885
        0x10e43744a <+27>: movq   0x6c2a2f(%rip), %r14
        0x10e437451 <+34>: movq   (%rbx,%r14), %rdi
        0x10e437455 <+38>: callq  0x10e45438c               ; MBGLView::updateViewBinding at MGLMapView.mm:5040
        0x10e43745a <+43>: movq   0x6c29ff(%rip), %rax
        0x10e437461 <+50>: movq   (%rbx,%rax), %rdi
        0x10e437465 <+54>: movq   (%rbx,%r14), %rsi
        0x10e437469 <+58>: callq  0x10e670a40               ; mbgl::Map::render(mbgl::View&)
    ->  0x10e43746e <+63>: movq   0x6c0c93(%rip), %rsi      ; "updateUserLocationAnnotationView"
        0x10e437475 <+70>: movq   %rbx, %rdi
        0x10e437478 <+73>: callq  *0x6a179a(%rip)           ; (void *)0x0000000110f29ac0: objc_msgSend
        0x10e43747e <+79>: popq   %rbx
        0x10e43747f <+80>: popq   %r14
        0x10e437481 <+82>: popq   %rbp
        0x10e437482 <+83>: retq   
    

    Let me know what to provide to help your finding the bug.

  25. boundsj commented on Nov 7, 2016

    @boundsj
    Contributor

    @nitrag this appears to be a different issues related to the user annotation view and not GL error checking + IB constraints. Can you please open a new ticket with the stack trace you posted above?

  26. boundsj commented on Nov 8, 2016

    @boundsj
    Contributor

    We should still get to the bottom of why @JesseCrocker was seeing this crash only on v3.4.0-beta.2 but not v3.4.0-beta.1

    #6887 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

crashiOSMapbox Maps SDK for iOSrelease blockerBlocks the next final release

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions