-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIGSEGV in MapRenderer #2579
Comments
Is this already a symbolicated stack trace? Because I don't see any line numbers. |
No, I did not manually symbolicate the stack trace. I'll try doing that. Is there a reason you publish the debug symbols separately instead of including them in the AAR on Maven? AFAIK the debug symbols are stripped by AGP anyway during a release build, but when building an app bundle AGP include the debug symbols separately so Google Play (and others) can use them to symbolicate traces automatically. |
I remember looking into it, but I couldn't find a way to do it. If you manage to find a way, a PR would be welcome. |
Not sure whether this is the same crash, but we now managed to get a full symbolicated stack trace:
Registers contents:
Not sure whether that helps. AFAICT the crash happens here
but
So maybe that causes the segfault. PS. just to clarify, we're currently using version |
That is a pure virtual method which you cannot call. On Android its implementation is a no-op: maplibre-native/platform/android/MapLibreAndroid/src/cpp/android_renderer_backend.hpp Line 33 in 156781a
So it can only crash there if |
I had another look at the logs for the crashes. It seems they happen exclusively after the map is no longer visible. Most crashes happen shortly (1 second or less) after For the older crashes, I can't be certain, it may be that some of the time the Activity is still alive, but the user switched screens. However, I suspect it the Activity is always closed/backgrounded. The crash being related to the Activity closing/going into background would certainly explain, why we have lots of automated crash reports, but zero complaints from users. |
Should be fixed by #2631 Will be included in the next release. |
It seems the issue is not fully fixed, with version
I think #2631 just fixed symptoms of a bigger issue, and this bigger issue now causes a crash somewhere else. The bigger issue AFAICT being that MapLibre tries to render after the Android has disposed of the It may also be the case, that we are not correctly calling MapLibre's lifecycle methods in our app, but at a quick glance it seems we do what the docs tell us to. |
Is there any update on this issue? Do you need any additional crash data? We're now seeing this crash at a rate of about 5-10 per day. |
@kodebach It's really weird that there are not more people affected by this. Any chance you can share how you are using the library? A reproducer would be ideal... In any case, thanks for the reminder, I can put in some more defensive programming there. |
We haven't been able to reproduce it in testing ourselves, so I can't provide a reproducer. We are using Jetpack Compose with our own wrapper similar to https://github.com/ramani-maps/ramani-maps (the library didn't exist when we switched to Compose). Maybe there is a subtly bug there, but AFAICT we do the same Lifecycle mapping as ramani-maps. I will check the code again, and maybe investigate switching to ramani-maps. AFAIK it doesn't have any known lifecycle issues. |
We tried switching to ramani-maps, but it doesn't currently support all the features we need. However, we have updated our lifecycle logic with a mix of code from ramani-maps and https://github.com/googlemaps/android-maps-compose. We are now less aggressive with calling Let's see if this fixes the issue. |
Seems that it indeed was an error in our lifecycle code. We've not seen any crashes on the new versions. |
@kodebach Well, even if you mess up, that still shouldn't result in a crash. I'm happy your issue is resolved, but it would be interesting to know what was happening here. |
AFAICT in some situation we called |
@louwers I experienced the same issue when I upgraded to use the latest map libre android sdk (v11.6.1). Looking into the issue, there seems to be a nullptr dereference on MapRenderer:render method. I believe this happens when the style.json does not include a renderer property in its metadata. I was able to resolve the issue by adding; "maputnik:renderer": "mbgljs" value to the metadata section of the style.json I am using. Can you please verify this and possibly introduce a fix so it does not crash in the absence of this property? We were not aware that it was required as the metadata is listed as 'optional' in the style specs here: https://maplibre.org/maplibre-style-spec/root/#metadata Note 1: Previously, our company was using the v10.2.0 maplibre android sdk, and it was working fine without this property in the style. Note 2: The relevant crash log is attached. |
@elican-doenyas That sounds like a separate issue. Could you open an issue and ideally share the style that is causing a crash? |
We are seeing an issue similar to #2206 in our app. The crash occurs a lot, but so far we have not heard from users that it impacts them. So the crash might occur in the background or while leaving the app.
This is the current crash statistic from our Sentry instance
To frame the number of crashes seen per device: This is a private app deployed to fewer than 500 devices, all of them Samsung phones. The list above is the complete list of devices in use, so as far as we can tell, it is not hardware specific (unless it is a general Samsung issue).
With Maplibre 11 we finally got a more detailed stack trace
Not sure if that is helpful in any way,
__split_buffer
seems to be a an internal class of the C++ stdlib used instd::vector
and possibly others. But I did not see anystd::vector
instances inMapRenderer
.Sentry also shows the
__split_buffer
frame as (although I'm not sure how it got that information)That would point to
maplibre-native/src/mbgl/util/tile_server_options.cpp
Line 34 in 5d5bd84
But I did not check how this is connected to
MapRenderer
(if at all).Originally posted by @kodebach in #2206 (comment)
The text was updated successfully, but these errors were encountered: