Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Matteo Croce Newsgroups: gnu.bash.bug Subject: bash sets O_NONBLOCK on pts Date: Wed, 2 Oct 2019 14:27:48 +0200 Lines: 50 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1570024977 4232 209.51.188.17 (2 Oct 2019 14:02:57 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570019311; 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; bh=g0DQUhVYyIgwHvw0gFq1gR+4BDMEa7beBfIZypZ2qas=; b=aR96xTqrLXUeL1zFhLMqSBiL/Nv7JeM6dqpKBiOUSh7V81z6NxNTei8Z8T6VDOffQIzjGZ JalPIJ7fx7um7y65tMzKdSJijyZqBy7W8QkvQj0ZOR6Zn2gLXHxg+y5QhTfZ661PswpGH/ vU6glfIMtXt2qb5t8vX+JyO/0/omXb8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rPU4n69RGSfFhwhqOeZJx2U5lDEynauidyHUAQcHW/s=; b=Y4jdlqOzlMKtO26fgvDDOtTj36Z8Gp3Sfv/blVOSXUFRivgUFsTLe39OlItP5BX7GM N17V2MeiBXOj1qL6C8ApDeseXMgTzYzOXKaYREjg/dKPWMImfOIipKM2ndLO/RG7mgRy r5g3hr0X/wIHTgK9WMvUwGJl4dJ1NYiItxL3WCqJEyyqAKh+X0YX9Ni3KhNXm2+Kr9wX hj9uRpOPiT2WqJxITsH8WIxN9K3OlCJplbYvo1N3NMJjs45QMxQDuTI5iZR+iinFjDzM brmdV+7gkoiHNGO+Rv4JhoyK23+lkIuaDCw/DVkl1lf4tww6qf7gTv4HYIGOTm9X+R2n yFYw== X-Gm-Message-State: APjAAAVLCI7Gewaabmsi3iZfjcsz6KOPwBuZkaLM3zNFPwxvUdsZs/mk +/KDLIcTXQQIEDaqXteK9TyBeBv7jvvSYhWQmNCd0Q4zbn+l3+PGbr8gXklSAh7vCwNllsm4/7W 08VLBwkGt8JlbK6pm5D8eE7f4 X-Received: by 2002:a2e:4296:: with SMTP id h22mr2343607ljf.208.1570019304828; Wed, 02 Oct 2019 05:28:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhXf+TpXTN5+sYa2TogOWQ8qw7XExjAwSKvtxxFdNYlnE+ymImkBhTqXvDsZw6aQMOzMO8tIpGFKfCEXA8Bw0= X-Received: by 2002:a2e:4296:: with SMTP id h22mr2343593ljf.208.1570019304639; Wed, 02 Oct 2019 05:28:24 -0700 (PDT) X-MC-Unique: bFpd--nYP-Su6McLBosUBQ-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-Mailman-Approved-At: Wed, 02 Oct 2019 10:02:55 -0400 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com gnu.bash.bug:15456 Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -O2 -g -pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-parentheses -Wno-format-security uname output: Linux mcroce-redhat 5.3.1-matteo #87 SMP Mon Sep 30 14:20:06 CEST 2019 x86_64 x86_64 x86_64 GNU/Linux Machine Type: x86_64-redhat-linux-gnu Bash Version: 5.0 Patch Level: 7 Release Status: release Description: Sometimes bash leaves the pts with O_NONBLOCK set, and all programs reading from stdin will get an EAGAIN: # cat cat: -: Resource temporarily unavailable # strace -e read cat read(0, 0x7f2a70511000, 131072) =3D -1 EAGAIN (Resource temporarily unavailable) : Resource temporarily unavailable +++ exited with 1 +++ Initially I thought it was a kernel bug, so I filed a bug on the kernel bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=3D201641 but then I tested with fcntl() that the stding had te flag set. Repeat-By: random after some usage Fix: `exec bash` resolves it --=20 Matteo Croce per aspera ad upstream