HarmonyOS napi_call_threadsafe_function 调用第二次crash

1. c++ 函数a中创建一个threadsafe_function

2. 函数a中会注册一个函数指针b到业务函数c

3. 在业务函数c另一个线程会执行函数指针b

4. 函数指针b中调用napi_call_threadsafe_function执行ts线程安全逻辑

报错日志如下:

Reason:Signal:SIGSEGV(SEGV_MAPERR)@0x006b6bxxxx6b 
Fault thread info: 
  Tid:22405, Name:urpc_adapter 
#00 pc 000000000005b344 /system/lib64/platformsdk/libace_napi.z.so(napi_call_threadsafe_function+36)(7f0c1fadabfe32b5c5cbbbefe0f1bae3) 
#01 pc 00000000000095a4 /system/lib64/module/hms/collaboration/liburpc.z.so(8ac3b3941622f74f380e66eb5e3edf18) 
#02 pc 00000000000095a4 /system/lib64/module/hms/collaboration/liburpc.z.so(8ac3b3941622f74f380e66eb5e3edf18) 
#03 pc 0000000000009390 /system/lib64/module/hms/collaboration/liburpc.z.so(8ac3b3941622f74f380e66eb5e3edf18) 
#04 pc 0000000000014634 /system/lib64/liburpc_core.z.so(RpcOnRecieved.cfi+3856)(ed600315ee71d03162b84bb87a0b5b0c) 
#05 pc 0000000000020d98 /system/lib64/liburpc_core.z.so(UrpcUrmaMainFunc.cfi+868)(ed600315ee71d03162b84bb87a0b5b0c) 
#06 pc 00000000001b3898 /system/lib/ld-musl-aarch64.so.1(start+236)(1a4668e91531ac9bda2a6ac4b3084cac) 
Registers: 
  x0:6b6b6xxx6b6b6b x1:6b6xxx6b6b6b6b x2:0000000000000000 x3:0000000000000003 
x4:000000000000002a x5:000000000000001b x6:0000000000008080 x7:feff686067666d60 
x8:72d8ac4fde9d0040 x9:72d8ac4fde9d0040 x10:0000000000000000 x11:0000000000000055 
x12:0000000000000001 x13:000000000d5f1c3a x14:000000c896ec1e6c x15:32dbe099a482814f 
x16:000000557e3d3670 x17:0000007f9785b320 x18:0000000000000005 x19:000000557e3d5b60 
x20:000000557d4ad650 x21:000000557e3c2c63 x22:000000557e3c2e8c x23:000000557e3c0288 
x24:000000557d814a00 x25:0000000000000140 x26:0000000000000000 x27:000000557ed1b680 
x28:000000557d4ad878 x29:000000557d4ad620 
lr:000000557e3c95a8 sp:000000557d4ad600 pc:0000007f9785b344
HarmonyOS
2024-08-23 09:31:41
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
zxjiu

执行napi_call_threadsafe_function等于说是跳转到执行业务函数c,在这之前报错,看第二次的时候 napi_call_threadsafe_function 这个函数的几个参数是否有错误。

分享
微博
QQ
微信
回复
2024-08-23 14:52:05
相关问题
HarmonyOS调用napi_call_function方法时崩溃
618浏览 • 1回复 待解决
undefined symbol napi_create_threadsafe_function
4472浏览 • 1回复 待解决
HarmonyOS cocos引擎能否二次启动
355浏览 • 1回复 待解决
class二次刷新渲染数组
736浏览 • 1回复 待解决
实现二次侧滑退出应用
1830浏览 • 1回复 待解决
华为账号实时验证/二次放号相关咨询
1732浏览 • 1回复 待解决