From ab7f60f68ac3cbad42d13c50d23a43ce803e5ef8 Mon Sep 17 00:00:00 2001 From: jiangheng Date: Thu, 17 Mar 2022 16:16:40 +0800 Subject: [PATCH] fixrepeated lstack restart coredump (cherry picked from commit c8edeba1be55927598642d939461cf4dc7b16ef6) --- 0035-add-check-for-stack-params.patch | 27 +++++++++++++++++++++++++++ gazelle.spec | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 0035-add-check-for-stack-params.patch diff --git a/0035-add-check-for-stack-params.patch b/0035-add-check-for-stack-params.patch new file mode 100644 index 0000000..856954c --- /dev/null +++ b/0035-add-check-for-stack-params.patch @@ -0,0 +1,27 @@ +From 35c5052da432255f3756d5bdc46c67597545908a Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Thu, 17 Mar 2022 16:10:51 +0800 +Subject: [PATCH] add check for stack params + +--- + src/lstack/core/lstack_thread_rpc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/lstack/core/lstack_thread_rpc.c b/src/lstack/core/lstack_thread_rpc.c +index c95f2c0..2a67333 100644 +--- a/src/lstack/core/lstack_thread_rpc.c ++++ b/src/lstack/core/lstack_thread_rpc.c +@@ -29,6 +29,10 @@ struct rpc_msg *rpc_msg_alloc(struct protocol_stack *stack, rpc_msg_func func) + int32_t ret; + struct rpc_msg *msg = NULL; + ++ if (stack == NULL) { ++ return NULL; ++ } ++ + ret = rte_mempool_get(stack->rpc_pool, (void **)&msg); + if (ret < 0) { + get_protocol_stack_group()->call_alloc_fail++; +-- +1.8.3.1 + diff --git a/gazelle.spec b/gazelle.spec index f241133..df6b64b 100644 --- a/gazelle.spec +++ b/gazelle.spec @@ -2,7 +2,7 @@ Name: gazelle Version: 1.0.1 -Release: 3 +Release: 4 Summary: gazelle is a high performance user-mode stack License: Mulan PSL v2 URL: https://gitee.com/openeuler/gazelle @@ -49,6 +49,7 @@ Patch9031: 0031-fix-reuse-ip-listen-event-don-t-notice.patch Patch9032: 0032-modify-readme-to-add-constraint.patch Patch9033: 0033-fix-accept-check-remain-conn.patch Patch9034: 0034-fix-wakeup-list-dead-loop.patch +Patch9035: 0035-add-check-for-stack-params.patch %description %{name} is a high performance user-mode stack. @@ -89,6 +90,9 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b %config(noreplace) %{conf_path}/ltran.conf %changelog +* Thu Mar 17 2022 jiangheng - 1.0.1-4 +- fix repeatede stack restart coredump + * Wed Mar 16 2022 jiangheng - 1.0.1-3 - fix gazelle test issue