2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00

test/dump-crash: check code path when dump crashes

Signed-off-by: Bhavik Sachdev <b.sachdev1904@gmail.com>
This commit is contained in:
Bhavik Sachdev 2024-04-20 00:24:27 +05:30 committed by Andrei Vagin
parent a252a240c3
commit f171649264
3 changed files with 9 additions and 0 deletions

View File

@ -2102,6 +2102,10 @@ static int cr_dump_finish(int ret)
close_image_dir(); close_image_dir();
if (ret || post_dump_ret) { if (ret || post_dump_ret) {
if (fault_injected(FI_DUMP_CRASH)) {
pr_info("fault: CRIU dump crashed!\n");
abort();
}
pr_err("Dumping FAILED.\n"); pr_err("Dumping FAILED.\n");
} else { } else {
write_stats(DUMP_STATS); write_stats(DUMP_STATS);

View File

@ -20,6 +20,7 @@ enum faults {
FI_CANNOT_MAP_VDSO = 133, FI_CANNOT_MAP_VDSO = 133,
FI_CORRUPT_EXTREGS = 134, FI_CORRUPT_EXTREGS = 134,
FI_DONT_USE_PAGEMAP_SCAN = 135, FI_DONT_USE_PAGEMAP_SCAN = 135,
FI_DUMP_CRASH = 136,
FI_MAX, FI_MAX,
}; };

View File

@ -39,3 +39,7 @@ fi
./test/zdtm.py run -t zdtm/static/fpu03 --fault 134 -f h --norst || fail ./test/zdtm.py run -t zdtm/static/fpu03 --fault 134 -f h --norst || fail
# also check for the main thread corruption # also check for the main thread corruption
./test/zdtm.py run -t zdtm/static/fpu00 --fault 134 -f h --norst || fail ./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