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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24673 invoked from network); 13 Jul 2022 17:29:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Jul 2022 17:29:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1657733354; b=POFfXBK9oZGbJtQpLabRcld5wV0Mk35sR8UM1+nZWzM+8d7q4ENrJ5QvnlHcWTbOu2wuapyIv7 F56MPovEFqFqVFbyDonKh85im4fTXWy3Kct3+VSbNbzmQ0Eo/xaqtY4FJZTAZJC+Bh+OjQjV9V kHYvYbP2oefzfMfMP78konfCFI2zC6/6DyOay3bwD8w4i8IDfIA4M+uuqtQl77cpJ1d0WcjSLx G8oY/ZdaZT3KejkV43pUiHGLSAZMqLmyUJIbkK6EgHtd/1GHKJ+YQhqNypKRSMZ1nmgBe7OhOX RpuzgiOveMd+K4cnS3AQvCRSNYNCwB73j+FM2YiX6rAcrw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f51.google.com) smtp.remote-ip=209.85.218.51; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1657733354; bh=WbYKQnhcj/ext73udPvnw29fKtUVNXmymq2xss31igU=; 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=jmrCM1tNWFNzyrX5WqVF0HRCywcraNlYdr5+Aw1PlAuShjiJlXJ/J6wWK9d7J1VtE77ZOfRxux JZdgemK14apco3pINziNfCROV9ce58lDt7BQ01IM/3C87qSo+Itm1NHjgm0KIS9MnHE4UN0ICQ C3w/0JcIoMbzfo5BUC0o/s7zU5o19wTTMfVVvoAmSblfXSlmSX029o8NpoXMzAEABpEcGfJRiP uaQYxthRgkPrkCkMYTYyhH9nfffpvmfOhnb5jmpSw/qC8Vz7ujxl6oPPc8Ma7gQl7IAketQe9z gq6bJ930UuNPRvZ/i9smJiuk7+lvHs5Uv2wpudn0yB6KpA==; 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=ecycf5+FRIFnp43UaE4uD4VwMSRaqavskjOtuL7Ie4I=; b=YSvSU8ROiLmMfPdwtcnIg8NBmG l+ZU9I2dWuT8TxRdhy0xFvhgqEkMjU33NBl9DZozFKjeLiRCrij2GtZK8QUPO6y55FCcZxNxhpydn Xm1WK58BwdcuBOuvnDaeC7c+qkAYIkEtEB7BFgTiqw8YBE+euwd1ryM4Nw6axKP4KRTD5XV6IICit c/c54DEvjie7fbIZK/10f97eeiHpOFK0dMFr4ORm1TrDVqie66qaJAHHAXZTIIY1/MqwpIQ3FmVQE 2i9nyIMH6JsB2EDvXA+ezDe8z2PvzOmZGop5V2F65sbGdV9giN9+jbFiwaGhpSSsG4ec2RbTrJyFE kp4lalqw==; Received: from authenticated user by zero.zsh.org with local id 1oBgAi-000CtP-Nv; Wed, 13 Jul 2022 17:29:12 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f51.google.com) smtp.remote-ip=209.85.218.51; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f51.google.com ([209.85.218.51]:35513) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oBgAU-000CYq-Mn; Wed, 13 Jul 2022 17:28:59 +0000 Received: by mail-ej1-f51.google.com with SMTP id j22so21092463ejs.2 for ; Wed, 13 Jul 2022 10:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ecycf5+FRIFnp43UaE4uD4VwMSRaqavskjOtuL7Ie4I=; b=74Tz9gwEXL1Xd8V9nqvGkHWNMOFV5Wkp1gjyAgXPnhFgPCnLIB1ZVuVCwb8IC4TWsG xGzzEzBdIpt0U53QEhcDsN1c+3T2eZEcYccDV6oFyurEEHPfxOcDaE3qgnvuxD24ezrI 7Gc9VpquNgyHhwax1BeH2nYNgCXZqataYwqSNIRDmS0F4VJkdPgHLjoJHiJjHFYeOI+v Ko1n7LDLBWnR6xY19i/TV08hRLeEHo/+fIjLYB8ttatBDeuypnlFD2Yr4Me+3NW5Htwb SMLW15A4S01da9JCGIHTcN4YY/Ozre746/uN8qMDk+qqGW0c1lPUt79TycCaougLQTJD FPoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ecycf5+FRIFnp43UaE4uD4VwMSRaqavskjOtuL7Ie4I=; b=YGQae8u6UcdEJi8nXQlpnlIQfaXVAyJ22XWmU5c/OS83oJXl/g08WCPgCJALqqXZYc ArzHQuR1D7MGf2ImWr7G6icFJJ+Nx5ccVqnhsVDLfxdN1iJp0v5CeB59V9weSmPn8G/l w+0QKoYWPCg21etKY9ugM+npJHRB2InjF/3sFXM7c/r5uoCQ3LX2zeIiHRxMHo5cPaoC n5XIKh7zd6wUPd9ga4GCXtQrEQ7koHlucqEBHVDNsTEgHiiIMQ4KZeH5H+jMIEtMGYMw bbuTPMt8pBq4lNGfVWq6nCB3hrJZECsgh2GVX6tNdbfIMySrm0CWf3Qsmeu/wMLJ3uX1 jLrQ== X-Gm-Message-State: AJIora+MmXdQkzit8x+7TK/MDQyItnGEKq4/COat3+U9lQ6aHzipgNjm YqaBRRnPLNHrNqzU9Dh3sWknl6KOue0UJ/kJppI4HQ== X-Google-Smtp-Source: AGRyM1tn1i5TwW5KP6kB2omUzcjDPwlTv88PSwpjo/9eEEbVb9g+fHNsAXkKGQktecayjGiGD6yDrtJqylEsKRJY8nA= X-Received: by 2002:a17:907:3da0:b0:72b:47df:c1d7 with SMTP id he32-20020a1709073da000b0072b47dfc1d7mr4410897ejc.214.1657733338385; Wed, 13 Jul 2022 10:28:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 13 Jul 2022 10:28:47 -0700 Message-ID: Subject: Re: Bug: redirecting to /dev/stdout 3x in a row To: Paul Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 50410 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, Jul 13, 2022 at 10:13 AM Paul wrote: > > Hello workers of zsh. I noticed that on the latest version, this command: > =E2=80=98echo test > /dev/stdout > /dev/stdout > /dev/stdout=E2=80=99 > Results in an infinite loop of echoing =E2=80=98test=E2=80=99. This bug s= eems to happen only after redirecting output more than 2 times. Hmm. It's unclear that this is a bug (as opposed to user error). Redirection to /dev/stdout means that "test" is copied to the output twice. Redirecting it there again means that both of those outputs are doubled and that's fed back to the first output. A third time, all the previous outputs are doubled, again, including the stuff fed back to the first, which is doubled by the second, etc. At some point the this exceeds the amount of data that can be buffered without flushing it, and then you end up never being able to empty the buffer before more data goes in. There's nothing the shell can do about this, you've effectively instructed it to go into an infinite loop.