develooper Front page | perl.perl5.porters | Postings from October 2014

[perl #123029] 5.20.x regression in "state" under PERL_NO_COW

Thread Previous
From:
Aaron Crane
Date:
October 21, 2014 17:37
Subject:
[perl #123029] 5.20.x regression in "state" under PERL_NO_COW
Message ID:
rt-4.0.18-5667-1413913011-130.123029-75-0@perl.org
# New Ticket Created by  Aaron Crane 
# Please include the string:  [perl #123029]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123029 >


Niels Larson reports that Perl 5.20 compiled with -DPERL_NO_COW has a regression with state variables: they get reset to undef when accessed:

sub no_PERL_NO_COW_regression {
    state $s;
    $s = 'foo';
    my $c = $s;
    return defined $s;
}
ok(no_PERL_NO_COW_regression(),
   "state variables don't surprisingly disappear when accessed");

Bisection reveals that the bug was introduced in 9ffd39ab75dd662df22fcdafbf7f740838acc898 (between 5.19.6 and 5.19.7), and fixed in c0683843e9299db25f354e2c8c90faa7614950d1 (between 5.21.4 and 5.21.5).

I'm creating this ticket so that (a) a regression test can mention it, and (b) the meta-ticket for 5.20.2 can depend on it.

-- 
Aaron Crane ** http://aaroncrane.co.uk/


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