yandex / yandex_maps_mapkit_lite

Other
5 stars 0 forks source link

Приложение зависает или крашится на android #10

Open zombie6888 opened 2 months ago

zombie6888 commented 2 months ago

Спустя какое то время после манипуляций с картами приложение может зависнуть или крашнутся.

Лог с эмулятора:

` F/libc ( 4212): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 4212 (ple.yandex_maps), pid 4212 (ple.yandex_maps) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'google/sdk_gphone64_x86_64/emu64xa:15/AP31.240617.003/12088229:user/release-keys' Revision: '0' ABI: 'x86_64' Timestamp: 2024-08-22 15:14:29.027786900+0000 Process uptime: 6708s Cmdline: com.example.yandex_maps pid: 4212, tid: 4212, name: ple.yandex_maps >>> com.example.yandex_maps <<< uid: 10200 signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- rax 0000000000000000 rbx 00007ffe21f10e58 rcx 000071fcf993ab90 rdx 0000000000000006 r8 00007ffe21f10f10 r9 00007ffe21f10f10 r10 00007ffe21f10e60 r11 0000000000000207 r12 000071fab8775b20 r13 00000000141d6d98 r14 0000000000001074 r15 0000000000001074 rdi 0000000000001074 rsi 0000000000001074 rbp 00007ffe21f11060 rsp 00007ffe21f10e50 rip 000071fcf993ab90 51 total frames backtrace: #00 pc 000000000005cb90 /apex/com.android.runtime/lib64/bionic/libc.so (abort+192) (BuildId: eb58b4d427279994f00c0e1818477e4f) #01 pc 0000000000f78d57 /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (BuildId: c6acec3da049826b) #02 pc 0000000000f78b78 /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (BuildId: c6acec3da049826b) #03 pc 0000000000f78b08 /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (BuildId: c6acec3da049826b) #04 pc 00000000009348a2 /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (BuildId: c6acec3da049826b) #05 pc 000000000094e74e /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (BuildId: c6acec3da049826b) #06 pc 00000000009348a2 /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (BuildId: c6acec3da049826b) #07 pc 000000000094e296 /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (BuildId: c6acec3da049826b) #08 pc 0000000000947c7c /data/app/~~t0p90k4T0ZNqzRSN_Rw6QQ==/com.example.yandex_maps-MBYWTau3PsQY01G3uwv_sQ==/base.apk!libmaps-mobile.so (offset 0xbd77000) (Java_com_yandex_runtime_internal_Scheduler_run+34) (BuildId: c6acec3da049826b) #09 pc 000000000022b5eb /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+219) (BuildId: cc3935ed95bd90125d95358058f8cf18) #10 pc 00000000004a5ca2 [anon_shmem:dalvik-jit-code-cache] (offset 0x2000000) (com.yandex.runtime.internal.Scheduler.handleMessage+194) #11 pc 00000000000573dd [anon_shmem:dalvik-jit-code-cache] (offset 0x2000000) (android.os.Handler.dispatchMessage+349) #12 pc 000000000004965b [anon_shmem:dalvik-jit-code-cache] (offset 0x2000000) (android.os.Looper.loopOnce+1147) #13 pc 000000000039e592 [anon_shmem:dalvik-jit-code-cache] (offset 0x2000000) (android.os.Looper.loop+306) #14 pc 000000000022cffb /apex/com.android.art/lib64/libart.so (art_quick_osr_stub+27) (BuildId: cc3935ed95bd90125d95358058f8cf18) #15 pc 0000000000630588 /apex/com.android.art/lib64/libart.so (art::jit::Jit::MaybeDoOnStackReplacement(art::Thread*, art::ArtMethod*, unsigned int, int, art::JValue*)+472) (BuildId: cc3935ed95bd90125d95358058f8cf18) #16 pc 00000000002340cb /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp(art::interpreter::SwitchImplContext*)+18955) (BuildId: cc3935ed95bd90125d95358058f8cf18) #17 pc 000000000022d2e5 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+5) (BuildId: cc3935ed95bd90125d95358058f8cf18) #18 pc 000000000020c7c0 /system/framework/framework.jar (android.os.Looper.loop+0) #19 pc 00000000005f1de9 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238)+505) (BuildId: cc3935ed95bd90125d95358058f8cf18) #20 pc 00000000005f85f7 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+103) (BuildId: cc3935ed95bd90125d95358058f8cf18) #21 pc 00000000005f92d9 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+2313) (BuildId: cc3935ed95bd90125d95358058f8cf18) #22 pc 0000000000233364 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp(art::interpreter::SwitchImplContext*)+15524) (BuildId: cc3935ed95bd90125d95358058f8cf18) #23 pc 000000000022d2e5 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+5) (BuildId: cc3935ed95bd90125d95358058f8cf18) #24 pc 00000000001d605c /system/framework/framework.jar (android.app.ActivityThread.main+0) #25 pc 00000000005f1de9 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238)+505) (BuildId: cc3935ed95bd90125d95358058f8cf18) #26 pc 0000000000987e6e /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+958) (BuildId: cc3935ed95bd90125d95358058f8cf18) #27 pc 000000000022b77c /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+140) (BuildId: cc3935ed95bd90125d95358058f8cf18) #28 pc 00000000002124b6 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+806) (BuildId: cc3935ed95bd90125d95358058f8cf18) #29 pc 0000000000474c24 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: cc3935ed95bd90125d95358058f8cf18) #30 pc 00000000008745ea /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+2218) (BuildId: cc3935ed95bd90125d95358058f8cf18) #31 pc 00000000007d00b7 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+39) (BuildId: cc3935ed95bd90125d95358058f8cf18) #32 pc 000000000022b5eb /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+219) (BuildId: cc3935ed95bd90125d95358058f8cf18) #33 pc 0000000000212154 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+756) (BuildId: cc3935ed95bd90125d95358058f8cf18) #34 pc 0000000000474bf5 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+181) (BuildId: cc3935ed95bd90125d95358058f8cf18) #35 pc 00000000005f92f3 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+2339) (BuildId: cc3935ed95bd90125d95358058f8cf18) #36 pc 0000000000233101 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp(art::interpreter::SwitchImplContext*)+14913) (BuildId: cc3935ed95bd90125d95358058f8cf18) #37 pc 000000000022d2e5 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+5) (BuildId: cc3935ed95bd90125d95358058f8cf18) #38 pc 00000000001d2704 /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+0) #39 pc 00000000005f1de9 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238)+505) (BuildId: cc3935ed95bd90125d95358058f8cf18) #40 pc 0000000000987e6e /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+958) (BuildId: cc3935ed95bd90125d95358058f8cf18) #41 pc 000000000022b77c /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+140) (BuildId: cc3935ed95bd90125d95358058f8cf18) #42 pc 00000000008196f0 /system/framework/x86_64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2704) (BuildId: 6005a51b90f9e2fc0a8f6dd884797425787b8fb0) #43 pc 00000000002124b6 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+806) (BuildId: cc3935ed95bd90125d95358058f8cf18) #44 pc 0000000000474c24 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: cc3935ed95bd90125d95358058f8cf18) #45 pc 0000000000875126 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, __va_list_tag*)+518) (BuildId: cc3935ed95bd90125d95358058f8cf18) #46 pc 0000000000726e9a /apex/com.android.art/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, __va_list_tag*)+586) (BuildId: cc3935ed95bd90125d95358058f8cf18) #47 pc 00000000000dcf68 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+136) (BuildId: 74e467b22a4c3107eac51948743c9977) #48 pc 00000000000f2fb0 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector const&, bool)+928) (BuildId: 74e467b22a4c3107eac51948743c9977) #49 pc 0000000000004706 /system/bin/app_process64 (main+1638) (BuildId: 2919fb70658f9ff2e805cbbbdd33a33b) #50 pc 0000000000057c82 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+114) (BuildId: eb58b4d427279994f00c0e1818477e4f) Lost connection to device. Exited. `

