Bug#1143215: sysread calls should check for EINTR

gregor herrmann gregoa at debian.org
Sat Aug 1 23:20:46 BST 2026


On Sat, 01 Aug 2026 01:06:11 +0100, Ian Jackson wrote:

>Here's some of the code in Simple.pm:
>
>    while ( sysread( STDIN, my $buff, 1 ) ) {
>        last if $buff eq "\n";
>        $chunk .= $buff;
>    }
>
>Suppose a signal arrives while this is executing, but doesn't cause
>perl to exit or anything.  Perl's signal handling machinery doesn't
>set SA_RESTART nowadays.  read(2) will return -1 setting errno to
>EINTR.  And then this will fail.
>
>(Normal perl IO operations, so not sysread and syswrite, have the
>:perlio layer which does retrying on EINTR, so are fine.)
>
>IMO HTTP::Server::Simple ought to handle EINTR from sysread (returns
>undef, sets $!) by restarting teh call.

Thanks for you bug report, which I've forwarded to
https://rt.cpan.org/Ticket/Display.html?id=180563

Given that upstream doesn't seem to be very active …

>I could try to prepare a patch, if you like.

… this would be great.


Cheers,
gregor

-- 
  .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
  : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
  `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
    `-   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: Digital Signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-perl-maintainers/attachments/20260802/fc98b022/attachment.sig>


More information about the pkg-perl-maintainers mailing list