Skip to content
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 after clicking re-center, backgrounding the app before re-center finishes and then re-opening. #1865

Closed
DejanRistic opened this issue Apr 4, 2019 · 16 comments · Fixed by #1880
Labels
bug Defect to be fixed.

Comments

@DejanRistic
Copy link

Android API: Android 9 (Target API 28)
Mapbox Navigation SDK version: 0.34.0

I first saw this with our own app, then tried it using the navigation sample from this repo.

Steps to trigger behavior

  1. Go to any navigation where you can pan away and trigger the re-center button to appear.
  2. Click the re-center button and immediately background the application by clicking the home button. Key is to make sure you home out before the re-center is finished.
  3. Foreground application again.

Expected behavior

Application doesn't crash.

Actual behavior

Application crashes.

I wasn't able to get a huge backtrace when using the sample app, but I do see this bit:

2019-04-04 14:09:28.733 8373-8407/com.mapbox.services.android.navigation.app E/CrashMonitor: Caught SIG 11 with CODE 1

With our app i get a better trace:

2019-04-04 14:05:40.271 7257-7624/com.app.debug A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c0 in tid 7624 (GLThread 36438), pid 7257 (dtrippers.debug)
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG: Build fingerprint: 'google/blueline/blueline:9/PQ2A.190305.002/5240760:user/release-keys'
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG: Revision: 'MP1.0'
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG: ABI: 'arm64'
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG: pid: 7257, tid: 7624, name: GLThread 36438  >>> com.app.debug <<<
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c0
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG: Cause: null pointer dereference
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x0  bb3aace310797a6a  x1  000000000000000c  x2  0000006f58c4d448  x3  0000006f5ce81970
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x4  0000006f58c4d4a8  x5  0000008000000000  x6  284903ff3a445328  x7  7f7f7f7f7f7f7f7f
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x8  bb3aace310797a6a  x9  c95fd5825c0a0e0f  x10 216dd4821396bdd3  x11 9ddfea08eb382d69
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x12 000726579614c737  x13 000000000000002b  x14 00000000000046ab  x15 000000000000000b
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x16 0000006fffcb0be0  x17 0000006fffc4395c  x18 0000000000000008  x19 0000006f581106a1
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x20 000000000000000c  x21 0000000000000000  x22 00000000000001b8  x23 0000006f581106a0
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x24 00000000000001b8  x25 0000006f58c4e588  x26 0000006f581106b8  x27 0000000000000000
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     x28 0000000012fc9b58  x29 0000006f58c4d380
2019-04-04 14:05:40.397 7742-7742/? A/DEBUG:     sp  0000006f58c4d340  lr  0000006f603ecfd8  pc  0000006f603ecfd8
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG: backtrace:
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #00 pc 00000000000eafd8  /data/app/com.app.debug-GRm6bHATrPKMv2t1RJ-QAA==/lib/arm64/libmapbox-gl.so
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #01 pc 00000000000eadb0  /data/app/com.app.debug-GRm6bHATrPKMv2t1RJ-QAA==/lib/arm64/libmapbox-gl.so
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #02 pc 00000000000da11c  /data/app/com.app.debug-GRm6bHATrPKMv2t1RJ-QAA==/lib/arm64/libmapbox-gl.so
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #03 pc 00000000001a32bc  /data/app/com.app.debug-GRm6bHATrPKMv2t1RJ-QAA==/lib/arm64/libmapbox-gl.so
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #04 pc 000000000008e380  /data/app/com.app.debug-GRm6bHATrPKMv2t1RJ-QAA==/lib/arm64/libmapbox-gl.so
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #05 pc 000000000003a2f4  /data/app/com.app.debug-GRm6bHATrPKMv2t1RJ-QAA==/lib/arm64/libmapbox-gl.so
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #06 pc 000000000018d22c  /dev/ashmem/dalvik-jit-code-cache (deleted) (com.mapbox.mapboxsdk.maps.NativeMapView.nativeCancelTransitions+124)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #07 pc 00000000000e1544  /dev/ashmem/dalvik-jit-code-cache (deleted) (android.opengl.GLSurfaceView$GLThread.guardedRun+2004)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #08 pc 0000000000545b88  /system/lib64/libart.so (art_quick_invoke_stub+584)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #09 pc 00000000000cf698  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #10 pc 000000000027a978  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #11 pc 000000000024e828  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.953976685+216)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #12 pc 0000000000254098  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #13 pc 000000000027499c  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #14 pc 0000000000516b64  /system/lib64/libart.so (MterpInvokeDirect+296)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #15 pc 0000000000538294  /system/lib64/libart.so (ExecuteMterpImpl+14484)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #16 pc 0000000000ad65f8  /system/framework/boot-framework.vdex (android.opengl.GLSurfaceView$GLThread.run+48)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #17 pc 000000000024e938  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.953976685+488)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #18 pc 00000000005064ec  /system/lib64/libart.so (artQuickToInterpreterBridge+1032)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #19 pc 000000000054ecfc  /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #20 pc 0000000000545b88  /system/lib64/libart.so (art_quick_invoke_stub+584)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #21 pc 00000000000cf698  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #22 pc 000000000044f524  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #23 pc 00000000004505f0  /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #24 pc 000000000047ae10  /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1260)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #25 pc 00000000000821e0  /system/lib64/libc.so (__pthread_start(void*)+36)
2019-04-04 14:05:40.466 7742-7742/? A/DEBUG:     #26 pc 0000000000023178  /system/lib64/libc.so (__start_thread+68)
2019-04-04 14:05:41.591 885-885/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_06
@saravanadinesh
Copy link

