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

Crash on rotating with Android Emulator #2371

Open
westnordost opened this issue May 7, 2024 · 5 comments
Open

Crash on rotating with Android Emulator #2371

westnordost opened this issue May 7, 2024 · 5 comments
Labels
android bug Something isn't working simulator

Comments

@westnordost
Copy link
Collaborator

westnordost commented May 7, 2024

(At least) on my Android emulator API 34 (x86_64, no google play services), the app crashes under very specific circumstances.

It does not occur for my phone. That doesn't necessarily mean that it is an emulator-only issue, though.

I removed more and more of the application specific code to reach a minimum example under which the crash is reproducible. The stack trace for the crash is

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30 in tid 20317 (GLThread 75), pid 20266 (tcomplete.debug)
Cmdline: de.westnordost.streetcomplete.debug
pid: 20266, tid: 20317, name: GLThread 75  >>> de.westnordost.streetcomplete.debug <<<
  #01 pc 00000000008a30f0  /data/app/~~FlV_wTtDbpGAhKi7d-Nyiw==/de.westnordost.streetcomplete.debug-pfW0p6KogwkZTB_OvTfkHg==/lib/x86_64/libmaplibre.so (BuildId: 72755dbb07905a5c27ee0745f98585e3ab996356)
  #02 pc 00000000008a6628  /data/app/~~FlV_wTtDbpGAhKi7d-Nyiw==/de.westnordost.streetcomplete.debug-pfW0p6KogwkZTB_OvTfkHg==/lib/x86_64/libmaplibre.so (BuildId: 72755dbb07905a5c27ee0745f98585e3ab996356)
  #03 pc 00000000008a84eb  /data/app/~~FlV_wTtDbpGAhKi7d-Nyiw==/de.westnordost.streetcomplete.debug-pfW0p6KogwkZTB_OvTfkHg==/lib/x86_64/libmaplibre.so (BuildId: 72755dbb07905a5c27ee0745f98585e3ab996356)
  #04 pc 00000000006a6d79  /data/app/~~FlV_wTtDbpGAhKi7d-Nyiw==/de.westnordost.streetcomplete.debug-pfW0p6KogwkZTB_OvTfkHg==/lib/x86_64/libmaplibre.so (BuildId: 72755dbb07905a5c27ee0745f98585e3ab996356)
  #05 pc 00000000006a531a  /data/app/~~FlV_wTtDbpGAhKi7d-Nyiw==/de.westnordost.streetcomplete.debug-pfW0p6KogwkZTB_OvTfkHg==/lib/x86_64/libmaplibre.so (BuildId: 72755dbb07905a5c27ee0745f98585e3ab996356)
  #06 pc 00000000004c0611  /data/app/~~FlV_wTtDbpGAhKi7d-Nyiw==/de.westnordost.streetcomplete.debug-pfW0p6KogwkZTB_OvTfkHg==/lib/x86_64/libmaplibre.so (mbgl::android::MapRenderer::render(_JNIEnv&)+241) (BuildId: 72755dbb07905a5c27ee0745f98585e3ab996356)
  #07 pc 00000000004c3160  /data/app/~~FlV_wTtDbpGAhKi7d-Nyiw==/de.westnordost.streetcomplete.debug-pfW0p6KogwkZTB_OvTfkHg==/lib/x86_64/libmaplibre.so (auto auto jni::MakeNativeMethod::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&)::*)(_JNIEnv&, jni::Object&) const>::operator()::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&)>(char const*, auto jni::NativePeerMemberFunctionMethod::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&) const&)::'lambda'(_JNIEnv*, jni::jobject*)>(char const*, char const*, auto jni::NativePeerMemberFunctionMethod::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&) const&, std::__ndk1::enable_if::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&)>::value, void>::type*)::'lambda'(_JNIEnv*, auto...)::__invoke(_JNIEnv*, auto...)+32) (BuildId: 72755dbb07905a5c27ee0745f98585e3ab996356)
  #14 pc 00000000000ac0c0  /data/data/de.westnordost.streetcomplete.debug/code_cache/.overlay/base.apk/classes3.dex (org.maplibre.android.maps.renderer.MapRenderer.onDrawFrame+0)
  #20 pc 00000000000acff4  /data/data/de.westnordost.streetcomplete.debug/code_cache/.overlay/base.apk/classes3.dex (org.maplibre.android.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer.onDrawFrame+0)
  #26 pc 00000000000ad7b0  /data/data/de.westnordost.streetcomplete.debug/code_cache/.overlay/base.apk/classes3.dex (org.maplibre.android.maps.renderer.glsurfaceview.MapLibreGLSurfaceView$GLThread.guardedRun+0)
  #32 pc 00000000000ae0d4  /data/data/de.westnordost.streetcomplete.debug/code_cache/.overlay/base.apk/classes3.dex (org.maplibre.android.maps.renderer.glsurfaceview.MapLibreGLSurfaceView$GLThread.run+0)

