From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13521 invoked from network); 29 Jun 2023 18:17:00 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Jun 2023 18:17:00 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1688062620; b=Iv1DtVt/dM2vAkXXF/ezNZn0vliQYBA/cA1JB9NUBw+9KGWFZYVag+Br83Ut7ZptNHsgGQ8Dx0 k0hCHRJlnKQr8BffYGUNaEUwYX3Vl+RevkYL96nSiwBmJW1vOoTLkd0rHtVfCcbaPo2367qBuJ gf60gOiGsf6MS9lePvmt+QWl9tZ2jIAG5ocERD6bJnvJWo2G+0iEZXk4sbu4RoYM28ccym5PWf ag34WvbvJSuOs7xTMz+lIQV/B7XuX4u7Vy0eCMX+kTk7Vx2xvMN1tTbI6WNZB7kE9wInd+l8if F9CmB1WhF8GD6DIzNdZ98tIXUGrksKafo7D5T0ICwptA8Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f177.google.com) smtp.remote-ip=209.85.208.177; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1688062620; bh=fsOHVy0HDNqdEVl6/t/XHm87KYwr0U731oXAT02mk+E=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=AtSA/uCwMYR1ox9m/vBGCcNCs+Bzs3rpakZgazggWLuM1L8gQSB5PYG57mgB8AJZYPv2p7Y7MY 9HTBcZS7tusW6ar4lGsGRuoSMGarpsc97gZ4wCOuaF2mssyhzPivlH77RCRCZ8yh1MZJ79OWwi WWac1ZTF8Nzl3Oqvp+Rq/k0nNbl3LpaViZ3tS41GFxrX++mIjtCuZvEJXQSav2Hpsipo0jp06n GUNvr/zoLbIOQkJNbhFpBh0fTVudw6nxcAbV+wQvEHX2zajMPh2+iwcsXLfN+u3N5rpRhZ5VIM UymQ2ySDam28YvLIIHwlP22tXsUzsX0INJJ0k4yPfLF0mQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=g2b9mxnp2OiwaouIkO+yrI6ePvC/H6Ad5rFuz7HdrsA=; b=Gqw2FAiaMyosZscuwUefxaxdk+ DOhvuEIfAc2AZ2exn2OetZjoggM0nby5Os/R3g0siN7b4pC1UGFS6xz+sBXtHInsgHIolOW439Nac r7+AbQlJnCo6mFo3KurFsH82bY8BajNP9F8BP/Cm0O/ZbYLx9Yeh2a02viN4POISwOONAeUoCbGTB U/pwkqZEIdafTNnV4P5n2yTgJpwk45clxYtTRG4bqhxN2bok9X6JlcGqwOOv+yD1hKxQFHt4wXDZr ZzsQNNhlmuUdUwyB3CC6j2JUrgvnG0SvfgeENAQmoNe9swOD3X41h3+WEfRKN3kQTPw61Gn7obmiu xxY48kog==; Received: by zero.zsh.org with local id 1qEwCR-0007Yn-Nx; Thu, 29 Jun 2023 18:16:59 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f177.google.com) smtp.remote-ip=209.85.208.177; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f177.google.com ([209.85.208.177]:47429) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qEwBg-0006sU-HT; Thu, 29 Jun 2023 18:16:13 +0000 Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2b6a0d91e80so16267021fa.3 for ; Thu, 29 Jun 2023 11:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688062572; x=1690654572; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=g2b9mxnp2OiwaouIkO+yrI6ePvC/H6Ad5rFuz7HdrsA=; b=m+5z+827j8Zjpq69X7lKbyGTO2ao8MChPbHjBJ/YkGVEtQeaALi0M4qG5yqOyTHemS gicxSDKZbyVhhZSLqK/+1cFgidsbXHBrCiWFMppzV2YBY01KhJ4GracZb5JZAiP77hk+ G8GlkEGFR6RpUQNJ03Vu5kBTbNuyWbnfL5uEfkUgvvGCzjsyKcNVj2T7rkksQ5l1ExAP rLwCYXR0eq2t5FtZyJG6WK7FfBBRyK+8cpE6anky4ytJlZGCs6l2PeiMVJGuTDP3P5oI ePJt8CVcUorBcrLApjKpqUPm/Ue6D8Qayvd48adeWA6Z1A8TnZHZ8LrLawwebZKGQhsH Kjiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688062572; x=1690654572; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g2b9mxnp2OiwaouIkO+yrI6ePvC/H6Ad5rFuz7HdrsA=; b=URicO06dAH+XiDH5i0pocxb1uoLIMICKdGaOBqgVdXPRA4dppvXY9XFfnwGHPeV1iX COPXIzvmFjDG3ewBDMB4NrD+rh30Ri6wcFtgCwHqn/Tp35Zevv+U43s4ajV1qCcP7ZXP wz/MakwOQ1s1ljl9O6PJNYxG1MLjXuwkSrSC03+uYZqu6IC58zP7ZjONxDbZiOGhuT1v 0UVNZmRkcbI95lliTp8fdDpvCTI1V3LKUCTt9GmtMFlsEb5ntFHvMmANXcnr3RCYNnCk 5/TkTtD/eBkEo+EMIf7JEYT8WB4XMyUWM0xm409hl7hdCyYUCr2YdF9RkL6sUTUz3CVU RLfg== X-Gm-Message-State: ABy/qLY+RJWZQigtNXHBoKvNN8JECtg4GC2bOkGHZgmVTrLURVzycobc g5hq4b5zHFJPMdZz9z7GB0CMpcYd4gqVSj4z/reY6+qw X-Google-Smtp-Source: APBJJlEIUqvLJ2909KsikGE+YbHUCRfABdv8a7C6lTa+riaVYJDaHY1QJlnhC43lZPzd0gPLxU4LiEqQ4646ahbIb3g= X-Received: by 2002:a2e:870f:0:b0:2b6:99a3:c254 with SMTP id m15-20020a2e870f000000b002b699a3c254mr421205lji.26.1688062571289; Thu, 29 Jun 2023 11:16:11 -0700 (PDT) MIME-Version: 1.0 References: <25FF68CF-F93D-4745-84D1-A97A5ECCA348@gmail.com> <36f09056-0f1a-1b8a-dcf8-0ab222857ea2@gmx.com> In-Reply-To: From: Roman Perepelitsa Date: Thu, 29 Jun 2023 20:15:57 +0200 Message-ID: Subject: Re: Bug/regression: tt(RANDOM) seed not updating when $RANDOM is used in a pipe To: Mikael Magnusson Cc: Bart Schaefer , Eric Cook , zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29097 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Thu, Jun 29, 2023 at 7:53=E2=80=AFPM Mikael Magnusson wrote: > > On 6/29/23, Roman Perepelitsa wrote: > > On Thu, Jun 29, 2023 at 7:43=E2=80=AFAM Bart Schaefer > > wrote: > >> > >> On Wed, Jun 28, 2023 at 7:46=E2=80=AFPM Eric Cook wrote= : > >> > > >> > On 6/28/23 16:10, Jon Oster wrote: > >> > > In 5.8.1, $RANDOM seems not to update its state when the command > >> > > $RANDOM > >> > > was used in is piped somewhere. For example: > >> > > > >> > > Is this considered a bug? Or is it intended behaviour? > >> > > > >> > > [1] > >> > > https://sourceforge.net/p/zsh/code/ci/faf0035e532cde45528806e7a05a= d28a0ab7c0fb/ > >> > > >> > The LHS of the pipe should be a subshell, so the behavior is > >> > intentional. > >> > >> This was, however, an unanticipated side-effect of the referenced > >> commit. It changed behavior (that, before, did not conform to the > >> documentation) without that fact being called out in any of our files > >> that serve as release notes. > >> > >> It opens the question of whether anything else that previously was > >> "pre-fork" might have changed behavior at that point. > > > > Perhaps things of this sort? > > > > % echo ${foo::=3Dbar} | cat > > % zmodload zsh/system; echo $sysparams[pid] | cat > > > > I cannot reproduce the 5.4.2 behavior reported by Jon, so I cannot > > verify whether the identified commit affects these test cases. > > > > % docker run --rm zshusers/zsh:5.4.2 zsh -c 'repeat 2 echo $RANDOM = | > > cat' > > 15988 > > 9706 > > Yes, you can? Of course! I can also confirm that the two test cases I posted above behave differently in zsh 5.4.2 and 5.9. In all these cases 5.9 behaves as I would expect, and the behavior of 5.4.2 is surprising to me. Roman.