saravanadinesh commented Apr 5, 2019

I have similar issue since I have migrated my app from Mapbox Navigation SDK version: 0.33.0 to Mapbox Navigation SDK version: 0.34.0 with targetSdkVersion 28.
But the repro steps are simpler that what you have provided.

  1. Start navigation (no need to recenter)
  2. Press home and make app background
  3. Try to bring the app back to foreground and the app crashed with similar signature

2019-04-05 12:50:02.492 4671-4732/io.company.myapplication A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1c0 in tid 4732 (GLThread 10566)

@Guardiola31337
Copy link
Contributor

I was able to reproduce the following Maps native crash with the steps described 👀

04-05 15:12:34.494 28935-28967/com.mapbox.services.android.navigation.app A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x148 in tid 28967 (GLThread 7234)
04-05 15:12:34.596 203-203/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-05 15:12:34.596 203-203/? A/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys'
04-05 15:12:34.596 203-203/? A/DEBUG: Revision: '11'
04-05 15:12:34.596 203-203/? A/DEBUG: ABI: 'arm'
04-05 15:12:34.596 203-203/? A/DEBUG: pid: 28935, tid: 28967, name: GLThread 7234  >>> com.mapbox.services.android.navigation.app <<<
04-05 15:12:34.596 203-203/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x148
04-05 15:12:34.640 203-203/? A/DEBUG:     r0 031ce6a4  r1 8e5028e9  r2 8e545a4b  r3 00000000
04-05 15:12:34.641 203-203/? A/DEBUG:     r4 94347840  r5 94347840  r6 00000144  r7 9f583420
04-05 15:12:34.641 203-203/? A/DEBUG:     r8 9f58344c  r9 00000000  sl 9f583440  fp ab498fe0
04-05 15:12:34.641 203-203/? A/DEBUG:     ip 00000008  sp 9f583400  lr 9434785c  pc 9fb8adb4  cpsr 00070030
04-05 15:12:34.649 203-203/? A/DEBUG: backtrace:
04-05 15:12:34.649 203-203/? A/DEBUG:     #00 pc 0005ddb4  /data/app/com.mapbox.services.android.navigation.app-1/lib/arm/libmapbox-gl.so
04-05 15:12:34.649 203-203/? A/DEBUG:     #01 pc 0009845d  /data/app/com.mapbox.services.android.navigation.app-1/lib/arm/libmapbox-gl.so
04-05 15:12:34.649 203-203/? A/DEBUG:     #02 pc 0008b507  /data/app/com.mapbox.services.android.navigation.app-1/lib/arm/libmapbox-gl.so
04-05 15:12:34.649 203-203/? A/DEBUG:     #03 pc 0011dd89  /data/app/com.mapbox.services.android.navigation.app-1/lib/arm/libmapbox-gl.so
04-05 15:12:34.649 203-203/? A/DEBUG:     #04 pc 00051c17  /data/app/com.mapbox.services.android.navigation.app-1/lib/arm/libmapbox-gl.so
04-05 15:12:34.649 203-203/? A/DEBUG:     #05 pc 0001ad13  /data/app/com.mapbox.services.android.navigation.app-1/lib/arm/libmapbox-gl.so
04-05 15:12:34.650 203-203/? A/DEBUG:     #06 pc 0156948f  /data/app/com.mapbox.services.android.navigation.app-1/oat/arm/base.odex (offset 0xe64000) (void com.mapbox.mapboxsdk.maps.renderer.MapRendererRunnable.run()+74)
04-05 15:12:34.650 203-203/? A/DEBUG:     #07 pc 73bdc5fb  /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1ed6000)

