Index: sys/amd64/linux/linux_ptrace.c =================================================================== --- sys/amd64/linux/linux_ptrace.c +++ sys/amd64/linux/linux_ptrace.c @@ -611,6 +611,15 @@ if (sr.sr_error == 0) { si.exit.rval = sr.sr_retval[0]; si.exit.is_error = 0; + } else if (sr.sr_error == EJUSTRETURN) { + /* + * EJUSTRETURN means the actual value to return + * has already been put into td_frame; instead + * of extracting it and trying to determine whether + * it's an error or not just bail out and let + * the ptracing process fall back to another method. + */ + si.op = LINUX_PTRACE_SYSCALL_INFO_NONE; } else { si.exit.rval = bsd_to_linux_errno(sr.sr_error); si.exit.is_error = 1;