From: Peter Hurley <peter@hurleysoftware.com>
To: Aristeu Rozanski <aris@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>
Subject: Re: [PATCH] n_tty_read: check for hanging tty while waiting for input
Date: Tue, 17 Feb 2015 17:35:10 -0500 [thread overview]
Message-ID: <54E3C21E.3000301@hurleysoftware.com> (raw)
In-Reply-To: <20150217215046.GC13666@redhat.com>
Hi Aristeu,
On 02/17/2015 04:50 PM, Aristeu Rozanski wrote:
> Hi Peter,
> On Tue, Feb 17, 2015 at 04:28:30PM -0500, Peter Hurley wrote:
>> On 02/17/2015 04:06 PM, Aristeu Rozanski wrote:
>>> If the console has a canonical reader and the respective tty hangs up,
>>> it'll waste a wake up and will never release the last ldisc reference so
>>> the hangup process can finish:
>>
>> This behavior is by-design; /dev/console cannot be hung-up.
>
> hangup is issued on the tty that happens to be the console. In this
> case, ttyS0.
I realize that. But hanging up the tty that is /dev/console only affects
open descriptors that are not /dev/console.
So readers using the /dev/ttyS0 file descriptor will see a hungup fops,
but readers using /dev/console will not, and /dev/ttyS0 will _not_
be closed or released because of the still-open descriptor on /dev/console.
>> What process is sleeping on /dev/console read() and what is its controlling
>> tty? I ask because console teardown usually happens when SIGHUP is
>> received by the process group.
>
> ttyS0 is the controller tty.
Ok, so the process sleeping on /dev/console read() should have received
SIGHUP, which would wake the process and cause it to exit the
n_tty_read() loop, thus dropping the ldisc reference it holds.
Did it ignore the signal or perhaps the signal is masked?
Of course, there is no requirement for the process sleeping on /dev/console
to respond to SIGHUP, in which case, the hangup simply fails to make
forward progress because of the open /dev/console descriptor.
Regards,
Peter Hurley
next prev parent reply other threads:[~2015-02-17 22:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-17 21:06 Aristeu Rozanski
2015-02-17 21:28 ` Peter Hurley
2015-02-17 21:50 ` Aristeu Rozanski
2015-02-17 22:35 ` Peter Hurley [this message]
2015-02-18 14:58 ` Aristeu Rozanski
2015-02-18 15:40 ` Peter Hurley
2015-02-18 15:56 ` Aristeu Rozanski
2015-02-18 16:38 ` Peter Hurley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54E3C21E.3000301@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=aris@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome