[CRIU] [PATCH] fault_inject: use SIGKILL instead of BUG() to kill itself

Andrei Vagin avagin at openvz.org
Thu Oct 12 21:44:54 MSK 2017


From: Andrei Vagin <avagin at virtuozzo.com>

If a process calls BUG(), it genereates a core file and
we get a false warning from abrtd.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/cr-dump.c    | 2 +-
 criu/cr-restore.c | 2 +-
 criu/files-reg.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index a5f38aad3..b6943f82f 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1379,7 +1379,7 @@ static int dump_one_task(struct pstree_item *item)
 
 	if (fault_injected(FI_DUMP_EARLY)) {
 		pr_info("fault: CRIU sudden detach\n");
-		BUG();
+		kill(getpid(), SIGKILL);
 	}
 
 	if (root_ns_mask & CLONE_NEWPID && root_item == item) {
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 18a373272..54d9da657 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1884,7 +1884,7 @@ static int restore_task_with_children(void *_arg)
 
 	if (fault_injected(FI_RESTORE_ROOT_ONLY)) {
 		pr_info("fault: Restore root task failure!\n");
-		BUG();
+		kill(getpid(), SIGKILL);
 	}
 
 	if (open_transport_socket())
diff --git a/criu/files-reg.c b/criu/files-reg.c
index 5da580ca8..07b0bc4e5 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1646,7 +1646,7 @@ int open_path(struct file_desc *d,
 	if (rfi->remap) {
 		if (fault_injected(FI_RESTORE_OPEN_LINK_REMAP)) {
 			pr_info("fault: Open link-remap failure!\n");
-			BUG();
+			kill(getpid(), SIGKILL);
 		}
 
 		mutex_lock(remap_open_lock);
-- 
2.13.3



More information about the CRIU mailing list