'stray PTRACE_EVENT_EXEC' on noMMU

Max Filippov jcmvbkbc at gmail.com
Mon Mar 28 20:43:40 UTC 2022


Hello,

with recent strace versions I'm reliably observing 'stray PTRACE_EVENT_EXEC'
message at the beginning of every trace on noMMU xtensa host. Decoded register
values are also incorrect for the rest of the trace. Bisection pointed me to the
following commit that introduced that behavior:
1b849e23bfe9 ("Workaround stray PTRACE_EVENT_EXEC")

The following workaround fixes it for me, but I'm not sure it's correct:

diff --git a/src/strace.c b/src/strace.c
index 94d6169db04e..a3de8ea93aa8 100644
--- a/src/strace.c
+++ b/src/strace.c
@@ -3679,7 +3679,7 @@ dispatch_event(const struct tcb_wait_data *wd)
                * and all the following syscall state tracking is screwed up
                * otherwise.
                */
-               if (!maybe_switch_current_tcp() && entering(current_tcp)) {
+               if (!maybe_switch_current_tcp() && !NOMMU_SYSTEM &&
entering(current_tcp)) {
                       int ret;

                       error_msg("Stray PTRACE_EVENT_EXEC from pid %d"


Any suggestions?
--
Thanks.
-- Max


More information about the Strace-devel mailing list