1 Star 0 Fork 32

yc555/gazelle_1

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0271-fix-the-coredump-when-gazellectl-l.patch 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
yc555 提交于 2024-10-11 13:30 . fix the coredump when gazellectl -l
From 577698e8a9a44d5689a7608e7bfbe27ed6529a54 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Fri, 11 Oct 2024 10:48:03 +0800
Subject: [PATCH] fix the coredump when gazellectl -l
---
src/lstack/core/lstack_stack_stat.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lstack/core/lstack_stack_stat.c b/src/lstack/core/lstack_stack_stat.c
index 8efa5ab..c88da8f 100644
--- a/src/lstack/core/lstack_stack_stat.c
+++ b/src/lstack/core/lstack_stack_stat.c
@@ -64,7 +64,7 @@ void time_stamp_record(int fd, struct pbuf *pbuf)
{
struct lwip_sock *sock = lwip_get_socket(fd);
- if (get_protocol_stack_group()->latency_start && sock && pbuf) {
+ if (get_protocol_stack_group()->latency_start && sock && sock->stack && pbuf) {
calculate_lstack_latency(&sock->stack->latency, pbuf, GAZELLE_LATENCY_INTO_MBOX, 0);
time_stamp_into_recvmbox(sock);
}
@@ -122,6 +122,10 @@ void calculate_lstack_latency(struct gazelle_stack_latency *stack_latency, const
}
lt = &pbuf_to_private(pbuf)->lt;
+ if (lt == NULL) {
+ return;
+ }
+
lt_type = (type / GAZELLE_LATENCY_READ_MAX) ? GAZELLE_LATENCY_WR : GAZELLE_LATENCY_RD;
if (lt->stamp != ~(lt->check) || lt->stamp < stack_latency->start_time || lt_type != lt->type) {
return;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangchen555/gazelle_1.git
git@gitee.com:yangchen555/gazelle_1.git
yangchen555
gazelle_1
gazelle_1
master

搜索帮助