Skip Menu |

This queue is for tickets about the Net-OpenSSH CPAN distribution.

Report information
The Basics
Id: 86901
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Net-OpenSSH

People
Owner: Nobody in particular
Requestors: victor [...] vsespb.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: sysread/write not protected from EINTR
I see sysread/syswrite in code, but I don't see protection from EINTR
Subject: Re: [rt.cpan.org #86901] sysread/write not protected from EINTR
Date: Sun, 14 Jul 2013 08:50:53 -0700 (PDT)
To: "bug-Net-OpenSSH [...] rt.cpan.org" <bug-Net-OpenSSH [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message -----
> From: Victor Efimov via RT <bug-Net-OpenSSH@rt.cpan.org> > To: > Cc: > Sent: Friday, July 12, 2013 10:25 PM > Subject: [rt.cpan.org #86901] sysread/write not protected from EINTR > > Fri Jul 12 16:25:30 2013: Request 86901 was acted upon. > Transaction: Ticket created by vsespb >       Queue: Net-OpenSSH >     Subject: sysread/write not protected from EINTR >   Broken in: (no value) >     Severity: (no value) >       Owner: Nobody >   Requestors: victor@vsespb.ru >       Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86901 > > > > I see sysread/syswrite in code, but I don't see protection from EINTR
They operate on a non-blocking socket. AFAIK, non-blocking operations never return EINTR.
From: victor [...] vsespb.ru
Ok, maybe, although it's hard to tell if this true for all Unixes. But what about EAGAIN then? Seems, after successful select(), read() can still return EAGAIN. http://www.linuxmisc.com/9-unix-programmer/8c2366becf0f7d99.htm http://stackoverflow.com/questions/13539066/can-write-to-a-non-blocking-fd-return-eagain-when-select-reports-it-as-writabl http://code.google.com/p/picocom/issues/detail?id=13 And in this case seems you just close socket? my $read = sysread($out, $bout, 20480, $offset); if ($debug and $debug & 64) { _debug "stdout, bytes read: ", $read, " at offset $offset"; $read and $debug & 128 and _hexdump substr $bout, $offset; } unless ($read) { close $out; On Sun Jul 14 19:51:08 2013, sfandino@yahoo.com wrote: Show quoted text
> > > > > ----- Original Message -----
> > From: Victor Efimov via RT <bug-Net-OpenSSH@rt.cpan.org> > > To: > > Cc: > > Sent: Friday, July 12, 2013 10:25 PM > > Subject: [rt.cpan.org #86901] sysread/write not protected from EINTR > > > > Fri Jul 12 16:25:30 2013: Request 86901 was acted upon. > > Transaction: Ticket created by vsespb > >       Queue: Net-OpenSSH > >     Subject: sysread/write not protected from EINTR > >   Broken in: (no value) > >     Severity: (no value) > >       Owner: Nobody > >   Requestors: victor@vsespb.ru > >       Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86901 > > > > > > > I see sysread/syswrite in code, but I don't see protection from
> EINTR > > They operate on a non-blocking socket. AFAIK, non-blocking operations > never return EINTR. >
On Sun Jul 14 15:24:53 2013, vsespb wrote: Show quoted text
> Ok, maybe, although it's hard to tell if this true for all Unixes. > > But what about EAGAIN then? Seems, after successful select(), read() > can still return EAGAIN.
Yes, both EAGAIN and EWOULDBLOCK errors may happen. I have released a new development version that handles them: https://metacpan.org/release/SALVA/Net-OpenSSH-0.61_07