To Reproduce

  1. Have an icon of a Symbol Layer in or almost in view, with the following styling:
icon-allow-overlap = true,        // icon-ignore-placement = true also reproduces crash
symbol-z-order = "viewport-y"     // ="auto" and thus leaving out this property also reproduces the crash
  1. Then, rotate the map.

Minimum code used to add such an icon for reproducing the crash. It doesn't matter which icon one uses for that.

val drawable = requireContext().getDrawable(R.drawable.ic_question_24dp)!!

style.addImage("my-img", drawable)

val source = GeoJsonSource("my-source")

style.addSource(source)

style.addLayer(SymbolLayer("my-layer", "my-source")
    .withProperties(
        iconImage("my-img"),
        iconAllowOverlap(true),
        symbolZOrder(Property.SYMBOL_Z_ORDER_VIEWPORT_Y),
    )
)
source.setGeoJson(Point.fromLngLat(13.39719, 52.53009))

Video

crash.mp4

Platform information

  • OS: Android API 34, x86_64, no google play services
  • Version 11.0-pre6
@westnordost westnordost added the bug Something isn't working label May 7, 2024
@louwers
Copy link
Collaborator

louwers commented May 22, 2024

I am able to reproduce this, but since the crash happens in OpenGL code, this should be reported upstream.

Feel free to re-open if this also shows up on real devices.

@louwers louwers closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
@westnordost
Copy link
Collaborator Author

westnordost commented May 23, 2024

Fair enough, though note that I do not have the necessary insights to be able to create a bug report upstream. They will want to know which OpenGL function exactly, given which parameters, causes a crash.

Pointing to that authors of some library are sure(?) that it is a problem in the emulator rather than in their own code won't do the trick, even the most well-meaning and committed maintainers would not accept a bug report like that.

@louwers
Copy link
Collaborator

louwers commented May 23, 2024

@westnordost Maybe a stack trace is enough for them, it's worth a shot. But I think Google is well aware of these problems with graphics emulation. I think it will get better over time, but we cannot limit ourselves to what the emulator currently supports well of course.

@westnordost
Copy link
Collaborator Author

This is not reproducible with org.maplibre.gl:android-sdk:11.3.0-vulkan-pre0.

@westnordost
Copy link
Collaborator Author

westnordost commented Dec 6, 2024

I can reproduce this with:

Pixel 6 Android API 29 emulator x86-64 on Windows 10 with maplibre 11.6.1

Log
2024-12-06 22:09:52.643  4195-4260  libc                    de.westnordost.streetcomplete.debug  A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30 in tid 4260 (RenderThread 24), pid 4195 (tcomplete.debug)
2024-12-06 22:09:52.676  4291-4291  DEBUG                   pid-4291                             A  pid: 4195, tid: 4260, name: RenderThread 24  >>> de.westnordost.streetcomplete.debug <<<
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #01 pc 00000000008e2c2e  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #02 pc 000000000090383b  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #03 pc 0000000000905383  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #04 pc 00000000006ec04c  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #05 pc 00000000006ea35e  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #06 pc 00000000004d6da5  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/lib/x86_64/libmaplibre.so (mbgl::android::MapRenderer::render(_JNIEnv&)+229) (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #07 pc 00000000004d9e20  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/lib/x86_64/libmaplibre.so (_ZZN3jni16MakeNativeMethodIZNS_17NativeMethodMakerIMZNS_30NativePeerMemberFunctionMethodIMN4mbgl7android11MapRendererEFvR7_JNIEnvEXadL_ZNS5_6renderES7_EEEclIS5_S5_vEEDaRKNS_5FieldIT0_lEEEUlS7_RNS_6ObjectIS5_EEE_KFvS7_SJ_EJEEclISK_EEDaPKcRKT_EUlPS6_PNS_7jobjectEE_EEDaSQ_SQ_ST_PNSt6__ndk19enable_ifIXsr3std8is_classISR_EE5valueEvE4typeEENUlSU_DpT_E_8__invokeIJSW_EEEDaSU_S14_+32) (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #15 pc 0000000002744a80  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/oat/x86_64/base.vdex (org.maplibre.android.maps.renderer.MapRenderer.onDrawFrame+12)
2024-12-06 22:09:52.723  4291-4291  DEBUG                   pid-4291                             A        #18 pc 0000000002747dc0  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/oat/x86_64/base.vdex (org.maplibre.android.maps.renderer.surfaceview.SurfaceViewMapRenderer.onDrawFrame)
2024-12-06 22:09:52.724  4291-4291  DEBUG                   pid-4291                             A        #21 pc 0000000002746e92  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/oat/x86_64/base.vdex (org.maplibre.android.maps.renderer.surfaceview.MapLibreGLSurfaceView$GLThread.guardedRun+950)
2024-12-06 22:09:52.724  4291-4291  DEBUG                   pid-4291                             A        #24 pc 00000000027477b4  /data/app/de.westnordost.streetcomplete.debug-xz4fjeqxjVGq6uIo_Xsc0g==/oat/x86_64/base.vdex (org.maplibre.android.maps.renderer.surfaceview.MapLibreSurfaceView$RenderThread.run+52)
2024-12-06 22:09:52.996  1985-2091  InputDispatcher         system_process                       E  channel 'd899c65 de.westnordost.streetcomplete.debug/de.westnordost.streetcomplete.screens.main.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2024-12-06 22:09:54.894  1985-2368  InputDispatcher         system_process                       E  Window handle Window{e89f5b5 u0 Application Error: de.westnordost.streetcomplete.debug} has no registered input channel

