Bug 767931 - Reading from pipe finished early, when SIGALRM received
Summary: Reading from pipe finished early, when SIGALRM received
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-15 09:40 UTC by Šimon Lukašík
Modified: 2012-01-07 22:57 UTC (History)
10 users (show)

Fixed In Version: perl-5.14.2-193.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-07 22:57:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
The reproducer (345 bytes, text/plain)
2011-12-15 09:41 UTC, Šimon Lukašík
no flags Details
Strace of the reproducer (22.09 KB, text/plain)
2011-12-15 09:44 UTC, Šimon Lukašík
no flags Details
Fix (1013 bytes, patch)
2011-12-20 16:42 UTC, Petr Pisar
no flags Details | Diff

Description Šimon Lukašík 2011-12-15 09:40:25 UTC
Description of problem:
There is a regression in Perl interpreter on Fedora 16 (compared
to Fedora 15).  Please find attached a complete reproducer.

In brief, imagine the following snippet of code:

    local $SIG{'ALRM'} = \&callback;
    while (<PIPE>) {
        ;
    }

When multiple SIGALRM signals arrive during a single read() syscall.
The cycle is ended, even thought there are unread data in the pipe.

Version-Release number of selected component (if applicable):
Fedora 16
perl-5.14.2-191.fc16.x86_64

How reproducible:
Deterministic with the attached reproducer.

Steps to Reproduce:
1. # /usr/bin/perl reproducer.pl
2.
3.

Actual results:
Only a first 8kb of pipe is read. The reproducer.pl prints-out:
8192 bytes processed.


Expected results:
Whole pipe should be read. The reproducer.pl prints-out something like:
4132049 bytes processed.

Additional info:

Comment 1 Šimon Lukašík 2011-12-15 09:41:18 UTC
Created attachment 547150 [details]
The reproducer

Comment 2 Šimon Lukašík 2011-12-15 09:44:04 UTC
Created attachment 547151 [details]
Strace of the reproducer

Please note the line 248, where the read() syscall resumes from alarms
and sends 8192 bytes of data. Perl ends up the cycle immediately.

Comment 3 Marcela Mašláňová 2011-12-15 10:28:17 UTC
At least it's working with 5.10.x. I'll try bisect to find the rotten commit.

Comment 4 Šimon Lukašík 2011-12-15 10:33:49 UTC
I've already tried to rebuild perl-5.12.4-163 from Fedora 15 on Fedora 16
and the bug was not reproducible any more.

Comment 5 Petr Pisar 2011-12-20 16:42:34 UTC
Created attachment 548881 [details]
Fix

Marcela found this fix in development tree in commit be48bbe8d671b6841c3ec7cb734b98071afe3cd9.

Comment 6 Petr Pisar 2011-12-21 12:51:41 UTC
perl-5.14 / F17--16 affected only.

Comment 7 Fedora Update System 2011-12-21 13:07:56 UTC
perl-5.14.2-193.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/perl-5.14.2-193.fc16

Comment 8 Fedora Update System 2011-12-22 22:35:33 UTC
Package perl-5.14.2-193.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing perl-5.14.2-193.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-17271/perl-5.14.2-193.fc16
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2012-01-07 22:57:09 UTC
perl-5.14.2-193.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.