From owner-freebsd-emulation@freebsd.org Thu Jun 14 13:11:54 2018 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 804231003C17 for ; Thu, 14 Jun 2018 13:11:54 +0000 (UTC) (envelope-from yanko.yankulov@gmail.com) Received: from mail-ot0-x22f.google.com (mail-ot0-x22f.google.com [IPv6:2607:f8b0:4003:c0f::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1176969D56 for ; Thu, 14 Jun 2018 13:11:54 +0000 (UTC) (envelope-from yanko.yankulov@gmail.com) Received: by mail-ot0-x22f.google.com with SMTP id d19-v6so6991011oti.8 for ; Thu, 14 Jun 2018 06:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Xu/H1MBpOsZp7+V61j59bStP8qt+AgAfqb3QrAPAyHI=; b=K3OAXqd97meUkVce90y9cimt44xT+NyYpC/PHLpfdR6Oa6M8rJwymZ5hB4xrRJV3wn 4Ww1bpWiCDh/8tjrhyRl95VIVNW4qkU5xzk4lqOYXk2Qssq2ARpUu0zPGximw0hEeoqQ lSJoMM6DPrbAh9dhcBKgku+jB+2QaXbfnclMuzRxULOO9MMd7PGwHlSHSvuk4gEq2fir LqY+CZCDMZYog4D051a7F/Zc2Q+Jabk8GRwltZqhqCjeZ9lV0h4TtvWb1Q5RzPlqEVSb hvTPzlVidPKJZKH5CLSj57Jl0xsImxI5s0mt0QlAdGyLUnt8kc+76eYqGBQHU5cd6ekb g3cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Xu/H1MBpOsZp7+V61j59bStP8qt+AgAfqb3QrAPAyHI=; b=KOiVpTjMb9La8PRrwtNEeeSqhPWjMdkx46oYMM2+dpFZW3fqJ17bwg9dENhn/6zBDD xHorwISkBZwuxzYi/5v+CZJ5463Di/Btqqei5tHfcFFg6FVeJ9kLt0eiJBxmAuQ/G4JQ DLU7xFruSLWRHn+LXxqfP+TT2wwMLG/xVrx5p595kW4NWVBwMe6SyOTeagP0dHr8L0Au 7o6EdeP9G4SCFEFDHqeDzlw9P0g6yIQJ9uHRd4ufoRbhU60gLqxI8IjRZcIqHCdhgqxP kc/bhAcyX8RkB2cHq55u2dYdGb0kVDEF7MeopB9ERX0Rc+DAdKn0o7bUBPUqO3tfIPXK IIlw== X-Gm-Message-State: APt69E0oVHkVC6rD2lvhJ1csGFi4N9DfUxoCLfqQ9XAH+9icky7YMRnr OJdq8MaOVyAiMf5Js7p5cmlBf1rrFLY+qjOI5JU= X-Google-Smtp-Source: ADUXVKIqzJaTlv+cpJsaf9vGoxdTNPCdmOIxYYfFBHpfJ6zl7+3vfO3P5LAJOj7UQk1Tmr/lNUpSzypU/Mwag16BUgU= X-Received: by 2002:a9d:7411:: with SMTP id n17-v6mr1434676otk.348.1528981913162; Thu, 14 Jun 2018 06:11:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:14cd:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 06:11:52 -0700 (PDT) In-Reply-To: <20180614123659.GZ2493@kib.kiev.ua> References: <20180614101324.GW2493@kib.kiev.ua> <20180614123659.GZ2493@kib.kiev.ua> From: Yanko Yankulov Date: Thu, 14 Jun 2018 16:11:52 +0300 Message-ID: Subject: Re: two proposed linuxulator fixes + ptrace To: Konstantin Belousov Cc: freebsd-emulation@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 13:11:54 -0000 > > > For the patch 1, TracePid, can you explain what is the meaning of the > > > pid reported ? > > > > > > The TracerPid is the PID of the process currently ptrace-ing the > process. > > TracerPid 0 means no active tracer. So the patch is not semantically > > correct as it always reports no tracer, but it got the program running. > Ok, but what is the tracer ? Is it ptrace(2) debugger, or something > else ? > Yes, any ptrace(2) debugger/truss/strace/whatever. The Linux code is: tracer = ptrace_parent(p); if (tracer) tpid = task_pid_nr_ns(tracer, ns); > > > > > > > For the patch 3, %r10 preservation for linux_rt_sigreturn, shouldn't > the > > > same handling applied to non-rt signal return ? And in fact, shouldn't > > > it be done based on the return code instead of the syscall number ? > Look > > > at the amd64/amd64/vm_machdep.c:cpu_set_syscall_retval(), where I > think > > > EJUSTRETURN case is used by linux sigreturns. > > > > > The linux_rt_sigreturn seems to be the only signall return syscall. > > The no rt_ version seems to be an old pre Linux 2.2 interface. > > > > The return code observation sounds right. Thanks. New patch. Ran a > > quick check, the issue is still solved. > Committed as r335135, thanks. > Great