From nobody Mon Jan 10 15:36:00 2022 X-Original-To: bugs@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 D7725195774A for ; Mon, 10 Jan 2022 15:36:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JXdFr2zFRz3s70 for ; Mon, 10 Jan 2022 15:36:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B4A427AD1 for ; Mon, 10 Jan 2022 15:36:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 20AFa0ZH043410 for ; Mon, 10 Jan 2022 15:36:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 20AFa0Lv043409 for bugs@FreeBSD.org; Mon, 10 Jan 2022 15:36:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 260938] script(1) hangs when child doesn't read input fast enough Date: Mon, 10 Jan 2022 15:36:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641828960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gCxuqvKYKC8E/LjjCD/iw6V/RFRrnvxE2y2KB5tLh/o=; b=yd1Km8xoknH1u5SylKuflVBuXJ3n9aGfUE+mYHzAhu2MbWw+/dKkVQjcr1zRqX+nhpeiDb nmyQQ76ataXm38tnwMpbzWMxDCYaorZeC6Umlm5EVQfKsN0E5bCzYZNtjqvAIvGMqmZXkk FLb6kZ4wezWzyqGjgtSb1lxxu/lmdVuVMNrDAopkE0OyOR82SR/kerVy8XD2zjkx+6wisf Rib//2rw4PBMN0n1o9pjriM0VfDCVWoSsCb0+1XXOBmeA9TtbtwZfaqLnNgInJUpCZgeVh iaikG/Mt0PCSwT/yyKTtLnNLu4o/LLGXYKLlxwnAMzSTe0u/FG6G2q8yjLHiXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641828960; a=rsa-sha256; cv=none; b=upch/Zk37SFX5qsYyO6/LAspIynyafMx+v1pDnTaCsiyt0X08TVmGPqIlPBk1TIMez5Pqr u9nHrM41ZUICexTXJYSfSLvbdLcTgSdAAcvTEiLRsWwGnxmUEMRsAmltlKF2z1Uk3FuYST z2xvGZI8wRx9x0m76OFuZZonhEx11M3cnup1JF63DZa+8Z4cL1ywsRyxYswjviuCLxkS8E uolhErMOkTslOrXvJI+EY/19mq3dstiryIhgYAwf/Osmp5Cl6ftvBpaxoBw29jYTf3yaSw L4wEKLjgmhSDD2HONQlXRvO6Wx3LVT6TkebkrtGVL8fd33DTZAPJhtDAZoC3IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260938 --- Comment #3 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc0ba4c2ee2c48ec9892d10c0aca797f36= 85c53ee commit c0ba4c2ee2c48ec9892d10c0aca797f3685c53ee Author: Konstantin Belousov AuthorDate: 2022-01-08 13:19:14 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-10 15:34:51 +0000 script(1): work around slow reading child If child is slow reading from its input, or even completely stops doing the read, script(1) hangs in write(2) to the pts master waiting until there is a space in the terminal discipline buffer. This also stops handling any outer io, as well as child output. Work around the problem by making pts master fd non-blocking, and be prepared for short writes to it. The data to be written to master is buffered in the tailq which is processed when select(2) detects that master is ready for write. PR: 260938 Reported by: =D0=BD=D0=B0=D0=B1 See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D100= 3095 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33789 usr.bin/script/script.c | 56 ++++++++++++++++++++++++++++++++++++++++++++-= ---- 1 file changed, 51 insertions(+), 5 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=