[CRIU] [PATCH] tests: Check that no-breakpoints restore works
Cyrill Gorcunov
gorcunov at gmail.com
Wed Apr 27 03:44:54 PDT 2016
On Wed, Apr 27, 2016 at 01:23:04PM +0300, Pavel Emelyanov wrote:
>
> Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
> ---
> criu/include/fault-injection.h | 1 +
> criu/parasite-syscall.c | 6 +++++-
> test/jenkins/criu-fault.sh | 1 +
> 3 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/criu/include/fault-injection.h b/criu/include/fault-injection.h
> index c69a1c9..f1e5c72 100644
> --- a/criu/include/fault-injection.h
> +++ b/criu/include/fault-injection.h
> @@ -10,6 +10,7 @@ enum faults {
> /* not fatal */
> FI_CHECK_OPEN_HANDLE = 128,
> FI_NO_MEMFD = 129,
> + FI_NO_BREAKPOINTS = 130,
> FI_MAX,
> };
>
> diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
> index a5b2fc7..f9e0bac 100644
> --- a/criu/parasite-syscall.c
> +++ b/criu/parasite-syscall.c
> @@ -1428,7 +1428,11 @@ int ptrace_stop_pie(pid_t pid, void *addr, enum trace_flags *tf)
> {
> int ret;
>
> - ret = ptrace_set_breakpoint(pid, addr);
> + if (fault_injected(FI_NO_BREAKPOINTS)) {
> + pr_debug("Force no-breakpoints restore\n");
> + ret = 0;
> + } else
> + ret = ptrace_set_breakpoint(pid, addr);
> if (ret < 0)
> return ret;
What about clear_breakpoints?
More information about the CRIU
mailing list