HarmonyOS 鸿蒙Next 子线程taskwork使用drawing.Canvas绘制image.PixelMap异常崩溃 Reason: Signal: SIGSEGV(SEGV_MAPERR)@0x0064000000000010
HarmonyOS 鸿蒙Next 子线程taskwork使用drawing.Canvas绘制image.PixelMap异常崩溃 Reason: Signal: SIGSEGV(SEGV_MAPERR)@0x0064000000000010
Device info:HUAWEI Mate X5
Build info:ALT-AL10 5.0.0.102(SP8C00E73R6P17log)
Fingerprint:4b7349195102885e6000ba885dd25d0f83e52ca249b1e494d3db8ddb9bac73de
Module name:com.midea.connect.hm.sit
Version:1.0.0.241030004
VersionCode:241030004
PreInstalled:No
Foreground:Yes
Timestamp:2024-11-21 17:25:13.845
Pid:63395
Uid:20020001
Process name:com.midea.connect.hm.sit
Process life time:480s
Reason:Signal:SIGSEGV(SEGV_MAPERR)@0x0064000000000010
Fault thread info:
Tid:1404, Name:OS_TaskWorker
#00 pc 00000000000cb3f8 /system/lib64/lib2d_graphics.z.so(OHOS::Rosen::Drawing::SkiaCanvas::DrawTextBlob(OHOS::Rosen::Drawing::TextBlob const*, float, float, OHOS::Rosen::Drawing::Paint const&)+88)(6199e58d809828f84034694349af7c82)
#01 pc 00000000000b8454 /system/lib64/lib2d_graphics.z.so(OHOS::Rosen::Drawing::CoreCanvas::DrawTextBlob(OHOS::Rosen::Drawing::TextBlob const*, float, float)+372)(6199e58d809828f84034694349af7c82)
#02 pc 000000000002dfe8 /system/lib64/platformsdk/libdrawing_napi_impl.z.so(OHOS::Rosen::Drawing::JsCanvas::OnDrawText(napi_env__, napi_callback_info__)+236)(1259a2fc7f182323abd1ce80edd408e3)
#03 pc 000000000002dec4 /system/lib64/platformsdk/libdrawing_napi_impl.z.so(OHOS::Rosen::Drawing::JsCanvas::DrawText(napi_env__, napi_callback_info__)+120)(1259a2fc7f182323abd1ce80edd408e3)
#04 pc 000000000003bff8 /system/lib64/platformsdk/libace_napi.z.so(panda::JSValueRef ArkNativeFunctionCallBack<true>(panda::JsiRuntimeCallInfo*)+216)(e14950c654205757a26744aaff615d4e)
#05 pc 0000000000332130 /system/lib64/module/arkcompiler/stub.an(RTStub_PushCallArgsAndDispatchNative+40)
#06 at generaTextImage (features/commonUI/avatar/src/main/ets/AvatarUtils/AvatarCommonUtil.ets:105:11)
#07 at customGetImg (features/commonUI/avatar/src/main/ets/AvatarComponent.ets:165:14)
#08 at getImageArrayBuffer (oh_modules/.ohpm/@ohos+imageknife@3.0.3/oh_modules/@ohos/imageknife/src/main/ets/ImageKnifeLoader.ets:221:26)
#09 at requestJob (oh_modules/.ohpm/@ohos+imageknife@3.0.3/oh_modules/@ohos/imageknife/src/main/ets/ImageKnifeDispatcher.ets:405:20)
#10 pc 00000000003278a8 /system/lib64/platformsdk/libark_jsruntime.so(panda::ecmascript::InterpreterAssembly::Execute(panda::ecmascript::EcmaRuntimeCallInfo*)+216)(63c6ed6518fd7e93e66407f4d66095fc)
#11 pc 00000000004ff800 /system/lib64/platformsdk/libark_jsruntime.so(panda::FunctionRef::CallForNapi(panda::ecmascript::EcmaVM const*, panda::JSValueRef*, panda::JSValueRef* const*, int)+336)(63c6ed6518fd7e93e66407f4d66095fc)
#12 pc 00000000000582f4 /system/lib64/platformsdk/libace_napi.z.so(napi_call_function+308)(e14950c654205757a26744aaff615d4e)
#13 pc 0000000000036230 /system/lib64/module/libtaskpool.z.so(Commonlibrary::Concurrent::TaskPoolModule::Worker::PerformTask(uv_async_s const*) (.cfi)+1604)(05e877f6a2645010a68eadbcffa202c8)
#14 pc 0000000000016868 /system/lib64/platformsdk/libuv.so(uv__async_io+340)(6149b8d1328bd0502c0c830d4fa6768c)
#15 pc 0000000000027fd8 /system/lib64/platformsdk/libuv.so(uv__io_poll+1016)(6149b8d1328bd0502c0c830d4fa6768c)
#16 pc 0000000000016e40 /system/lib64/platformsdk/libuv.so(uv_run+396)(6149b8d1328bd0502c0c830d4fa6768c)
#17 pc 000000000003589c /system/lib64/module/libtaskpool.z.so(Commonlibrary::Concurrent::TaskPoolModule::Worker::ExecuteInThread(void const*) (.cfi)+948)(05e877f6a2645010a68eadbcffa202c8)
#18 pc 00000000000311a0 /system/lib64/module/libtaskpool.z.so(Commonlibrary::Concurrent::TaskPoolModule::TaskRunner::TaskInnerRunner::Run()+68)(05e877f6a2645010a68eadbcffa202c8)
#19 pc 00000000001ba2d4 /system/lib/ld-musl-aarch64.so.1(start+236)(2869c16473050fa2addbe1ee1a3d23c3)
========SubmitterStacktrace========
#00 pc 0000000000012a78 /system/lib64/platformsdk/libuv.so(uv_queue_work+88)(6149b8d1328bd0502c0c830d4fa6768c)
#01 pc 0000000000063814 /system/lib64/platformsdk/libace_napi.z.so(NativeAsyncWork::Queue()+260)(e14950c654205757a26744aaff615d4e)
#02 pc 000000000006b5d0 /system/lib64/platformsdk/libace_napi.z.so(napi_queue_async_work+32)(e14950c654205757a26744aaff615d4e)
#03 pc 000000000009bec8 /system/lib64/platformsdk/libimage_napi.z.so(OHOS::Media::ImageSourceNapi::Release(napi_env__, napi_callback_info__) (.cfi)+908)(97d30952131e8317bfa35587cac1a40a)
#04 pc 000000000003bffc /system/lib64/platformsdk/libace_napi.z.so(panda::JSValueRef ArkNativeFunctionCallBack<true>(panda::JsiRuntimeCallInfo*)+220)(e14950c654205757a26744aaff615d4e)
#05 pc 0000000000332134 /system/lib64/module/arkcompiler/stub.an(RTStub_PushCallArgsAndDispatchNative+44)
#06 pc 0000000000009f34 /system/lib64/module/arkcompiler/stub.an(BCStub_HandleCallthis0Imm8V8+308)
#07 pc ffffffa545fc0002 /system/lib64/module/arkcompiler/stub.an
Registers:
x0:0000005c025253b8 x1:0000005bce3d2b98 x2:0000005c0141a608 x3:0000005c157d6170
x4:0000000000000000 x5:0000000000000000 x6:000000000000000d x7:4043000000000000
x8:c264000000000000 x9:0000000000000000 x10:0000000000000000 x11:0000000000000001
x12:60000000000003fb x13:0000000000020000 x14:0000000000000000 x15:6be437e7eeff8a66
x16:0000005aa0c49ec8 x17:0000005aa0b3a4f0 x18:ffff000000000006 x19:0000005bd5592800
x20:0000005c0141a608 x21:0000005c025253b8 x22:0000005c0141a608 x23:0000000000000000
x24:0000000000000000 x25:0000005a1def5478 x26:0000002f7d845cb8 x27:0000005aa4ff8848
x28:0000005c157d6290 x29:0000005c157d5f30
lr:0000005aa0b38458 sp:0000005c157d5f10 pc:0000005aa0b4b3f8
Other thread info:
Tid:519, Name:OS_IPC_4_519
#00 pc 00000000001729fc /system/lib/ld-musl-aarch64.so.1(ioctl+176)(2869c16473050fa2addbe1ee1a3d23c3)
#01 pc 0000000000006f68 /system/lib64/chipset-pub-sdk/libipc_common.z.so(OHOS::BinderConnector::WriteBinder(unsigned long, void*)+104)(82b55bbcb95e0ab0a9221084940c97d6)
#02 pc 000000000005d580 /system/lib64/platformsdk/libipc_core.z.so(OHOS::BinderInvoker::TransactWithDriver(bool)+288)(fcd52a60c6d362e4da62013affba05d8)
#03 pc 000000000005d8bc /system/lib64/platformsdk/libipc_core.z.so(OHOS::BinderInvoker::StartWorkLoop()+60)(fcd52a60c6d362e4da62013affba05d8)
#04 pc 000000000005f648 /system/lib64/platformsdk/libipc_core.z.so(OHOS::BinderInvoker::JoinThread(bool)+80)(fcd52a60c6d362e4da62013affba05d8)
#05 pc 0000000000056444 /system/lib64/platformsdk/libipc_core.z.so(OHOS::IPCWorkThread::ThreadHandler(void*)+596)(fcd52a60c6d362e4da62013affba05d8)
#06 pc 00000000001ba2d4 /system/lib/ld-musl-aarch64.so.1(start+236)(2869c16473050fa2addbe1ee1a3d23c3)
Tid:1174, Name:OS_FFRT_3_54
#00 pc 00000000001b5b94 /system/lib/ld-musl-aarch64.so.1(__timedwait_cp+192)(2869c16473050fa2addbe1ee1a3d23c3)
#01 pc 00000000001b7b98 /system/lib/ld-musl-aarch64.so.1(__pthread_cond_timedwait+188)(2869c16473050fa2addbe1ee1a3d23c3)
#02 pc 00000000000c11c0 /system/lib64/libc++.so(std::__h::condition_variable::__do_timed_wait(std::__h::unique_lock<std::__h::mutex>&, std::__h::chrono::time_point<std::__h::chrono::system_clock, std::__h::chrono::duration<long long, std::__h::ratio<1l, 1000000000l>>>)+108)(dfedb06268d7f896c86362ced8e6c5c77e36a0da)
#03 pc 0000000000067fac /system/lib64/ndk/libffrt.so(ffrt::SCPUWorkerManager::WorkerIdleAction(ffrt::WorkerThread const*)+272)(cda5b088193b0140f6b9f9456296d828)
#04 pc 000000000005f7c4 /system/lib64/ndk/libffrt.so(ffrt::CPUWorker::WorkerLooperDefault(ffrt::WorkerThread*)+156)(cda5b088193b0140f6b9f9456296d828)
#05 pc 000000000005f294 /system/lib64/ndk/libffrt.so(ffrt::CPUWorker::Dispatch(ffrt::CPUWorker*)+152)(cda5b088193b0140f6b9f9456296d828)
#06 pc 000000000005f1e4 /system/lib64/ndk/libffrt.so(ffrt::CPUWorker::WrapDispatch(void*)+28)(cda5b088193b0140f6b9f9456296d828)
#07 pc 00000000001ba2d4 /system/lib/ld-musl-aarch64.so.1(start+236)(2869c16473050fa2addbe1ee1a3d23c3)
Tid:1200, Name:OS_FFRT_2_30
#00 pc 00000000001b5b94 /system/lib/ld-musl-aarch64.so.1(__timedwait_cp+192)(2869c16473050fa2addbe1ee1a3d23c3)
#01 pc 00000000001b7b98 /system/lib/ld-musl-aarch64.so.1(__pthread_cond_timedwait+188)(2869c16473050fa2addbe1ee1a3d23c3)
#02 pc 00000000000c11c0 /system/lib64/libc++.so(std::__h::condition_variable::__do_timed_wait(std::__h::unique_lock<std::__h::mutex>&, std::__h::chrono::time_point<std::__h::chrono::system_clock, std::__h::chrono::duration<long long, std::__h::ratio<1l, 1000000000l>>>)+108)(dfedb06268d7f896c86362ced8e6c5c77e36a0da)
#03 pc 0000000000067fac /system/lib64/ndk/libffrt.so(ffrt::SCPUWorkerManager::WorkerIdleAction(ffrt::WorkerThread const*)+272)(cda5b088193b0140f6b9f9456296d828)
#04 pc 000000000005f7c4 /system/lib64/ndk/libffrt.so(ffrt::CPUWorker::WorkerLooperDefault(ffrt::WorkerThread*)+156)(cda5b088193b0140f6b9f9456296d828)
#05 pc 000000000005f294 /system/lib64/ndk/libffrt.so(ffrt::CPUWorker::Dispatch(ffrt::CPUWorker*)+152)(cda5b088193b0140f6b9f9456296d828)
#06 pc 000000000005f1e4 /system/lib64/ndk/libffrt.so(ffrt::CPUWorker::WrapDispatch(void*)+28)(cda5b088193b0140f6b9f9456296d828)
#07 pc 00000000001ba2d4 /system/lib/ld-musl-aarch64.so.1(start+236)(2869c16473050fa2addbe1ee1a3d23c3)
针对您提到的HarmonyOS鸿蒙Next系统中,子线程使用drawing.Canvas
绘制image.PixelMap
时遇到的异常崩溃问题(Reason: Signal: SIGSEGV(SEGV_MAPERR)@0x0064000000000010),这通常是由于访问了无效的内存地址引起的。在鸿蒙系统中,UI绘制操作需要在主线程(UI线程)中进行,因为Canvas和PixelMap等UI相关资源通常与主线程的UI上下文绑定。
解决此问题的关键是确保所有的UI绘制操作都在主线程中执行。如果需要在子线程中处理图像数据,可以先在子线程中完成数据处理(如解码、滤镜应用等),然后将处理后的数据(如PixelMap)通过消息队列或其他线程间通信机制传递给主线程,由主线程负责最终的绘制操作。
此外,检查PixelMap对象是否在使用前已正确初始化且未被释放或损坏,也是避免此类崩溃的重要步骤。
如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html