Такие ошибки libc на реальном устройстве в релизе:

` --------- beginning of crash 04-19 17:12:21.492 762 762 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 762 (init), pid 762 (init) 04-19 17:12:21.500 762 762 F libc : crash_dump helper failed to exec, or was killed 04-19 17:12:21.502 766 766 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 766 (init), pid 766 (init) 04-19 17:12:21.507 766 766 F libc : crash_dump helper failed to exec, or was killed 08-13 10:54:55.406 20638 20478 F libc : fdsan: attempted to close file descriptor 223, expected to be unowned, actually owned by DIR* 0x789b490800 08-20 10:31:51.287 6159 17545 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 17545 (1.ui), pid 6159 (ple.yandex_maps) 08-20 16:39:05.086 773 773 F libc : crash_dump helper failed to exec, or was killed 08-20 16:39:05.385 1031 1031 F libc : failed to wait for crash_dump helper: No child processes 08-20 16:39:06.570 803 803 F libc : crash_dump helper failed to exec, or was killed 08-22 20:33:18.354 28920 28920 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 28920 (ple.yandex_maps), pid 28920 (ple.yandex_maps) 08-23 20:12:55.711 17200 17200 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 17200 (ple.yandex_maps), pid 17200 (ple.yandex_maps) 08-23 20:36:54.740 22471 22471 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 22471 (ple.yandex_maps), pid 22471 (ple.yandex_maps) 08-23 21:05:14.291 18533 18533 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 18533 (ple.yandex_maps), pid 18533 (ple.yandex_maps) 08-23 21:57:25.373 14097 14097 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 14097 (ple.yandex_maps), pid 14097 (ple.yandex_maps) 08-23 22:23:18.359 19297 19297 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 19297 (ple.yandex_maps), pid 19297 (ple.yandex_maps) 08-24 09:21:03.597 29690 29690 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 29690 (ple.yandex_maps), pid 29690 (ple.yandex_maps) 08-24 14:58:48.758 773 773 F libc : crash_dump helper failed to exec, or was killed 08-24 14:58:49.049 1031 1031 F libc : failed to wait for crash_dump helper: No child processes 08-24 14:58:50.272 803 803 F libc : crash_dump helper failed to exec, or was killed --------- beginning of main 08-24 14:58:54.034 30449 30449 W libc : Access denied finding property "persist.vendor.sys.activitylog" 08-24 14:58:54.051 1212 1212 I libc : Requested dump for pid 1212 (composer-servic) 08-24 14:58:54.103 30449 30449 W libc : Access denied finding property "ro.odm.prev.product.name" 08-24 14:58:54.424 30520 30520 W libc : Access denied finding property "persist.vendor.sys.activitylog" `

Версия mapkit 4.7.0-beta

zombie6888 commented 2 months ago

Выяснил что краши происходят если добавлять метки с кастомным view, у которого в разметке есть картинка networkImage или AssetImage:

for (final location in locations) {
      clusterizedCollection.addPlacemarkWithView(
          location,
          ViewProvider(
              builder: () => SizedBox(
                  width: 40,
                  height: 40,
                  child: Image.asset('assets/ic_circle.png')),
              configurationFactory: (data) => ViewConfiguration(
                  physicalConstraints: BoxConstraints.tight(data.size),
                  logicalConstraints: BoxConstraints.tight(data.size),
                  devicePixelRatio: data.devicePixelRatio)));
    }

    clusterizedCollection.clusterPlacemarks(
      clusterRadius: _clusterRadius,
      minZoom: _clusterMinZoom,
    );

yandex_bug

Прилагаю пример, по сути немного измененный пример из map_objects с репозитория mapkit-samples Для воспроизведения обычно достаточно сделать зум до минимума и немного подвигать картой или просто понажимать zoomIn/zoomOut:

map_objects.zip

nukeolay commented 2 months ago

Выяснил что краши происходят если добавлять метки с кастомным view, у которого в разметке есть картинка networkImage или AssetImage:

У меня проблема воспроизводится не только с NetworkImage или AssetImage, а с любыми пинами, если их достаточно много. Вот так, например, просто с синими квадратами, при чем там все что только можно const:

