1 Star 0 Fork 35

hd_zhoujie/criu

forked from src-openEuler/criu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0056-detach-don-t-kill-task-when-ptrace-PTRACE_DETACH-ret.patch 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
river 提交于 2022-04-13 15:05 . criu: backport kinds of features/bugfix
From 389a410ddfbca241bf724a4e4751fa96499ff6f1 Mon Sep 17 00:00:00 2001
From: "fu.lin" <fulin10@huawei.com>
Date: Thu, 30 Dec 2021 10:45:16 +0800
Subject: [PATCH 56/72] detach: don't kill task when `ptrace(PTRACE_DETACH)`
return ESRCH
Conflict:NA
Reference:https://gitee.com/src-openeuler/criu/pulls/26
Signed-off-by: fu.lin <fulin10@huawei.com>
---
criu/cr-restore.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 13f0a93..c3ff65d 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -2317,6 +2317,16 @@ static int finalize_restore_detach(void)
return -1;
}
if (ptrace(PTRACE_DETACH, pid, NULL, 0)) {
+ /*
+ * There is delta between task resume and
+ * `ptrace(PTRACE_DETACH)`, task maybe exit
+ * initiative during this time.
+ */
+ if (errno == ESRCH) {
+ pr_warn("Unable to detach %d, task has dead\n", pid);
+ continue;
+ }
+
pr_perror("Unable to detach %d", pid);
return -1;
}
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hd-zhoujie/criu.git
git@gitee.com:hd-zhoujie/criu.git
hd-zhoujie
criu
criu
master

搜索帮助