From 2dd91a8fa0658c8c8e3e843a5b31adba1ee2941f Mon Sep 17 00:00:00 2001 From: wanghaoxu Date: Tue, 8 Nov 2022 07:33:28 +0000 Subject: [PATCH] add log for ipc crash problem Signed-off-by: wanghaoxu --- frameworks/liteipc_linux/src/liteipc_adapter.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frameworks/liteipc_linux/src/liteipc_adapter.c b/frameworks/liteipc_linux/src/liteipc_adapter.c index 3141362..474527d 100644 --- a/frameworks/liteipc_linux/src/liteipc_adapter.c +++ b/frameworks/liteipc_linux/src/liteipc_adapter.c @@ -398,13 +398,22 @@ static bool IsValidCB(IpcMsg* ipcMsg) static void HandleSpawnLooper(const IpcContext *context, const struct FuncPair *funcPair) { pthread_t thread; + LOG(ERROR, "enter handlespawnlooper funcpair is %p", funcPair); struct BinderThreadDesc *btd = (struct BinderThreadDesc *)malloc(sizeof(struct BinderThreadDesc)); + LOG(ERROR, "malloc finished! btd is %p", btd); if (btd == NULL) { return; } btd->context = context; - btd->func = funcPair->func; - btd->argv = funcPair->argv; + if (funcPair != NULL) { + btd->func = funcPair->func; + btd->argv = funcPair->argv; + } else { + LOG(ERROR, "funcPair is NULL!"); + btd->func = NULL; + btd->argv = NULL; + } + int ret = pthread_create(&thread, NULL, BinderThreadRoutine, btd); if (ret != 0) { free(btd); -- Gitee