Skip to content

Commit

Permalink
test/dump-crash: check code path when dump crashes
Browse files Browse the repository at this point in the history
Signed-off-by: Bhavik Sachdev <b.sachdev1904@gmail.com>
  • Loading branch information
bsach64 committed Apr 19, 2024
1 parent 2c9e91c commit 1400985
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions criu/cr-dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,10 @@ static int cr_dump_finish(int ret)
close_image_dir();

if (ret || post_dump_ret) {
if (fault_injected(FI_DUMP_CRASH)) {
pr_info("fault: CRIU dump crashed!\n");
abort();
}
pr_err("Dumping FAILED.\n");
} else {
write_stats(DUMP_STATS);
Expand Down
1 change: 1 addition & 0 deletions criu/include/fault-injection.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enum faults {
FI_RESTORE_OPEN_LINK_REMAP,
FI_PARASITE_CONNECT,
FI_POST_RESTORE,
FI_DUMP_CRASH,
/* not fatal */
FI_VDSO_TRAMPOLINES = 127,
FI_CHECK_OPEN_HANDLE = 128,
Expand Down

0 comments on commit 1400985

Please sign in to comment.