[Bug 252867] ptrace_test:ptrace__PT_STEP_with_signal test failed

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 06 Jul 2021 16:00:24 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252867

--- Comment #2 from Mark Johnston <markj@FreeBSD.org> ---
The problem on arm64 is that we don't disable single-stepping before executing
a signal handler.  I suspect the problem is the same on powerpc.  This hack
fixes the problem for me:

diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index 25f0a108311e..7d7f78760381 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -896,6 +896,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)

        tf->tf_elr = (register_t)catcher;
        tf->tf_sp = (register_t)fp;
+       tf->tf_spsr &= ~PSR_SS;
+       WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) &
~DBG_MDSCR_SS);
        sysent = p->p_sysent;
        if (sysent->sv_sigcode_base != 0)
                tf->tf_lr = (register_t)sysent->sv_sigcode_base;

-- 
You are receiving this mail because:
You are the assignee for the bug.