-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Native Crash in Komoot Android App caused by MapLibre #2045
Comments
Thanks for the bug report! Let me have a look if there are any obvious problems (maybe a dangling reference), but without a reproduction I expect it will be hard to fix. Free to reach out to me on Slack if you can share more information privately (e.g. used fonts, styles). |
LocalGlyphRasterizer has an empty destructor on Android, so I doubt that is the cause of the crash. The stack is just being unwinded. Do you have a full strack trace? Not sure if it will be more helpful, but it appears to be cut off at some points. |
Unfortunately, I don't have a more detailed stack trace. |
Without more information this issue is not actionable. I came across a crash which was caused by a dangling reference, but I can't tell if this is the same problem. #1970 |
@louwers |
@ArneKoeckeritz Try this and let me know if it worked for you.
|
Thanks. I will try and push a new app update for my users. |
Thanks, I hope we can find the problem! |
Status update. |
@ArneKoeckeritz That is great. Thanks for the update! |
@louwers
|
Hey @louwers |
OK so it appears the destructor of The type of the only data member is template < class T, template < RefDeletionMethod > class Deleter = DefaultRefDeleter >
using Global = Unique< T, Deleter<&JNIEnv::DeleteGlobalRef> >; So this is the The void reset(UntaggedType* ptr = nullptr)
{
UntaggedType* current = this->get();
T::reset(ptr);
if (current)
{
get_deleter()(current);
}
} I am not sure why, with a debug build, we don't get the exact line number where the crash occured. The
on
And Looking at This gets pretty hairy... It's really hard to debug with just this backtrace. Do you see any similarities in the type of devices it occurs on (e.g. architecture?). If we can reproduce this somehow I can step through with a debugger and it will get much easier to see what is going on. |
I checked the affected devices. The only thing they have in common is the ABI: arm64-v8a. |
OK I stared at the JNI library that we use for a while, and I may have identified a problem. template < RefDeletionMethod DeleteRef >
class DefaultRefDeleter
{
private:
JNIEnv* env = nullptr;
public:
DefaultRefDeleter() = default;
DefaultRefDeleter(JNIEnv& e) : env(&e) {}
void operator()(jobject* p) const
{
if (p)
{
assert(env);
(env->*DeleteRef)(Unwrap(p));
}
}
}; When @ArneKoeckeritz I am not sure if this is it, because if you made a debug build I think it would have triggered an assertion failure. |
@ArneKoeckeritz Maybe we can use ndk-stack? https://developer.android.com/ndk/guides/ndk-stack.html Edit:
Nevermind. |
I will try this. Will tell you once implemented. Hopefully, I have someone in my internal test team who can reproduce it. |
@ArneKoeckeritz Debug symbols are now also included in releases. |
@louwers Thanks. We keep trying to reproduce the issue. |
I encountered a DeleteGlobalRef crash too now Logcat``` 05-27 23:08:51.461 30398 30398 F DEBUG : Abort message: 'JNI DETECTED ERROR IN APPLICATION: thread Thread[12,tid=28293,Native,Thread*=0x76bd799f00,peer=0x14d802b0,"FinalizerDaemon"] using JNIEnv* from thread Thread[1,tid=28274,Runnable,Thread*=0x76bd76cbe0,peer=0x71346078,"main"] 05-27 23:08:51.461 30398 30398 F DEBUG : in call to DeleteGlobalRef 05-27 23:08:51.461 30398 30398 F DEBUG : from void org.maplibre.android.maps.renderer.MapRenderer.finalize()' 05-27 23:08:51.461 30398 30398 F DEBUG : x0 0000000000000000 x1 0000000000006e85 x2 0000000000000006 x3 00000074d6b8b260 05-27 23:08:51.461 30398 30398 F DEBUG : x4 fefeff73d5b7a034 x5 fefeff73d5b7a034 x6 fefeff73d5b7a034 x7 7f7f7f7fffffff7f 05-27 23:08:51.461 30398 30398 F DEBUG : x8 00000000000000f0 x9 00000077f6fae0b0 x10 0000000000000000 x11 ffffff80fffffbdf 05-27 23:08:51.461 30398 30398 F DEBUG : x12 0000000000000001 x13 0000000000000177 x14 00000074d6b8a070 x15 ffffffffffffffff 05-27 23:08:51.461 30398 30398 F DEBUG : x16 00000077f704b050 x17 00000077f7028bd0 x18 00000074d5b76000 x19 0000000000006e72 05-27 23:08:51.461 30398 30398 F DEBUG : x20 0000000000006e85 x21 00000000ffffffff x22 000000000000000b x23 000000000000000b 05-27 23:08:51.461 30398 30398 F DEBUG : x24 0000007549cb6456 x25 0000000000000001 x26 000000000000000b x27 000000754a617000 05-27 23:08:51.461 30398 30398 F DEBUG : x28 000000756d784db0 x29 00000074d6b8b2e0 05-27 23:08:51.461 30398 30398 F DEBUG : lr 00000077f6fdb72c sp 00000074d6b8b240 pc 00000077f6fdb75c pst 0000000000000000 05-27 23:08:51.461 30398 30398 F DEBUG : backtrace: 05-27 23:08:51.461 30398 30398 F DEBUG : #00 pc 000000000004f75c /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: f9471102bb6e4ed28f2e46762b2f446d) 05-27 23:08:51.461 30398 30398 F DEBUG : #1 pc 000000000061f798 /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+692) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.461 30398 30398 F DEBUG : #2 pc 0000000000015980 /system/lib64/libbase.so (android::base::SetAborter(std::__1::function&&)::$_3::__invoke(char const*)+76) (BuildId: d1d2fcf31521b023c2c9fc5cc6629c17) 05-27 23:08:51.462 30398 30398 F DEBUG : #3 pc 0000000000014fac /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+360) (BuildId: d1d2fcf31521b023c2c9fc5cc6629c17) 05-27 23:08:51.462 30398 30398 F DEBUG : #4 pc 000000000044e300 /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+2564) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #5 pc 000000000044e378 /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+108) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #6 pc 0000000000440508 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...)+144) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #7 pc 000000000043e20c /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::CheckPossibleHeapValue(art::ScopedObjectAccess&, char, art::(anonymous namespace)::JniValueType)+416) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #8 pc 000000000043d894 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::(anonymous namespace)::JniValueType*)+644) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #9 pc 0000000000441104 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::DeleteRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+636) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #10 pc 0000000000d01a24 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #11 pc 0000000000d081c8 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #12 pc 0000000000d65dcc /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (jni::Unique, jni::DefaultRefDeleter<&(_JNIEnv::DeleteGlobalRef(_jobject*))> >::reset(jni::jobject*)+76) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #13 pc 0000000000d616cc /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (jni::Unique, jni::DefaultRefDeleter<&(_JNIEnv::DeleteGlobalRef(_jobject*))> >::~Unique()+24) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #14 pc 0000000000d6171c /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (mbgl::AssetManagerFileSource::~AssetManagerFileSource()+56) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #15 pc 0000000000d6177c /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (mbgl::AssetManagerFileSource::~AssetManagerFileSource()+32) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #16 pc 0000000000d0a970 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #17 pc 00000000013336bc /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #18 pc 0000000001a6f7b0 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #19 pc 0000000000d00ab8 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #20 pc 00000000018c5d58 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #21 pc 00000000018c5c90 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #22 pc 00000000018c5c0c /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #23 pc 00000000018b36c4 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #24 pc 00000000018b3694 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #25 pc 00000000018b36f4 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #26 pc 0000000000d0a970 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #27 pc 00000000013336bc /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #28 pc 0000000001a6f7b0 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #29 pc 0000000000d00ab8 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #30 pc 00000000010c6860 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #31 pc 00000000010ca39c /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #32 pc 0000000001a6f7b0 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #33 pc 0000000000d38248 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #34 pc 0000000000daa878 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (mbgl::android::MapRenderer::~MapRenderer()+80) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #35 pc 0000000000daa974 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (mbgl::android::MapRenderer::~MapRenderer()+32) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #36 pc 0000000000db90dc /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #37 pc 0000000000db9074 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #38 pc 0000000000db99b4 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (jni::NativePeerHelper > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)::operator()(_JNIEnv&, jni::Object&) const+156) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #39 pc 0000000000db98c0 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (auto jni::NativeMethodMaker > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)::*)(_JNIEnv&, jni::Object&) const>::operator() > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)>(char const*, jni::NativePeerHelper > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&) const&)::'lambda'(_JNIEnv*, jni::jobject*)::operator()(_JNIEnv*, jni::jobject*) const+84) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #40 pc 0000000000db985c /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (auto jni::NativeMethodMaker > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)::*)(_JNIEnv&, jni::Object&) const>::operator() > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)>(char const*, jni::NativePeerHelper > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&) const&)::'lambda'(_JNIEnv*, jni::jobject*)::__invoke(_JNIEnv*, jni::jobject*)+32) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #41 pc 0000000000db9a8c /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (auto auto jni::MakeNativeMethod > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)::*)(_JNIEnv&, jni::Object&) const>::operator() > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)>(char const*, jni::NativePeerHelper > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&) const&)::'lambda'(_JNIEnv*, jni::jobject*)>(char const*, char const*, jni::NativePeerHelper > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&) const&, std::__ndk1::enable_if > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)>::value, void>::type*)::'lambda'(_JNIEnv*, auto...)::operator()(_JNIEnv*, auto...) const+56) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #42 pc 0000000000db9a44 /data/app/~~29ZGMDc4uQ9-Lf9Srufbaw==/org.maplibre.android.testapp-TYJifQLC4LWdtKUgCdtIzA==/lib/arm64/libmaplibre.so (auto auto jni::MakeNativeMethod > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)::*)(_JNIEnv&, jni::Object&) const>::operator() > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)>(char const*, jni::NativePeerHelper > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&) const&)::'lambda'(_JNIEnv*, jni::jobject*)>(char const*, char const*, jni::NativePeerHelper > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&) const&, std::__ndk1::enable_if > (_JNIEnv&, jni::Object const&, float, jni::Object const&)>::MakeFinalizer(jni::Field const&, char const*) const::'lambda'(_JNIEnv&, jni::Object&)>::value, void>::type*)::'lambda'(_JNIEnv*, auto...)::__invoke(_JNIEnv*, auto...)+32) (BuildId: 3299f082ab7c790679b5b053514e54da62b54eb8) 05-27 23:08:51.462 30398 30398 F DEBUG : #43 pc 0000000000222244 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #44 pc 000000000220b5ac /memfd:jit-cache (deleted) (java.lang.Daemons$FinalizerDaemon.doFinalize+252) 05-27 23:08:51.462 30398 30398 F DEBUG : #45 pc 000000000220fddc /memfd:jit-cache (deleted) (java.lang.Daemons$FinalizerDaemon.runInternal+540) 05-27 23:08:51.462 30398 30398 F DEBUG : #46 pc 0000000000218c7c /apex/com.android.art/lib64/libart.so (art_quick_osr_stub+60) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #47 pc 000000000040621c /apex/com.android.art/lib64/libart.so (art::jit::Jit::MaybeDoOnStackReplacement(art::Thread*, art::ArtMethod*, unsigned int, int, art::JValue*)+344) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #48 pc 0000000000756204 /apex/com.android.art/lib64/libart.so (MterpMaybeDoOnStackReplacement+208) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #49 pc 0000000000208350 /apex/com.android.art/lib64/libart.so (MterpHelpers+240) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #50 pc 0000000000028af8 /apex/com.android.art/javalib/core-libart.jar (java.lang.Daemons$FinalizerDaemon.runInternal+176) 05-27 23:08:51.462 30398 30398 F DEBUG : #51 pc 0000000000744894 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+3064) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #52 pc 0000000000203814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #53 pc 00000000000287f2 /apex/com.android.art/javalib/core-libart.jar (java.lang.Daemons$Daemon.run+50) 05-27 23:08:51.462 30398 30398 F DEBUG : #54 pc 000000000074a928 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+3156) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #55 pc 0000000000203a14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #56 pc 00000000000e75b0 /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8) 05-27 23:08:51.462 30398 30398 F DEBUG : #57 pc 00000000003d4048 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #58 pc 0000000000732bf4 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+784) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #59 pc 0000000000222378 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #60 pc 0000000000218964 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #61 pc 0000000000284060 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+184) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #62 pc 0000000000618aa8 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #63 pc 0000000000666f94 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1164) (BuildId: 4c0294ad13d65850de6c1f2e26698b1e) 05-27 23:08:51.462 30398 30398 F DEBUG : #64 pc 00000000000b1590 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: f9471102bb6e4ed28f2e46762b2f446d) 05-27 23:08:51.462 30398 30398 F DEBUG : #65 pc 0000000000050fac /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f9471102bb6e4ed28f2e46762b2f446d) 05-27 23:08:51.520 5459 5459 E tombstoned: Tombstone written to: tombstone_49 05-27 23:08:51.525 28274 28274 W FinalizerDaemon: type=1701 audit(0.0:1126): auid=4294967295 uid=10488 gid=10488 ses=4294967295 subj=u:r:untrusted_app:s0:c232,c257,c512,c768 exe="/system/bin/app_process64" sig=6 res=1 app=org.maplibre.android.testapp 05-27 23:08:51.673 5597 5597 E BpTransactionCompletedListener: Failed to transact (-32) 05-27 23:08:51.673 5867 5910 I libprocessgroup: Successfully killed process cgroup uid 10488 pid 28274 in 0ms 05-27 23:08:51.675 5555 5555 I Zygote : Process 28274 exited due to signal 6 (Aborted) 05-27 23:08:51.684 28259 28273 W Binder : Caught a RuntimeException from the binder stub implementation. 05-27 23:08:51.684 28259 28273 W Binder : java.lang.SecurityException: Calling from not trusted UID! 05-27 23:08:51.684 28259 28273 W Binder : at android.app.UiAutomationConnection.throwIfCalledByNotTrustedUidLocked(UiAutomationConnection.java:601) 05-27 23:08:51.684 28259 28273 W Binder : at android.app.UiAutomationConnection.shutdown(UiAutomationConnection.java:505) 05-27 23:08:51.684 28259 28273 W Binder : at android.app.IUiAutomationConnection$Stub.onTransact(IUiAutomationConnection.java:437) 05-27 23:08:51.684 28259 28273 W Binder : at android.os.Binder.execTransactInternal(Binder.java:1184) 05-27 23:08:51.684 28259 28273 W Binder : at android.os.Binder.execTransact(Binder.java:1143) 05-27 23:08:51.685 28259 28259 D AndroidRuntime: Shutting down VM 05-27 23:08:51.689 8043 8364 I A : NGA disabled since GSA isn't the default assistant. 05-27 23:08:51.710 8961 8961 I android.testap: Late-enabling -Xcheck:jni 05-27 23:08:51.716 8043 8043 I A : onResume ```
|
I am now able to reproduce this reliably. It's not the A local JNI object is passed as a reference to the constructor of
This gets passed to maplibre-native/platform/android/MapLibreAndroid/src/cpp/asset_manager_file_source.cpp Line 63 in 8dc8462
And apparently on destruction it's sometimes invalid. For reference this is what template < template < RefDeletionMethod > class Deleter, class T >
auto NewGlobal(JNIEnv& env, const T& t)
{
return Global<RemoveUniqueType<T>, Deleter>(env, reinterpret_cast<typename T::UntaggedType*>(jni::NewGlobalRef(env, t.get()).release()));
} template < template < RefDeletionMethod > class Deleter, class T >
UniqueGlobalRef<T, Deleter> NewGlobalRef(JNIEnv& env, T* t)
{
jobject* obj = Wrap<jobject*>(env.NewGlobalRef(Unwrap(t)));
CheckJavaException(env);
if (t && !obj)
throw std::bad_alloc();
return UniqueGlobalRef<T, Deleter>(reinterpret_cast<T*>(obj), Deleter<&JNIEnv::DeleteGlobalRef>(env));
} I have to look into JNI a bit more to understand what is happening here. |
Actually your crash looks more like mapbox/mapbox-gl-native#14618, but that one should be fixed. |
Amazing news. Thanks a lot :) |
It's not obvious to me how |
@TimSylvester It is passing the template it receives in this template template parameter to
which also has a template template parameter called
So when |
We found the problem! #2487 @ArneKoeckeritz Fix will be included in the Android 11.0.1 release. |
Issue
We have a lot of native app crash reports of our Komoot Android app.
Crashlytics reports a native crash because of MapLibre.:
libmapbox-gl.so (mbgl::LocalGlyphRasterizer::~LocalGlyphRasterizer()+60) (BuildId: 0ca6fcacfa62e5433d32610ec52e8c93ed5b89ae)
To Reproduce
We can't reproduce this issue on our test devices.
The crash happens to 0.5% of our active user base which is a lot for us. Thousands of users per week are affected.
We see that this crash affects all Android versions and all market devices. The problem is not limited to any vendor or device.
Expected behavior
To not crash.
Platform information (please complete the following information):
Contact
Please tell us how we can help and support you with deeper insights.
Thank you
The Komoot Android Engineers
Stack Trace
The text was updated successfully, but these errors were encountered: