This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
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
Copy link
Copy link
Closed
Labels
crashiOSMapbox Maps SDK for iOSMapbox Maps SDK for iOSrelease blockerBlocks the next final releaseBlocks the next final release
Milestone
Description
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 ()
Metadata
Metadata
Assignees
Labels
crashiOSMapbox Maps SDK for iOSMapbox Maps SDK for iOSrelease blockerBlocks the next final releaseBlocks the next final release
Activity
jfirebaugh commentedon Nov 2, 2016
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?)
[-]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[/+]boundsj commentedon Nov 2, 2016
@jfirebaugh
That is correct.
That is correct.
@JesseCrocker
I just pointed a demo project I have at
beta.2withpod 'Mapbox-iOS-SDK', :podspec => 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/ios-v3.4.0-beta.2/platform/ios/Mapbox-iOS-SDK-symbols.podspecand everything looks fine. Does the crash happen for you consistently? Does reverting to beta.1 stop the crash?JesseCrocker commentedon Nov 2, 2016
@boundsj Yes, crash happens every time, and reverting back to beta.1 fixes it.
boundsj commentedon Nov 2, 2016
@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.
JesseCrocker commentedon Nov 2, 2016
@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.
boundsj commentedon Nov 2, 2016
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.
naluhh commentedon Nov 3, 2016
From what I've seen, Initing with no frame cause MapBox to crash.
MGLMapView() -> Crash
MGLMapView(frame:frame) works
JesseCrocker commentedon Nov 3, 2016
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.2 remaining items
incanus commentedon Nov 3, 2016
I do see this crash with the repro mentioned above, and a
CGRectZeroframe triggers it. But interestingly, in the GL project proper, the occurs when no contextual info in the-glkView:drawInRect:has a zero frame—notview.frame,rect, or the parent MGLMapView's frame. Still digging.incanus commentedon Nov 3, 2016
Weirdly, in manually disabling GL error checking for a local dev copy, both setting an initial
CGRectZeroas well as subsequently changing the size via the constraints activation above log someCAEAGLLayerwarnings, but nothing is fatal and no crashes happen. The crash is only in the activeMBGL_CHECK_ERROR.incanus commentedon Nov 4, 2016
Similarly, adding
-DNDEBUGto theDebugconfiguration also does not disable GL error checking. Related: #6887 (comment)incanus commentedon Nov 4, 2016
Current status on debugging this is something outside of
MGLMapView.mmis binding the GL context, I think. Because it's not a routine like[_glView bindDrawable]orgetContext().bindFramebuffer.setCurrentValue(0)that is triggering these log lines around bind problems. It could be some sort of implicit bind that's triggered inGLKViewinternals. If I can find out where, I can add a check for proper state before proceeding.kkaefer commentedon Nov 4, 2016
@incanus The worrying part here is that the stack trace contains
__MBGL_C_E, which is only present when compiled in Debug mode.incanus commentedon Nov 4, 2016
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.
1ec5 commentedon Nov 4, 2016
#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.)
incanus commentedon Nov 4, 2016
In that case, I think we can close here in favor of #1572 and #6887. I will move #1572 to the milestone.
1ec5 commentedon Nov 4, 2016
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.
nitrag commentedon Nov 7, 2016
I have this issue about 1 of 5 launches, when it happens I rebuild and it works.
Let me know what to provide to help your finding the bug.
boundsj commentedon Nov 7, 2016
@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?
boundsj commentedon Nov 8, 2016
#6887 (comment)