-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLMapView iOS 12.2 low fps, crash upon traitCollection change. #14232
Comments
We tried other apps from the Appstore that are using Mapbox in combination with a UITabbarController and noticed they all are struck by the same bug. |
Thanks for the report @JustinGanzer - we are investigating. |
Hi @JustinGanzer - Thank you for the report! I was able to reproduce this issue with 4.9.0 and we are investigating the issue. Could you check whether you are seeing this issue with v4.10.0-beta.1? |
Hey @jmkiley, I'm on the same team of @JustinGanzer so I will try to help as well. Stacktrace:
However sometimes when switching tabs the app does not crash immediately when rotating and instead this error gets thrown and the app changes into the last selected tab. Error:
|
Thank you for the additional information! I have not been able to replicate this issue with Steps to repro:
Sometimes, I do have to switch back and forth between the Mapbox map and other maps a couple of times before I see the issue. cc @friedbunny |
@JustinGanzer @cyborgthefirst an update: we continue to investigate, and can reproduce - although as you note it's inconsistent and can take a while. However we can reproduce without having to rotate the device - so there are potentially 2 overlapping concerns here. |
@julianrex Thank you for the update. |
Thanks @cyborgthefirst! |
Reproduction notes:
When the map becomes unresponsive, it’s evidently stuck in a series of one-second Here’s the stacktrace from a symbolic breakpoint set on
Other threads
Various Instruments confirm this sequence, but don’t really indicate why we’re failing to continue to render. The Metal System Trace profiling template indicates that the “Thread is blocked waiting for next drawable”: |
Thank you @friedbunny for the faster repro method. a995977, includes |
@cyborgthefirst FYI we have a work-around that we're currently testing. EDIT:
We were also seeing this when rapidly changing tabs and panning (but without rotation change). |
@cyborgthefirst Looking at the call stack and
Can you set an exception breakpoint and see what the exception message is? |
I'm not quite sure, if I'm doing this correctly, but this is what I got: libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Couldn't create framebuffer: incomplete attachment |
Thanks @cyborgthefirst - FYI we're planning a |
@julianrex Your workaround seems to work. We are not able to reproduce the issue and the map stays responsive even when switching really quickly between the two screens. Because the slowdown never occurs I'm also not able to reproduce the crash, which makes it quite hard to tell if it has also been resolved or if there is some underlying issue. |
Thanks @cyborgthefirst - we found that the work-around didn't work in all situations unfortunately, so we're testing a few tweaks. Would you be able to check these updates too? |
Yes, I would be able to do that as well. Just to confirm my workflow:
Does this look alright? |
Yes, perfect! Thanks! Quick question: do you use UIView based annotations? |
Yes, we do use view-based as well as image-based annotations. |
Noting that we merged the work-around into master, and into the next scheduled release (4.10.0). Since the core issue appears to be Apple's, I've tagged this issue as We will create a separate issue for the crash-on-rotation. |
We've had confirmation from Apple that this is an issue in iOS 12.2. It is said to be well-understood. OpenRadar ticket: http://www.openradar.me/radar?id=4926004078313472 |
Has Apple given any indication of if or when a fix might be available for it? I believe I'm seeing a similar issue in another Open GL based platform (Flutter). |
@dnfield this appears to be fixed as of iOS 12.3, however we have not yet had confirmation from Apple (and why this issue is still open!) |
Leaving this ticket open. When we do have confirmation, we'll want to:
|
This bug appears to be present in iOS 13 beta 1 and 2 😞 EDIT: After our initial reproduction, subsequent testing on multiple devices on 13 beta 2 hasn't managed to reproduce the bug. In fact, the behavior appears significantly improved. We are likely to proceed with limiting the work-around to 12.2. We are planning to add error reporting to catch this in the wild: #15011 |
@JustinGanzer @cyborgthefirst have you seen this issue in iOS >= 13.1? This appears to have been fixed by Apple, so just wanted to double check with you. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
We should undo #14318 if it was indeed fixed by Apple 👀 |
With iOS 12.2 released we've noticed odd behaviour with the MGLMapView.
When switching back and forth between a ViewController containing almost nothing but the MapView and any other ViewController, the MapView will at random times enter into a state where the actual rendered Map lags very very hard. If there are Annotations provided through the delegate methods inside the Map, these Annotations will move at about 2 fps where as the map will lag even further behind. Turning the device while the MapView is in this lagging state will cause the app to run into a crash. (The MapView is constrained to the edges of the Superview)
In our case it is a Tabbar that causes the switch between views, thus no new View is being initialised but the already loaded MapView is used. I think this might be very important for the behaviour to occur.
Another note is that the newer the device, the more likely the crash is to occur. The bug is very hard to reproduce on an iPhone SE, 6 etc. It's more likely to occur with an iPhone 8 and almost always occurs within seconds with an iPhone X.
Here is the crashlog:
Stacktrace
Link Support Request
Mapbox Support Request Nr. 2612, Contact: Josh Erb (github: @riastrad)
Steps to reproduce
Expected behavior
The MapView should stay fluent and usable no matter how often the user switches between tabs
Actual behavior
The MapView adapts a state where the fps is under 1 and interaction is not responded to anymore.
Configuration
Mapbox SDK versions:
Tested with version 4.9.0 all the way down to 4.5.0
iOS/macOS versions:
iOS 12.2, versions below work with no errors
Device/simulator models:
Most Prominent on the iPhone X and up, medium: iPhone 8, least prominent: iPhone 7 and below
Xcode version:
Version 10.2 (10E125)
The text was updated successfully, but these errors were encountered: