代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lwip 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0d5070b4a40912a7921e0101461a9c7d61919acd Mon Sep 17 00:00:00 2001
From: HuangLiming <huangliming5@huawei.com>
Date: Tue, 25 May 2021 03:08:33 -0400
Subject: [PATCH] fix the occasional coredump when the lwip exits
Signed-off-by: HuangLiming <huangliming5@huawei.com>
---
src/api/sockets.c | 37 +++++++++----------------------------
1 file changed, 9 insertions(+), 28 deletions(-)
diff --git a/src/api/sockets.c b/src/api/sockets.c
index d62e55b..658f762 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -4655,36 +4655,17 @@ void lwip_sock_init(void)
return;
}
-//modify from lwip_close
void lwip_exit(void)
{
- int i, is_tcp;
- struct lwip_sock *sock;
-
- if (memp_pools[MEMP_SYS_MBOX] == NULL) {
- return;
- }
-
- for (i = 0; i < sockets_num; i++) {
- sock = &sockets[i];
- if (!sock->conn)
- continue;
-#if LWIP_IGMP
- /* drop all possibly joined IGMP memberships */
- lwip_socket_drop_registered_memberships(i);
-#endif /* LWIP_IGMP */
- /*
- * process is exiting, call netconn_delete to
- * close tcp connection, and ignore the return value
- */
- is_tcp = NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP;
- netconn_delete(sock->conn);
- free_socket(sock, is_tcp);
- }
-
- free(sockets);
- sockets = NULL;
- sockets_num = 0;
+ /*
+ * LwIP has the following two parts of memory application, but
+ * it is unnecessary to release all memory in sequentially,
+ * which increases complexity. Therefore, we rely on the process
+ * reclamation mechanism of the system to release memory.
+ * 1. a sockets table of the process.
+ * 2. a batch of hugepage memory of each thread.
+ */
+ return;
}
#endif /* USE_LIBOS */
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。