Generic Phone Android API 34 emulator x86-64 on Windows 10 with maplibre 11.6.1.

Log
2024-12-06 22:12:27.754  3506-4166  libc                    de.westnordost.streetcomplete.debug  A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30 in tid 4166 (RenderThread 73), pid 3506 (tcomplete.debug)
2024-12-06 22:12:28.464  4227-4227  DEBUG                   crash_dump64                         A  Cmdline: de.westnordost.streetcomplete.debug
2024-12-06 22:12:28.464  4227-4227  DEBUG                   crash_dump64                         A  pid: 3506, tid: 4166, name: RenderThread 73  >>> de.westnordost.streetcomplete.debug <<<
2024-12-06 22:12:28.465  4227-4227  DEBUG                   crash_dump64                         A        #01 pc 00000000008e2c2e  /data/app/~~dRFqIGHTd87li7Xgz3jJXw==/de.westnordost.streetcomplete.debug-O6bimIj8ZTAioSUr0th9Uw==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:12:28.465  4227-4227  DEBUG                   crash_dump64                         A        #02 pc 000000000090383b  /data/app/~~dRFqIGHTd87li7Xgz3jJXw==/de.westnordost.streetcomplete.debug-O6bimIj8ZTAioSUr0th9Uw==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:12:28.465  4227-4227  DEBUG                   crash_dump64                         A        #03 pc 0000000000905383  /data/app/~~dRFqIGHTd87li7Xgz3jJXw==/de.westnordost.streetcomplete.debug-O6bimIj8ZTAioSUr0th9Uw==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:12:28.465  4227-4227  DEBUG                   crash_dump64                         A        #04 pc 00000000006ec04c  /data/app/~~dRFqIGHTd87li7Xgz3jJXw==/de.westnordost.streetcomplete.debug-O6bimIj8ZTAioSUr0th9Uw==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:12:28.465  4227-4227  DEBUG                   crash_dump64                         A        #05 pc 00000000006ea35e  /data/app/~~dRFqIGHTd87li7Xgz3jJXw==/de.westnordost.streetcomplete.debug-O6bimIj8ZTAioSUr0th9Uw==/lib/x86_64/libmaplibre.so (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:12:28.465  4227-4227  DEBUG                   crash_dump64                         A        #06 pc 00000000004d6da5  /data/app/~~dRFqIGHTd87li7Xgz3jJXw==/de.westnordost.streetcomplete.debug-O6bimIj8ZTAioSUr0th9Uw==/lib/x86_64/libmaplibre.so (mbgl::android::MapRenderer::render(_JNIEnv&)+229) (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)
2024-12-06 22:12:28.465  4227-4227  DEBUG                   crash_dump64                         A        #07 pc 00000000004d9e20  /data/app/~~dRFqIGHTd87li7Xgz3jJXw==/de.westnordost.streetcomplete.debug-O6bimIj8ZTAioSUr0th9Uw==/lib/x86_64/libmaplibre.so (auto auto jni::MakeNativeMethod::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&)::*)(_JNIEnv&, jni::Object&) const>::operator()::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&)>(char const*, auto jni::NativePeerMemberFunctionMethod::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&) const&)::'lambda'(_JNIEnv*, jni::jobject*)>(char const*, char const*, auto jni::NativePeerMemberFunctionMethod::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&) const&, std::__ndk1::enable_if::operator()(jni::Field const&)::'lambda'(_JNIEnv&, jni::Object&)>::value, void>::type*)::'lambda'(_JNIEnv*, auto...)::__invoke(_JNIEnv*, auto...)+32) (BuildId: 4cbdbe8444325102f6e9c11c9c0759c9925422db)

The issue is not reproducible on 11.6.1-vulkan-pre1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working simulator
Projects
None yet
Development

No branches or pull requests

2 participants