From nobody Sat Jul 29 19:28:13 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RCvg14g6jz4qL8x for ; Sat, 29 Jul 2023 19:28:13 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RCvg148K3z3mMR; Sat, 29 Jul 2023 19:28:13 +0000 (UTC) (envelope-from pstef@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690658893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MhG+Rxm38hcS63DX3m9zVYnf1SWo3KHNB/Xjku6wJgk=; b=GblTOEDIxkAjbkWDXqsHw2dH7WRjOUEVE66Bu+imN1fI7RZfcxgmFhwycFVm2dZ/n8+caa m81zV5daI6oq3uFJP322ARNYmLf5Vchn0OesPqsGHaoKXsTei8JERvhBJMhnyVDzzc5Lrf Ct5XOSHwRYTdYqMADpeVSI+xyRN5+WwMotSnMRP0KGBneSUOjSHQE7x69grZYshuRqdIGW zh8n/innPeXb0jrIy+OBoOjL4uW/9ueHPnHrW12zX0vioVFmXaCYQo1fkgLtmjBhyHBYTQ PAjipcomfbK9TPUYkEQTPceetaOxnl0Wu90JI5OWejqwbjocqn/W9d8flYjaxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690658893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MhG+Rxm38hcS63DX3m9zVYnf1SWo3KHNB/Xjku6wJgk=; b=LfDmYR8l7w5D+R3HDByR85KlbFJE3fy+crABSQ0QEq3SBiwe8p2PtUmQbTgqwUZLUr533+ sGjc60TtPdlMEd696md0q1cxLDkrIp7JpPBMXfr9tv0qH5oG4/mB+o2sT+CHhy390Z3Lk/ RoKR+5cXlW1d7CymoChkJv5ehvW0/NpTYTCRd3ZiJsFHOAConONip7XBEoxU+3KAJPOm47 rkGPKws7Pi/qOUxee3xv4keEuSfDqumRUdgpKgdf4wWboe8Uwhp7lpsihXkQ2cfwQAAmnX yxgs6NczNU3zyIklv+tSTpTI8rzZV8vIWG07629mSUiaKJYddL1liGa0dhSpOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690658893; a=rsa-sha256; cv=none; b=D9dQETkPBfEwjEki7WsVjPTuBltmXHM7gO16FcvcC8htfTixbqm6hF57qFwGMEJFQwQE+q yNScVuUGJ7YpwYQkg9SGZCgh2qbCAyVyie/p5PDELVERK64ZvfYVghLXSbKoKEq8URT1vT jGEp5qpBlv5gw+3GHpQpTaE8XcBhTfCDl5SQy1ESO4I4pmEMjChg/jl7E3S5OmlIHQqPqE ztjAkuyik9tnYTCZn+gnaIKRim3i8EliCS/LqUIo0mXN51Tj5+AO1o1gF11Q6LHVPj6oDa cpB4mXmne8bEk6pNnZvC2E6IlMURodDlXkBGCOhMbJPBkpK6LUwouEt6TPFZVg== Received: by freefall.freebsd.org (Postfix, from userid 1403) id 593C8BF76; Sat, 29 Jul 2023 19:28:13 +0000 (UTC) Date: Sat, 29 Jul 2023 19:28:13 +0000 From: "Piotr P. Stefaniak" To: Jamie Landeg-Jones Cc: freebsd-current@freebsd.org Subject: Re: ps(1) bugs and problems Message-ID: References: <202307282307.36SN7b7v026284@donotpassgo.dyslexicfish.net> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202307282307.36SN7b7v026284@donotpassgo.dyslexicfish.net> On 2023-07-29 00:07:37, Jamie Landeg-Jones wrote: >I have a program that produces a list of PIDS, that are supplied via '-p' >to /bin/ps and are sorted with '-d'. What language is it written in? What is the use case? >After a late upgrade on a particular machine, I've just been bitten >by the modifications to "ps" to unconditionaly add recurive descendancy >PID lookups to the '-d' option when a pid is specified. I understand that the behavioral change affected programs/scripts in a way that requires adjustment and I do try to limit that as much as possible. But this feature was a needed one and I thought it should "just work" when -d was combined with -p, as opposed to adding a new flag to the program. Now that you've corrected my thinking, I plan to revert that change and re-introduce the feature as a separate option, see https://reviews.freebsd.org/D41231 for review. >There is nothing in the man pages or docs to suggest that this should >be a thing, but there you go. I intend to revert the change so there's no plan to update this in the manual page. >Rather than just patch it out, Would a patch to allow the previous >behaviour as an option (even if the option isn't default) be accepted? Feel free to discuss D41231 or provide an other patch. >In addition, there is a bug in that ps now goes into a memory-sucking >endless-loop if you do: > >ps -dp0 Thanks for this report, it was an oversight of the corner case that the parent PID of the PID 0 is also 0. >The manual page is no longer accurate either: > >'-d' says "Note that this option has no effect if the “command” >column is not the last column displayed." > >That is no longer true, it doesn't matter what column is displayed last, >if you use '-p', '-d' now completely changes the output > >title: ps: extend the non-standard option -d (tree view) to work with -p >https://cgit.freebsd.org/src/commit/bin/ps/ps.c?id=ca8c0d5e811048ad67d0955642c5b486e9c0f3d2 > >author: Piotr Pawel Stefaniak 2020-05-07 16:56:18 +0000 >commit: ca8c0d5e811048ad67d0955642c5b486e9c0f3d2 (patch) >tree: 374be17aead18daf2e3c7477a4573f60ce62d8f0 /bin/ps/ps.c My plan is to revert that. Piotr