After bisecting latest commits I found that the issue was introduced by #1844 - bumping Maps SDK version to 7.3.0. Could you take a look at this @mapbox/maps-android when you have a chance?

In any case, that's different than the one you saw @DejanRistic, were you able to reproduce using Mapbox Navigation SDK v0.33.2? Could you add some more information for reproducing the issue (minimal example) or any other specifics around your test setup? If there is any sample or pseudo code you can provide, that would be really helpful, because without having additional information I'm unable to reproduce that null pointer dereference crash you're seeing.

cc @saravanadinesh

@Guardiola31337 Guardiola31337 added the bug Defect to be fixed. label Apr 5, 2019
@saravanadinesh
Copy link

Issue not seen with v0.33.2

@Guardiola31337
Copy link
Contributor

Thanks for the update @saravanadinesh I wasn't able to reproduce with v0.33.2 either.

Wondering if @DejanRistic can reproduce the issue described in OP. I wasn't able to reproduce that one, not even with v0.34.0 🤔 Please @DejanRistic report back if you can check this out 🙏

In the meantime, we're working on a fix for the upstream MapRendererRunnable native crash.

Thank you for your patience.

@DejanRistic
Copy link
Author

DejanRistic commented Apr 8, 2019

@Guardiola31337 you're right, i confused the crash @saravanadinesh found with the one I saw in our application because the repro was similar. Testing the sample app before the mapbox version update i'm not able to repro my original crash there.

I still get the OP crash in our app, but since I can't repro it in the sample app we can close this if there's a fix for the crash you were able to repro.

I think my crash might be related to accessing layers after coming back into the app. We update the visibility of some of the mapbox views and replace them with our own. Maybe related to this:

mapbox/mapbox-gl-native#13797

@Guardiola31337
Copy link
Contributor

Awesome, thanks for confirming @DejanRistic

I think my crash might be related to accessing layers after coming back into the app. We update the visibility of some of the mapbox views and replace them with our own.

Yeah, most likely, there's an update pushed to the GeoJsonSource after it's been destroyed. You could monitor every setGeoJson method when foregrounding the app, verifying map's and source's state in the same time and checking if anything is off. But yeah, this a different one.

I'm going to leave this ticket opened until we figure / fix the other crash that we're seeing. We'll report back here.

Thanks again!

cc @LukasPaczos

@tobrun
Copy link
Member

tobrun commented Apr 8, 2019

@Guardiola31337

To look more into this we need know a bit more about what is going wrong, we need to be able to pinpoint where the crash originates. That can be done with either:

  • reproducing and symbolicating the trace with a gl-native debug build
  • debug to the point were it crashes

One additional thing that would be interesting is to verify if enabling TextureView makes any difference.

@Guardiola31337
Copy link
Contributor

@tobrun

reproducing and symbolicating the trace with a gl-native debug build

