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 26, 2024
1 parent 2c9e91c commit d471052
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions criu/cr-dump.c
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
Expand Up @@ -20,6 +20,7 @@ enum faults {
FI_CANNOT_MAP_VDSO = 133,
FI_CORRUPT_EXTREGS = 134,
FI_DONT_USE_PAGEMAP_SCAN = 135,
FI_DUMP_CRASH = 136,
FI_MAX,
};

Expand Down
4 changes: 4 additions & 0 deletions test/jenkins/criu-fault.sh
Expand Up @@ -39,3 +39,7 @@ fi
./test/zdtm.py run -t zdtm/static/fpu03 --fault 134 -f h --norst || fail
# also check for the main thread corruption
./test/zdtm.py run -t zdtm/static/fpu00 --fault 134 -f h --norst || fail

if ./test/zdtm.py run -t zdtm/static/vfork00 --fault 136 --report report -f h ; then
fail
fi

0 comments on commit d471052

Please sign in to comment.