!9 [sync] PR-7: 修复lstack反复建立连接触发的coredump

From: @openeuler-sync-bot 
Reviewed-by: @wu-changsheng 
Signed-off-by: @wu-changsheng
This commit is contained in:
openeuler-ci-bot 2022-03-17 08:26:14 +00:00 committed by Gitee
commit dd27a20773
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From 35c5052da432255f3756d5bdc46c67597545908a Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng12@huawei.com>
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

View File

@ -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 <jiangheng12@huawei.com> - 1.0.1-4
- fix repeatede stack restart coredump
* Wed Mar 16 2022 jiangheng <jiangheng12@huawei.com> - 1.0.1-3
- fix gazelle test issue