[Bug 849703] New: Regular Expression matching in signal handler causes side-effects

bugzilla at redhat.com bugzilla at redhat.com
Mon Aug 20 16:01:30 UTC 2012


https://bugzilla.redhat.com/show_bug.cgi?id=849703

            Bug ID: 849703
        QA Contact: extras-qa at fedoraproject.org
          Severity: unspecified
           Version: 16
          Priority: unspecified
                CC: cweyl at alumni.drew.edu, iarnell at gmail.com,
                    jplesnik at redhat.com, kasal at ucw.cz, lkundrak at v3.sk,
                    mmaslano at redhat.com,
                    perl-devel at lists.fedoraproject.org, ppisar at redhat.com,
                    psabata at redhat.com, rc040203 at freenet.de,
                    tcallawa at redhat.com
          Assignee: mmaslano at redhat.com
           Summary: Regular Expression matching in signal handler causes
                    side-effects
        Regression: ---
      Story Points: ---
    Classification: Fedora
                OS: Unspecified
          Reporter: tim at electronghost.co.uk
              Type: Bug
     Documentation: ---
          Hardware: Unspecified
        Mount Type: ---
            Status: NEW
         Component: perl
           Product: Fedora

Description of problem:

Executing an RE inside a PERL deferred signal handler causes an unwanted side
effect on RE-execution in the code that was being executed when the signal
arrived. 

Version-Release number of selected component (if applicable):

"This is perl 5, version 14, subversion 2 (v5.14.2) built for
x86_64-linux-thread-multi"

How reproducible:

Always

Steps to Reproduce:

Here is a test case:

====== CUT HERE ======
#!/usr/bin/env perl

sub sighup {
    my $bar="This-Has-Dashes-HUP";
    $bar=~s/.*-//;
    print "$bar\n";

}

$SIG{'HUP'}=\&sighup;

while (1) {
    my $foo="This:Has:Colons";
    $foo=~s/.*://;
    if ($foo=~m/:/) {
        print "BUG!!: $foo\n";
    }
}
====== CUT HERE ======

Run this endless loop and arrange to send it a SIGHUP once per second.


Actual results:

You will see output like the following:

bash$ perl ./t.pl
HUP
HUP
HUP
HUP
BUG!!: This:Has:Colons
HUP
HUP
BUG!!: This:Has:Colons
HUP
BUG!!: This:Has:Colons
HUP
BUG!!: This:Has:Colons
HUP
HUP
BUG!!: This:Has:Colons
HUP
BUG!!: This:Has:Colons
HUP
HUP
BUG!!: This:Has:Colons
HUP
HUP
HUP
BUG!!: This:Has:Colons


Expected results:

You should get output like this (observed on "This is perl 5, version 12,
subversion 4 (v5.12.4) built for x86_64-linux-thread-multi" from Fedora 15):

bash$ perl ./t.pl
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP
HUP

Additional info:

This is not a crash, like 809796, though they are very likely related or the
same problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the perl-devel mailing list