********** Crash dump: **********
Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys'
#00 0x00139a9c /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
std::__ndk1::__bucket_list_deallocator<std::__ndk1::allocator<std::__ndk1::__hash_node_base<std::__ndk1::__hash_node<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, void*>*>*> >::size() const
/Users/pguardiola/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__hash_table:809:55
std::__ndk1::__hash_table<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, std::__ndk1::__unordered_map_hasher<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, true>, std::__ndk1::__unordered_map_equal<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, true>, std::__ndk1::allocator<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> > > >::bucket_count() const
/Users/pguardiola/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__hash_table:1221:0
std::__ndk1::__hash_const_iterator<std::__ndk1::__hash_node<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, void*>*> std::__ndk1::__hash_table<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, std::__ndk1::__unordered_map_hasher<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, true>, std::__ndk1::__unordered_map_equal<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, true>, std::__ndk1::allocator<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::Immutable<mbgl::style::Image::Impl> > > >::find<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const
/Users/pguardiola/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__hash_table:2504:0
#01 0x0020a1fb /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
std::__ndk1::unordered_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<mbgl::RenderLayer, std::__ndk1::default_delete<mbgl::RenderLayer> >, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::unique_ptr<mbgl::RenderLayer, std::__ndk1::default_delete<mbgl::RenderLayer> > > > >::find(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const
/Users/pguardiola/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/unordered_map:1267:69
mbgl::Renderer::Impl::getRenderLayer(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../src/mbgl/renderer/renderer_impl.cpp:766:0
#02 0x00209d7b /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
mbgl::Renderer::Impl::queryRenderedFeatures(mapbox::geometry::line_string<double, std::__ndk1::vector> const&, mbgl::RenderedQueryOptions const&) const
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../src/mbgl/renderer/renderer_impl.cpp:621:44
#03 0x001fa383 /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
mbgl::Renderer::queryRenderedFeatures(mapbox::geometry::point<double> const&, mbgl::RenderedQueryOptions const&) const
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../src/mbgl/renderer/renderer.cpp:42:18
#04 0x00423977 /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
std::__ndk1::vector<mapbox::feature::feature<double>, std::__ndk1::allocator<mapbox::feature::feature<double> > > mbgl::AskMessageImpl<std::__ndk1::vector<mapbox::feature::feature<double>, std::__ndk1::allocator<mapbox::feature::feature<double> > >, mbgl::Renderer, std::__ndk1::vector<mapbox::feature::feature<double>, std::__ndk1::allocator<mapbox::feature::feature<double> > > (mbgl::Renderer::*)(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, mbgl::SourceQueryOptions const&) const, std::__ndk1::tuple<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::SourceQueryOptions> >::ask<0u, 1u>(std::__ndk1::integer_sequence<unsigned int, 0u, 1u>)
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../include/mbgl/actor/message.hpp:58:16
#05 0x00423685 /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
mbgl::AskMessageImpl<std::__ndk1::vector<mapbox::feature::feature<double>, std::__ndk1::allocator<mapbox::feature::feature<double> > >, mbgl::Renderer, std::__ndk1::vector<mapbox::feature::feature<double>, std::__ndk1::allocator<mapbox::feature::feature<double> > > (mbgl::Renderer::*)(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, mbgl::SourceQueryOptions const&) const, std::__ndk1::tuple<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, mbgl::SourceQueryOptions> >::operator()()
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../include/mbgl/actor/message.hpp:53:27
#06 0x000e7633 /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
mbgl::Mailbox::receive()
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../src/mbgl/actor/mailbox.cpp:85:5
#07 0x000e785b /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
mbgl::Mailbox::maybeReceive(std::__ndk1::weak_ptr<mbgl::Mailbox>)
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../src/mbgl/actor/mailbox.cpp:94:17
#08 0x0002aded /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
mbgl::android::MapRendererRunnable::run(_JNIEnv&)
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../src/map_renderer_runnable.cpp:24:5
#09 0x0002c6cd /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)::operator()(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../vendor/jni.hpp/include/jni/native_method.hpp:274:28
#10 0x0002c635 /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
auto jni::NativeMethodMaker<void (auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)::*)(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const>::operator()<auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)>(char const*, auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const&)::'lambda'(_JNIEnv*, jni::jobject*)::operator()(_JNIEnv*, jni::jobject*) const
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../vendor/jni.hpp/include/jni/native_method.hpp:127:17
#11 0x0002c5e1 /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
auto jni::NativeMethodMaker<void (auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)::*)(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const>::operator()<auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)>(char const*, auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const&)::'lambda'(_JNIEnv*, jni::jobject*)::__invoke(_JNIEnv*, jni::jobject*)
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../vendor/jni.hpp/include/jni/native_method.hpp:125:28
#12 0x0002c73d /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
auto auto jni::MakeNativeMethod<auto jni::NativeMethodMaker<void (auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)::*)(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const>::operator()<auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)>(char const*, auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const&)::'lambda'(_JNIEnv*, jni::jobject*)>(char const*, char const*, auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const&, std::__ndk1::enable_if<std::is_class<auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)>::value, void>::type*)::'lambda'(_JNIEnv*, auto...)::operator()<jni::jobject*>(_JNIEnv*, auto...) const
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../vendor/jni.hpp/include/jni/native_method.hpp:57:24
#13 0x0002c6fd /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/lib/arm/libmapbox-gl.so
auto auto jni::MakeNativeMethod<auto jni::NativeMethodMaker<void (auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)::*)(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const>::operator()<auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)>(char const*, auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const&)::'lambda'(_JNIEnv*, jni::jobject*)>(char const*, char const*, auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&) const&, std::__ndk1::enable_if<std::is_class<auto jni::NativePeerMemberFunctionMethod<void (mbgl::android::MapRendererRunnable::*)(_JNIEnv&), &(mbgl::android::MapRendererRunnable::run(_JNIEnv&))>::operator()<mbgl::android::MapRendererRunnable, mbgl::android::MapRendererRunnable, void>(jni::Field<mbgl::android::MapRendererRunnable, long long> const&)::'lambda'(_JNIEnv&, jni::Object<mbgl::android::MapRendererRunnable>&)>::value, void>::type*)::'lambda'(_JNIEnv*, auto...)::__invoke<jni::jobject*>(_JNIEnv*, auto...)
/Users/pguardiola/mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/debug/armeabi-v7a/../../../../../../../vendor/jni.hpp/include/jni/native_method.hpp:53:24
#14 0x00c942d7 /data/app/com.mapbox.mapboxsdk.downstream.testapp-1/oat/arm/base.odex (offset 0x86e000) (void com.mapbox.mapboxsdk.maps.renderer.MapRendererRunnable.run()+74)
#15 0x73bdc5fb /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1ed6000)
Crash dump is completed

