Bug 767931

Summary: Reading from pipe finished early, when SIGALRM received
Product: [Fedora] Fedora Reporter: Šimon Lukašík <slukasik>
Component: perlAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: cweyl, iarnell, jpazdziora, kasal, lkundrak, mmaslano, ppisar, psabata, rc040203, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-5.14.2-193.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-07 22:57:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The reproducer
none
Strace of the reproducer
none
Fix none

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.