develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #118277] Segfault/"Read-only-Variable"-Bug in Regex

Thread Previous
From:
Father Chrysostomos via RT
Date:
June 3, 2013 15:31
Subject:
[perl #118277] Segfault/"Read-only-Variable"-Bug in Regex
Message ID:
rt-3.6.HEAD-2552-1370273444-1281.118277-15-0@perl.org
On Mon Jun 03 01:56:10 2013, nok@ariva.de wrote:
> Hi,
> 
> I just had some program like this:
> 
> 
> use warnings;
> use strict;
> 
> re('/');
> 
> 
> sub re {
>          my $first_param = shift;
>          my $second_param = shift;
>          my $third_param = shift;
> 
>          my $re1 = qr/(?{ die "AAAAAAAAAAA" })/xi;
> 
>          if ($first_param =~ /$re1/ix) {
>                  return 1;
>          }
> }
> 
> For some weird reason, this gives me a segmentation fault, that seems to 
> be encountering in the eval-regex.
...
> The Perl-version we got here is v5.14.2 and we run debian 7 (Linux 
> 3.2.0-3-amd64 #1 SMP Mon Jul 23 02:45:17 UTC 2012 x86_64 GNU/Linux)

Exiting a regexp code block abnormally (via die, return, next, goto,
etc.) used to cause perl to become unstable and give unpredictable results.

This was fixed in perl 5.18.  Unfortunately, it is not possible to
backport the fix to a maintenance release, as it involved a complete
rewrite of the (?{})/(??{}) mechanism.

-
-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=118277

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About