Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1489983yba; Sun, 21 Apr 2019 08:10:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKaYp7vz3XVbKzsF/DFmpesswj1hyh9WrLtbLXyS1U15GDg6ThK59SV47+zG7DstmtPfAi X-Received: by 2002:a17:902:854c:: with SMTP id d12mr15367235plo.150.1555859403735; Sun, 21 Apr 2019 08:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555859403; cv=none; d=google.com; s=arc-20160816; b=Sgo0wPIM7JQNRq4AcTLy4Wl+0RoghVLo0mK87t6qlqjXkuH3h4dzUvsAYA9zoz0XCI Gj7mbRF15H9VhOrAHEMn8mKBLdtC4mjQGzKKi+pbZ1NAH/2Oif4Z5lbNZIimQmV9WikR egtN2ns2ZMQ5VTGcO+xcCGuw8E/CTxlTp4hJc40wNDbkCTvKn7KHg1aItZk12JziNsHw O6vmYBxnm2091A3KGPutmkUGfjIMPYmMzyrKuzNbHHDlTfAnje4Hr12fPOSdZItg3qwa NatLP606BRVdFhGl4t9NL08YL5WLAuepoitVXDGerTtazy14FUdt0xLp+gyw/rLrNwSe 9XqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=+ka5dqsrzxzxjS6xqzuKvw5Avz8P14qGYsAdTTUR+js=; b=DHCysgUiK2fRqP+dH4o76Rt71SBkuXZC1W+8Q8PPsPRrM1QP5mr66VFaH5NtQgrCYa F5/yKrOe2TZYjgt/XT6zJ02L6YM8lZ5ifSm4WxgV5pBU+VW726ZjDYTZyiOdqxp8oeY3 /UYct8LBSTWPuHmSsZxqHylEfMcy0eFil3w/6Mi/vYq3X0jPa+RfCy9qNj/S7zRgwPvW X6M2Vp3DE/BuamWlmlp9HU5fNve2hjSQR6lUmzy/h2Dw8rP5Nj3msBmETYKbPGw3loER Mc3W2f+MBJ7JrWRCAu2e7jCKV37hgx3LdS67Ag4mg3r2rZQI3myzFdMbHMj91xN6FiAN XmRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si10582305plo.274.2019.04.21.08.09.14; Sun, 21 Apr 2019 08:10:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727676AbfDUPG6 (ORCPT + 99 others); Sun, 21 Apr 2019 11:06:58 -0400 Received: from mail.grenz-bonn.de ([178.33.37.38]:54036 "EHLO mail.grenz-bonn.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbfDUPG6 (ORCPT ); Sun, 21 Apr 2019 11:06:58 -0400 X-Greylist: delayed 585 seconds by postgrey-1.27 at vger.kernel.org; Sun, 21 Apr 2019 11:06:57 EDT Received: from [192.168.178.151] (p57B0D1DA.dip0.t-ipconnect.de [87.176.209.218]) by ks357529.kimsufi.com (Postfix) with ESMTPSA id 9D6C589A81; Sun, 21 Apr 2019 16:57:10 +0200 (CEST) Subject: Re: [PATCH] ptrace.2: Improve clarity for multi-threaded tracers To: "Dmitry V. Levin" Cc: mtk.manpages@gmail.com, linux-kernel@vger.kernel.org, cleverca22@gmail.com, linux-man@vger.kernel.org References: <48bb7c89-abb9-1e88-fee3-fb42d4032d12@nh2.me> <20190217221523.GA9233@altlinux.org> From: =?UTF-8?Q?Niklas_Hamb=c3=bcchen?= Openpgp: preference=signencrypt Autocrypt: addr=mail@nh2.me; prefer-encrypt=mutual; keydata= mQINBFZQegIBEADD2C+ODuFxK9XAQQqbP84M7y6gRDMIaFxqeT56g/pbe/wNjKATUQhJvaVJ /WbZ900KjMe8eo4Lg3uLbd6OxR2wb4OMkA7ogq87GefqyPvP3QhqkLhMjwoYim650PXqblgH W5VW1OPeUFBO4IMeHdMmO8cwNUUBlRY29Ld4VBSVCyZRgf10zy6IaWJRGaRnTSnSmHBVnM5H 0EYlAeOrL7ZgA+xl+H9oGXRiDPTKiaPUhmRiVDjKCuqVmjx5H2armDs3DKu1e2g8o+52hN/d 1+kgC5C801iXyV3r20+D24cuvkSZlKFQUavwBO9MnU5HcZROoJ4aVq1vnGqPwkcaumu8GJo/ Nv2OsL60p2sMw6eoYZs9M7vtHyT9acEKm8GOZqb7vnE0i6yaqTkFn1MopmKDjbJzlayW9edw 1P4IxAlGyh8DY/Rw/TyzC8Vyq9T30Q5PQOK32vJwrKfbQouG9LJA7/7pv/JA8PZJk2GvQJzG 8L4pbxmDErRome+fNdFv5fkmFfvqBURFi08/96uaVJh1yKExiYC4qAyM2Ff7+k9K5lctHWtt zWeav3hhj2W472++Gy8Q4EOGciFih/xCweDmIXvM0NlVf6rnN2EWGpD4fV3WwD0dopO6LgvF pKYd6Vu08rzVHeXTFcFM2+Sqn01bWSnwOHlipELBNwSTRTtdVwARAQABtB9OaWtsYXMgSGFt YnVlY2hlbiA8bWFpbEBuaDIubWU+iQI9BBMBAgAnAhsDAh4BAheABQsJCAcDBRUKCQgLBRYC AwEABQJcrJMpBQkPwhqmAAoJEKw0Mmot+/oD0ocQALwvyzAnjK5+kWr1K5BLpyTaNWcsjqur 0K76jMeU9rWWJOE1XIEDs7SLki5eqVwi8+aT3ix4NWKgWekxJA/vc1def5Pb6yH3Pqvz/LMZ ucXwbluwFY8PhKbJW9UqGhkTZuUGR3qhtcv3ADiVf+pF+9ezLC16gQw5dWjmgVUkpJuaKDCe ghbtg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SRB2I9H0p7cblncArvaNecD8cHfbF2s 8SRcChCX+RBIj0MSfqWstEEdvuRQJGezqvygo5Pj1qoH1Uopi9IsG+3sq3kSvUjD+DcnZ4Cb IshzoDDc/hHhbeQvAioY9fCTBg+XhlzjjawtMCamzTyPvAtkI6E5xzqTC5/HNLGcXdMls4uc SHXOdAdUFn1jRgtwXLEk20krJ/QBi8O7jg2TSrgLyQ3P9GDhXZsH6hEhoKUpsRHxu6e2wRMs frQldWRH+1tsRnNjR1IAibyN+6ToCf/SbHlOkrrhsp+y8gsIiUyhcKvYVnUR103ly1GsC+F6 N6MTQwG0JG6i0k6Si0wVuNsXwIg91Ft8YDl50wIm7MQRsB5fkV+eckM407FtQNlEorVgGmrq XHxzyMBH0wf8LFkfglOX0LBpxSucLcMxlVDCjOUm8JM1GyKYZFfqsVlHkncR7CKI8xyjxz+A 6NGMsDuaqJ8h/fVs+MxDehnaVnvIF7TDGv9jz3mgqzbrToGXAmpzhhVM3RWIora1j91WzMSL +KN/YNvJggdPofH4QwVocD3pSXnLMOdqya8mwBv1pHdwSL4Ug7RAWIVgeBAv0ufeElOJQNjp pg16v3C1dl0LUhDYFBJRnknYxq7yCFUZHRl2VpbnzV1aQ2g= Message-ID: Date: Sun, 21 Apr 2019 16:57:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190217221523.GA9233@altlinux.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OwGNQNSqQVOvD1aGOIshAm1E6dQ5YxdCU" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OwGNQNSqQVOvD1aGOIshAm1E6dQ5YxdCU Content-Type: multipart/mixed; boundary="RkaQJYhghPjFx7gWx18EeWMq1qyJtc18B"; protected-headers="v1" From: =?UTF-8?Q?Niklas_Hamb=c3=bcchen?= To: "Dmitry V. Levin" Cc: mtk.manpages@gmail.com, linux-kernel@vger.kernel.org, cleverca22@gmail.com, linux-man@vger.kernel.org Message-ID: Subject: Re: [PATCH] ptrace.2: Improve clarity for multi-threaded tracers References: <48bb7c89-abb9-1e88-fee3-fb42d4032d12@nh2.me> <20190217221523.GA9233@altlinux.org> In-Reply-To: <20190217221523.GA9233@altlinux.org> --RkaQJYhghPjFx7gWx18EeWMq1qyJtc18B Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hey Dmitry, On 2019-02-17 23:15, Dmitry V. Levin wrote: >> A tracee first needs to be attached to the tracer. >> -Attachment and subsequent commands are per thread: >> -in a multithreaded process, >> +Attachment and subsequent commands are per thread, >> +on both the tracer and tracee side. >> +Issuing a tracing command from a thread that is not the tracer of the= given >> +.I pid >> +will result in an >> +.B ESRCH >> +error. >=20 > This is confusing. What do you mean by a tracing command? > Is PTRACE_TRACEME a tracing command? PTRACE_ATTACH? PTRACE_SEIZE? I was referring to the same command as in other places in the man page, a= s in the existing sentences Most ptrace commands [...] require the tracee to be in a ptrace-stop= , otherwise they fail with ESRCH. or (for commands which require a stopped tracee) Would thus "ptrace command" be better than "tracing command" here? >> .B ESRCH >> The specified process does not exist, or is not currently being trace= d >> -by the caller, or is not stopped >> +by the calling thread, or is not stopped >> (for requests that require a stopped tracee). >> .SH CONFORMING TO >> SVr4, 4.3BSD. >=20 > I agree the current text can be made more clear on the subject, > but, unfortunately, proposed change makes the description more confusin= g. Do you mean "calling thread" is more confusing than "caller"? If yes, what would you suggest instead? My intent here was to, for anybody who encounters ESRCH and looks it up i= n an effort to see what's going on, make clear that threads are important= here. Or should I switch to `task_struct` terminology? That wouldn't be userspa= ce terminology though, and the rest of the man page also talks about thre= ads. Niklas --RkaQJYhghPjFx7gWx18EeWMq1qyJtc18B-- --OwGNQNSqQVOvD1aGOIshAm1E6dQ5YxdCU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJcvITDAAoJEH/lIgaioOiYJ0gIALbn+rsRbApXNSZl+9y6GyHT kOgocyW1akd5xxSzIgDRsshEsLZkJ2PD/u6wyvYbz+7NMPH5gFp3meIRKQgrtqZR +ORnn9Oa6Lc4dlK1EfiSliEEooCpnhj/vihdkUt44t7qtbNEY8G3XmIZ0Wfo3Leo 7PatUwWNzwwvR29ZkNao7JC0gCMX5iSwXE5iUtSQEnitfI9PaYPSzylVqsboi7oN zqNfedrL2cBlRg9yJ8kzOjG2qotuSssmPSj9UHQB88kxXro1nKhQvvkPKgfTtxxL WkrnVdj7bAOf0/51EimZ/2whd5ssvuJvDINFd7lXCnW/WL0nvXrHTuLqmEigp7w= =KcYI -----END PGP SIGNATURE----- --OwGNQNSqQVOvD1aGOIshAm1E6dQ5YxdCU--