Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15456

bash sets O_NONBLOCK on pts

From Matteo Croce <mcroce@redhat.com>
Newsgroups gnu.bash.bug
Subject bash sets O_NONBLOCK on pts
Date 2019-10-02 14:27 +0200
Message-ID <mailman.762.1570024976.2651.bug-bash@gnu.org> (permalink)
References <CAGnkfhx6xvuhvfWYzy11xHt=qWg5We9GKLmj0fN6JhjGtov5rw@mail.gmail.com>

Show all headers | View raw


Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-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)         = -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=201641

but then I tested with fcntl() that the stding had te flag set.

Repeat-By:
random after some usage

Fix:
`exec bash` resolves it

-- 
Matteo Croce
per aspera ad upstream

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

bash sets O_NONBLOCK on pts Matteo Croce <mcroce@redhat.com> - 2019-10-02 14:27 +0200

csiph-web