This is testing NavigationLauncherActivity in a separate test module of mapbox-gl-native and when bringing the app into the foreground after backgrounding the crash happens. It seems something related to the MapRenderer lifecycle.

One additional thing that would be interesting is to verify if enabling TextureView makes any difference.

Going to test now if I can reproduce enabling TextureView.

@tobrun
Copy link
Member

tobrun commented Apr 9, 2019

@Guardiola31337 the stacktrace shows that queryRenderedFeatures is responsible. Considering this is the only occurrence I could find by quickly searching the codebase. I'm sure the issue is related to:

https://github.com/mapbox/mapbox-navigation-android/blob/f1c3c724cfdf3ebf2dd863cba501d9afb3e022cf/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/map/WaynameFeatureFinder.java

Could you verify that above is responsible? Can you validate that this is being called when the underlying surface isn't ready?

@Guardiola31337
Copy link
Contributor

Could you verify that above is responsible? Can you validate that this is being called when the underlying surface isn't ready?

Looking now. Wondering though what has changed in the Maps side because we haven't seen this issue until v7.3.0 🤔

One additional thing that would be interesting is to verify if enabling TextureView makes any difference.

Going to test now if I can reproduce enabling TextureView.

I wasn't able to reproduce the crash with mapbox_renderTextureMode enabled. What I see is a blank map (just an instant) when bringing the app into the foreground after backgrounding.

@Guardiola31337
Copy link
Contributor

Upstream fix 👉 mapbox/mapbox-gl-native#14395

@Guardiola31337
Copy link
Contributor

I've just confirmed that mapbox/mapbox-gl-native#14395 fixed the crash 🎉

Thanks for the quick fix @mapbox/maps-android

@tests1028
Copy link

mapbox android sdk version 7.3.2 also gettig this error. any solution?

@zugaldia
Copy link
Member

@tests1028 are you using v7.3.2 directly, or via the Mapbox Navigation SDK?

@tests1028
Copy link

Yah directly I used 7.3.2 library project

@zugaldia
Copy link
Member

@tests1028 In that case, could you open a new ticket for Maps SDK on https://github.com/mapbox/mapbox-gl-native? This ticket tracks navigation-specific issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants