HarmonyOS 鸿蒙Next-APP偶尔闪退且错误日志无arkts错误位置排查方法

发布于 1周前 作者 itying888 来自 鸿蒙OS

HarmonyOS 鸿蒙Next-APP偶尔闪退且错误日志无arkts错误位置排查方法
Device info: HUAWEI Mate 60
Build info: BRA-AL00 5.0.0.123(C00E120R8P24)
Fingerprint: 26b1bab6f13f041ce0effdce920b339b0c7e4e56944968112959af1aa19bc81c
Module name: com.package.xxx
Version: 1.0.0
VersionCode: 1000000
PreInstalled: No
Foreground: Yes
Timestamp: 2025-01-16 18:17:17.808
Pid: 24500
Uid: 20020186
Process name: com.package.xxx
Process life time: 37s
Reason: Signal: SIGSEGV(SEGV_MAPERR)@0x0000005d00000007

Fault thread info:
Tid: 24500, Name: com.package.xxx

#00 pc 00000000009cea3c /system/lib64/platformsdk/libace_compatible.z.so(std::__h::__list_imp<OHOS::Ace::RefPtr<OHOS::Ace::GestureSnapshot>, std::__h::allocator<OHOS::Ace::RefPtr<OHOS::Ace::GestureSnapshot>>>::clear()+80)(f3df716e2661e1da7456d39d68744d3d)
#01 pc 00000000009ce8bc /system/lib64/platformsdk/libace_compatible.z.so(f3df716e2661e1da7456d39d68744d3d)
#02 pc 00000000009ce510 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::EventTreeRecord::AddTouchPoint(OHOS::Ace::TouchEvent const&)+444)(f3df716e2661e1da7456d39d68744d3d)
#03 pc 0000000000b662f0 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::PipelineContext::OnTouchEvent(OHOS::Ace::TouchEvent const&, OHOS::Ace::RefPtr<OHOS::Ace::NG::FrameNode> const&, bool)+940)(f3df716e2661e1da7456d39d68744d3d)
#04 pc 0000000000e3993c /system/lib64/platformsdk/libace_compatible.z.so(f3df716e2661e1da7456d39d68744d3d)
#05 pc 00000000009ca368 /system/lib64/platformsdk/libace_compatible.z.so(f3df716e2661e1da7456d39d68744d3d)
#06 pc 0000000000e3b094 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::UIContentImpl::ProcessPointerEvent(std::__h::shared_ptr<OHOS::MMI::PointerEvent> const&)+720)(f3df716e2661e1da7456d39d68744d3d)
#07 pc 0000000000192548 /system/lib64/libwm.z.so(OHOS::Rosen::WindowSessionImpl::NotifyPointerEvent(std::__h::shared_ptr<OHOS::MMI::PointerEvent> const&)+1488)(09814bcffa52797acd132d04ad37fb44)
#08 pc 0000000000175dc0 /system/lib64/libwm.z.so(OHOS::Rosen::WindowSceneSessionImpl::ConsumePointerEventInner(std::__h::shared_ptr<OHOS::MMI::PointerEvent> const&, OHOS::MMI::PointerEvent::PointerItem&)+848)(09814bcffa52797acd132d04ad37fb44)
#09 pc 0000000000154744 /system/lib64/libwm.z.so(OHOS::Rosen::WindowSceneSessionImpl::ConsumePointerEvent(std::__h::shared_ptr<OHOS::MMI::PointerEvent> const&)+932)(09814bcffa52797acd132d04ad37fb44)
#10 pc 0000000000131c1c /system/lib64/libwm.z.so(OHOS::Rosen::WindowInputChannel::HandlePointerEvent(std::__h::shared_ptr<OHOS::MMI::PointerEvent>&)+1172)(09814bcffa52797acd132d04ad37fb44)
#11 pc 00000000000c1df4 /system/lib64/libwm.z.so(OHOS::Rosen::InputEventListener::OnInputEvent(std::__h::shared_ptr<OHOS::MMI::PointerEvent>) const+756)(09814bcffa52797acd132d04ad37fb44)
#12 pc 000000000008d900 /system/lib64/platformsdk/libmmi-client.z.so(OHOS::MMI::InputManagerImpl::OnPointerEventTask(std::__h::shared_ptr<OHOS::MMI::IInputEventConsumer>, std::__h::shared_ptr<OHOS::MMI::PointerEvent>)+316)(a55309c26e72b3917352d625b94e7f7d)
#13 pc 00000000000a24ac /system/lib64/platformsdk/libmmi-client.z.so(a55309c26e72b3917352d625b94e7f7d)
#14 pc 000000000001bdb4 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::EventHandler::DistributeEvent(std::__h::unique_ptr<OHOS::AppExecFwk::InnerEvent, void (*)(OHOS::AppExecFwk::InnerEvent*)> const&)+1140)(39fa3015ce2376f3bd1feb7359bd12b9)
#15 pc 000000000002d6a8 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::(anonymous namespace)::EventRunnerImpl::ExecuteEventHandler(std::__h::unique_ptr<OHOS::AppExecFwk::InnerEvent, void (*)(OHOS::AppExecFwk::InnerEvent*)>&)+348)(39fa3015ce2376f3bd1feb7359bd12b9)
#16 pc 000000000002cf64 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::(anonymous namespace)::EventRunnerImpl::Run()+908)(39fa3015ce2376f3bd1feb7359bd12b9)
#17 pc 0000000000030308 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::EventRunner::Run()+528)(39fa3015ce2376f3bd1feb7359bd12b9)
#18 pc 00000000000b26d8 /system/lib64/platformsdk/libappkit_native.z.so(OHOS::AppExecFwk::MainThread::Start()+400)(6f1e34732fcad33888b508e50f454692)
#19 pc 0000000000004e34 /system/lib64/appspawn/appspawn/libappspawn_ace.z.so(RunChildProcessor(AppSpawnContent*, AppSpawnClient*)+568)(d3f6e56ad6a96018b92b82ae93f9f1a7)
#20 pc 000000000000c00c /system/bin/appspawn(AppSpawnChild+576)(5aadd3400b0e530793ccf95daf023fcb)
#21 pc 0000000000015ef4 /system/bin/appspawn(ProcessSpawnReqMsg+3180)(5aadd3400b0e530793ccf95daf023fcb)
#22 pc 0000000000013b38 /system/bin/appspawn(OnReceiveRequest+132)(5aadd3400b0e530793ccf95daf023fcb)
#23 pc 0000000000016dcc /system/lib64/chipset-pub-sdk/libbegetutil.z.so(HandleRecvMsg_+344)(6807ec574aea93e64c71ccb52611b50d)
#24 pc 00000000000168a0 /system/lib64/chipset-pub-sdk/libbegetutil.z.so(HandleStreamEvent_+192)(6807ec574aea93e64c71ccb52611b50d)
#25 pc 0000000000013f80 /system/lib64/chipset-pub-sdk/libbegetutil.z.so(ProcessEvent+88)(6807ec574aea93e64c71ccb52611b50d)
#26 pc 0000000000013b3c /system/lib64/chipset-pub-sdk/libbegetutil.z.so(RunLoop_+308)(6807ec574aea93e64c71ccb52611b50d)
#27 pc 0000000000011958 /system/bin/appspawn(AppSpawnRun+212)(5aadd3400b0e530793ccf95daf023fcb)
#28 pc 000000000000f278 /system/bin/appspawn(main+764)(5aadd3400b0e530793ccf95daf023fcb)
#29 pc 00000000000a1344 /system/lib/ld-musl-aarch64.so.1(libc_start_main_stage2+64)(e9ff207f4340aee156e36fdd8af0ab22)

========SubmitterStacktrace========

#00 pc 000000000001345c /system/lib64/platformsdk/libuv.so(uv_timer_start+128)(25c5e130ae25e495771607adc70da044)
#01 pc 0000000000013af4 /system/lib64/platformsdk/libuv.so(uv__run_timers+136)(25c5e130ae25e495771607adc70da044)
#02 pc 0000000000017314 /system/lib64/platformsdk/libuv.so(uv_run+272)(25c5e130ae25e495771607adc70da044)
#03 pc 000000000007e594 /system/lib64/platformsdk/libruntime.z.so(OHOS::AbilityRuntime::OHOSLoopHandler::OnTriggered()+144)(76aa5e000df1957398cf99aee358ef14)
#04 pc 000000000007eb40 /system/lib64/platformsdk/libruntime.z.so(std::__h::__function::__func<OHOS::AbilityRuntime::OHOSLoopHandler::OnTriggered()::$_0, std::__h::allocator<OHOS::AbilityRuntime::OHOSLoopHandler::OnTriggered()::$_0>, void ()>::operator()() (.9efded9864dc55830f61b3b92d59beab)+56)(76aa5e000df1957398cf99aee358ef14)
#05 pc 000000000001bdb8 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::EventHandler::DistributeEvent(std::__h::unique_ptr<OHOS::AppExecFwk::InnerEvent, void (*)(OHOS::AppExecFwk::InnerEvent*)> const&)+1144)(39fa3015ce2376f3bd1feb7359bd12b9)
#06 pc 000000000002d6ac /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::(anonymous namespace)::EventRunnerImpl::ExecuteEventHandler(std::__h::unique_ptr<OHOS::AppExecFwk::InnerEvent, void (*)(OHOS::AppExecFwk::InnerEvent*)>&)+352)(39fa3015ce2376f3bd1feb7359bd12b9)
#07 pc 000000000002cf68 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::(anonymous namespace)::EventRunnerImpl::Run()+912)(39fa3015ce2376f3bd1feb7359bd12b9)
#08 pc 000000000003030c /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::EventRunner::Run()+532)(39fa3015ce2376f3bd1feb7359bd12b9)
#09 pc 00000000000b26dc /system/lib64/platformsdk/libappkit_native.z.so(OHOS::AppExecFwk::MainThread::Start()+404)(6f1e34732fcad33888b508e50f454692)
#10 pc 0000000000004e38 /system/lib64/appspawn/appspawn/libappspawn_ace.z.so(RunChildProcessor(AppSpawnContent*, AppSpawnClient*)+572)(d3f6e56ad6a96018b92b82ae93f9f1a7)
#11 pc 000000000000c010 /system/bin/appspawn(AppSpawnChild+580)(5aadd3400b0e530793ccf95daf023fcb)
#12 pc 0000000000015ef8 /system/bin/appspawn(ProcessSpawnReqMsg+3184)(5aadd3400b0e530793ccf95daf023fcb)
#13 pc 0000000000013b3c /system/bin/appspawn(OnReceiveRequest+136)(5aadd3400b0e530793ccf95daf023fcb)

Registers:

x0: 0000005b2d802e00 x1: 0000005bc5324508 x2: 0000000000000050 x3: 000000000000000a
x4: 0000005bc5324558 x5: 0000005bc53245a8 x6: 0000005cd0cb3780 x7: 0000005cefd07d00
x8: 0000005bc5324160 x9: 0000005bc5324158 x10: 6b6b000000000000 x11: 00000000329ea560
x12: 0000005b2d803158 x13: 0000005cedbe6100 x14: 0000005ce2d2b280 x15: 0000000000000000
x16: 0000005b2e5b4e80 x17: 0000005b2d20213c x18: ffff000000000006 x19: 0000005cebf45fa8
x20: 0000005cffffffff x21: 0000005cedb895f0 x22: 0000005bbd1ddd84 x23: 0000005cffffffff
x24: 0000000000000000 x25: 0000007fe245c4f8 x26: 0000007fe245cee0 x27: 0000007fe245cee8
x28: 0000005bc57e7568 x29: 0000007fe245c480

lr: 0000005bbd44eaac sp: 0000007fe245c480 pc: 0000005bbd44ea3c

Other thread info:
Tid: 24549, Name: OS_IPC_0_24549

更多关于HarmonyOS 鸿蒙Next-APP偶尔闪退且错误日志无arkts错误位置排查方法的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复

楼主的项目是否使用了NDK开发,还是纯ArkTs原生开发呢?NDK开发可以参考CppCrash故障定位直接找到有问题的代码行号。若是原生开发,大概率是组件使用导致的问题。

CppCrash日志的信号为SIGSEGV(SEGV_MAPERR),表示试图访问未分配给自己的内存,或试图往没有写权限的内存地址写数据。根据日志中报错的栈顶函数判断,可能是页面中的Gesture使用引发的问题,可以重点排查使用了Gesture的地方。

若排查Gesture还是无法定位问题代码,可以使用代码二分法定位到具体页面的具体代码块(删除一半页面如果还可以复现,就代表造成闪退的根因在剩下的代码中,删到最小的可复现demo为止)。

更多关于HarmonyOS 鸿蒙Next-APP偶尔闪退且错误日志无arkts错误位置排查方法的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


cke_152.png

纯ArkTs原生开发的,触发异常的页面,涉及Gesture的地方的地方只有底部的一个卡片view,卡片上面是百度地图的view

针对HarmonyOS(鸿蒙)Next-APP偶尔闪退且错误日志无arkts错误位置的问题,排查方法如下:

  1. 检查系统日志:

    • 虽然错误日志未显示arkts错误,但仍需详细检查系统日志,特别是与APP崩溃相关的条目。这有助于定位问题是否由系统级错误或资源不足引起。
  2. 内存与资源监控:

    • 使用鸿蒙提供的开发者工具监控APP运行时的内存和资源使用情况。闪退可能是由于内存泄漏、资源耗尽等原因导致。
  3. 第三方库与依赖:

    • 检查APP使用的第三方库和依赖项是否稳定且与鸿蒙系统兼容。不稳定的库或存在已知漏洞的组件可能导致APP崩溃。
  4. 代码审查:

    • 对APP代码进行彻底审查,特别是那些涉及多线程操作、复杂数据处理或频繁内存分配的部分。这些区域往往是潜在崩溃点的所在。
  5. 模拟器和真机测试:

    • 在不同配置的鸿蒙设备上测试APP,包括模拟器和真机。这有助于确定问题是否与特定硬件或系统配置相关。
  6. 更新鸿蒙SDK:

    • 确保使用的鸿蒙SDK为最新版本。鸿蒙系统的更新可能修复了旧版本中的已知问题。

如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html

回到顶部