void _addClusterizedPlacemarks(
    mapkit.ClusterizedPlacemarkCollection clusterizedCollection,
  ) {
    const constraints = BoxConstraints(
      maxHeight: 40,
      maxWidth: 40,
      minHeight: 40,
      minWidth: 40,
    );
    final view = ViewProvider(
      id: 'my_id',
      builder: () {
        return const SizedBox(
          width: 40,
          height: 40,
          child: ColoredBox(color: Colors.blue),
        );
      },
      configurationFactory: (data) => const ViewConfiguration(
        physicalConstraints: constraints,
        logicalConstraints: constraints,
      ),
      cacheable: true,
    );
    for (final location in locations) {
      clusterizedCollection.addPlacemarkWithView(
        location,
        view,
      );
    }

    clusterizedCollection.clusterPlacemarks(
      clusterRadius: _clusterRadius,
      minZoom: _clusterMinZoom,
    );
  }
nukeolay commented 1 month ago

В версии 4.7.2-beta6 вот такие ошибки сыпятся как раз перед крашем

════════ Exception caught by widgets library ═══════════════════════════════════
The following NativeNullException was thrown building MapCluster(dirty):
access to deleted native object.

The relevant error-causing widget was:
    MapCluster MapCluster:file:///Users/marioboy/development/doctis/temp/mapkit-flutter-demo/mapkit-samples/map_objects_new/lib/main.dart:73:28

When the exception was thrown, this was the stack:
#0      checkCallResult (package:yandex_maps_mapkit_lite/src/bindings/common/exception.dart:52:5)
exception.dart:52
#1      ClusterImpl.placemarks (package:yandex_maps_mapkit_lite/src/mapkit/map/cluster.impl.dart:53:15)
cluster.impl.dart:53
#2      MapCluster.build (package:map_objects/widgets/map_cluster.dart:14:27)
map_cluster.dart:14
#3      StatelessElement.build (package:flutter/src/widgets/framework.dart:5687:49)
framework.dart:5687
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5617:15)
framework.dart:5617
#5      Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
framework.dart:5333
#6      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:5599:5)
framework.dart:5599
#7      ComponentElement.mount (package:flutter/src/widgets/framework.dart:5593:5)
framework.dart:5593
...     Normal element mounting (19 frames)
#26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4468:16)
framework.dart:4468
#27     Element.updateChild (package:flutter/src/widgets/framework.dart:3963:18)
framework.dart:3963
#28     RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/adapter.dart:143:16)
adapter.dart:143
#29     RenderObjectToWidgetElement.mount (package:flutter/src/widgets/adapter.dart:112:5)
adapter.dart:112
#30     RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/adapter.dart:61:18)
adapter.dart:61
#31     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3038:19)
framework.dart:3038
#32     RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/adapter.dart:60:13)
adapter.dart:60
#33     ViewProvider._drawWidget (package:yandex_maps_mapkit_lite/src/bindings/ui_view/view_provider.dart:64:7)
view_provider.dart:64
<asynchronous suspension>
#34     ImageProviderHeap._getImageProviderResult (package:yandex_maps_mapkit_lite/src/bindings/image/image_provider.dart:82:19)
image_provider.dart:82
<asynchronous suspension>
#35     ImageProviderHeap.requestData.<anonymous closure> (package:yandex_maps_mapkit_lite/src/bindings/image/image_provider.dart:94:15)
image_provider.dart:94
<asynchronous suspension>