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


Groups > linux.kernel > #1294915 > unrolled thread

Re: n_tty: Check the other end of pty pair before returning EAGAIN on a read()

Started byMarc Aurele La France <tsi@tuyoix.net>
First post2015-12-18 15:40 +0100
Last post2015-12-18 18:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: n_tty: Check the other end of pty pair before returning EAGAIN  on a read() Marc Aurele La France <tsi@tuyoix.net> - 2015-12-18 15:40 +0100
    Re: n_tty: Check the other end of pty pair before returning EAGAIN on  a read() Peter Hurley <peter@hurleysoftware.com> - 2015-12-18 17:50 +0100
      Re: n_tty: Check the other end of pty pair before returning EAGAIN  on a read() Marc Aurele La France <tsi@tuyoix.net> - 2015-12-18 18:30 +0100

#1294915 — Re: n_tty: Check the other end of pty pair before returning EAGAIN on a read()

FromMarc Aurele La France <tsi@tuyoix.net>
Date2015-12-18 15:40 +0100
SubjectRe: n_tty: Check the other end of pty pair before returning EAGAIN on a read()
Message-ID<qH4mo-6QB-81@gated-at.bofh.it>
On Fri, 11 Dec 2015, Peter Hurley wrote:
> On 12/11/2015 05:37 AM, Marc Aurele La France wrote:

>> I am not asking to read data before it has been produced.  I am puzzled
>> that despite knowing that the data exists, I can now be lied to when I
>> try to retrieve it, when I wasn't before.  We are talking about what is
>> essentially a two-way pipe, not some network or serial connection with
>> transmission delays userland has long experience in dealing with.

>> These previously internal additional delays, that are now exposed to
>> userland, are simply an implementation detail that userland did not,
>> and should not, need to worry about.
>
> Your mental model is that pseudo-terminals are a synchronous pipe, which
> is not true.
>
> But this argument is pointless because the regression needs to be fixed
> regardless of the merits.

Fair enough.

Anything new on this?

Thanks.

Marc.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1295028 — Re: n_tty: Check the other end of pty pair before returning EAGAIN on a read()

FromPeter Hurley <peter@hurleysoftware.com>
Date2015-12-18 17:50 +0100
SubjectRe: n_tty: Check the other end of pty pair before returning EAGAIN on a read()
Message-ID<qH6oa-86R-15@gated-at.bofh.it>
In reply to#1294915
Hi Marc,

On 12/18/2015 06:26 AM, Marc Aurele La France wrote:
> On Fri, 11 Dec 2015, Peter Hurley wrote:
>> On 12/11/2015 05:37 AM, Marc Aurele La France wrote:
> 
>>> I am not asking to read data before it has been produced.  I am puzzled
>>> that despite knowing that the data exists, I can now be lied to when I
>>> try to retrieve it, when I wasn't before.  We are talking about what is
>>> essentially a two-way pipe, not some network or serial connection with
>>> transmission delays userland has long experience in dealing with.
> 
>>> These previously internal additional delays, that are now exposed to
>>> userland, are simply an implementation detail that userland did not,
>>> and should not, need to worry about.
>>
>> Your mental model is that pseudo-terminals are a synchronous pipe, which
>> is not true.
>>
>> But this argument is pointless because the regression needs to be fixed
>> regardless of the merits.
> 
> Fair enough.
> 
> Anything new on this?

It's on my todo list.

While considering this issue further, I was curious what ssh does
regarding the entire foreground process group and its output?

If ssh only knows that the child has terminated, how does it wait
for the rest of the foreground process group's output since those
processes may not yet have received their SIGHUP/SIGCONT signals
yet?

Regards,
Peter Hurley

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1295062

FromMarc Aurele La France <tsi@tuyoix.net>
Date2015-12-18 18:30 +0100
Message-ID<qH70T-8A-27@gated-at.bofh.it>
In reply to#1295028
On Fri, 18 Dec 2015, Peter Hurley wrote:
> On 12/18/2015 06:26 AM, Marc Aurele La France wrote:
>> On Fri, 11 Dec 2015, Peter Hurley wrote:
>>> On 12/11/2015 05:37 AM, Marc Aurele La France wrote:

>>>> I am not asking to read data before it has been produced.  I am puzzled
>>>> that despite knowing that the data exists, I can now be lied to when I
>>>> try to retrieve it, when I wasn't before.  We are talking about what is
>>>> essentially a two-way pipe, not some network or serial connection with
>>>> transmission delays userland has long experience in dealing with.

>>>> These previously internal additional delays, that are now exposed to
>>>> userland, are simply an implementation detail that userland did not,
>>>> and should not, need to worry about.

>>> Your mental model is that pseudo-terminals are a synchronous pipe, which
>>> is not true.

>>> But this argument is pointless because the regression needs to be fixed
>>> regardless of the merits.

>> Fair enough.

>> Anything new on this?

> It's on my todo list.

> While considering this issue further, I was curious what ssh does
> regarding the entire foreground process group and its output?

> If ssh only knows that the child has terminated, how does it wait
> for the rest of the foreground process group's output since those
> processes may not yet have received their SIGHUP/SIGCONT signals
> yet?

sshd cannot know about the termination of any process other than the
session leader because any of the session leader's children are
re-parented to init.  The idea is to, at minimum, collect any output the
session leader might have left behind.  Yes, this could entail also
collecting output from its children that might have squeaked in, but
that's gravy that can't be avoided.

This situation is much simpler on the *BSDs.  There, both ends of the
pty pair are, in effect, completely closed after disassociation of either
end, preventing (with EIO) any further output (but still allowing data
already collected to be read, after which an EIO occurs).  It's
unfortunate System V variants don't do this, but that's crying over spilt
milk.

Marc.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web