All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alan Cox <alan@llwyncelyn.cymru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [BUG] tty: Userland can create hung tasks
Date: Mon, 6 Nov 2017 06:54:27 -0800	[thread overview]
Message-ID: <20171106145415.GW3252168@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <20171101170908.6ad08580@alans-desktop>

Hello, Alan.

On Wed, Nov 01, 2017 at 05:09:08PM +0000, Alan Cox wrote:
> On Tue, 31 Oct 2017 19:06:51 -0700
> Tejun Heo <tj@kernel.org> wrote:
> 
> > Hello,
> > 
> > tty hangup code doesn't mark the console as being HUPed for, e.g.,
> > /dev/console and that can put the session leader trying to
> > disassociate from the controlling terminal in an indefinite D sleep.
> > 
> > Looking at the code, I have no idea why some tty devices are never
> > marked being hung up.  It *looks* intentional and dates back to the
> > git origin but I couldn't find any clue.  The following patch is a
> > workaround which fixes the observed problem but definitely isn't the
> > proper fix.
> 
> Two reasons
> 
> 1. It broke the serial consoles because they would hang up and close down
> the hardware. With tty_port that *should* be fixable properly for any
> cases remaining.
> 
> 2. The console layer was (and still is) completely broken and doens't
> refcount properly. So if you turn on console hangups it breaks (as indeed
> does freeing consoles and half a dozen other things).
> 
> Sadly it seems that nobody cares about the console.

Hmm... so, does something like the posted workaround look reasonable
to you?  It doesn't fix the actual hangup issue but gets rid of
processes getting stuck in D sleep indefinitely.

Thanks.

-- 
tejun

      reply	other threads:[~2017-11-06 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01  2:06 [BUG] tty: Userland can create hung tasks Tejun Heo
2017-11-01 17:09 ` Alan Cox
2017-11-06 14:54   ` Tejun Heo [this message]

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=20171106145415.GW3252168@devbig577.frc2.facebook.com \
    --to=tj@kernel.org \
    --cc=alan@llwyncelyn.cymru \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.