Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 83441
Status: resolved
Worked: 3 min
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: BINGOS [...] cpan.org
Requestors: demerphq [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 6.64
Fixed in: (no value)



Subject: Improper modification of hash during each() traversal in t/basic.t
t/basic.t contains a subroutine called _normalize() which uses faulty logic to lowercase the keys in a hash that is being traversed with each(). This has never been legal, but due to implementation issues probably worked out such that the tests never failed. Changes coming in Perl 5.18 mean that this will fail regularly. Attached patch fixes the problem. This is a Perl 5.18 blocker ticket, so I am marking it as important.
Subject: 0001-Fix-code-which-modifies-a-hash-while-each-ing-over-i.patch
From 4cb7d89cba3a097922a81b30f3f5e481160e34b4 Mon Sep 17 00:00:00 2001 From: Yves Orton <demerphq@gmail.com> Date: Tue, 19 Feb 2013 12:12:34 +0100 Subject: [PATCH 1/2] Fix code which modifies a hash while each()ing over it It has never been correct to modify a hash during traversal by each(). In older perls this was unlikely to break the tests. In newer perls it is relatively likely, and in 5.18 it will be almost certain. This includes a version bump. Needs to be merged upstream. --- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm | 2 +- cpan/ExtUtils-MakeMaker/t/basic.t | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm index fbe854b..5bdd517 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm @@ -18,7 +18,7 @@ our @Overridable; my @Prepend_parent; my %Recognized_Att_Keys; -our $VERSION = '6.64_01'; +our $VERSION = '6.64_02'; $VERSION = eval $VERSION; # Emulate something resembling CVS $Revision$ diff --git a/cpan/ExtUtils-MakeMaker/t/basic.t b/cpan/ExtUtils-MakeMaker/t/basic.t index fb374c0..cd53c65 100644 --- a/cpan/ExtUtils-MakeMaker/t/basic.t +++ b/cpan/ExtUtils-MakeMaker/t/basic.t @@ -411,9 +411,5 @@ close SAVERR; sub _normalize { my $hash = shift; - - while(my($k,$v) = each %$hash) { - delete $hash->{$k}; - $hash->{lc $k} = $v; - } + %$hash= map { lc($_) => $hash->{$_} } keys %$hash; } -- 1.7.5.4
From: demerphq [...] gmail.com
On Tue Feb 19 06:39:31 2013, demerphq@gmail.com wrote: Show quoted text
> This is a Perl 5.18 blocker ticket, so I am marking it as important.
See also: https://rt.perl.org/rt3/Ticket/Display.html?id=116857
From: demerphq [...] gmail.com
On Tue Feb 19 06:39:31 2013, demerphq@gmail.com wrote: Show quoted text
> This is a Perl 5.18 blocker ticket, so I am marking it as important.
Gah, missed a change. New patch attached.
Subject: 0001-Fix-code-which-modifies-a-hash-while-each-ing-over-i.patch
From b23fbb6034fcc892c44527b955be9c682131de88 Mon Sep 17 00:00:00 2001 From: Yves Orton <demerphq@gmail.com> Date: Tue, 19 Feb 2013 12:12:34 +0100 Subject: [PATCH 1/3] Fix code which modifies a hash while each()ing over it It has never been correct to modify a hash during traversal by each(). In older perls this was unlikely to break the tests. In newer perls it is relatively likely, and in 5.18 it will be almost certain. This includes a version bump. Needs to be merged upstream. --- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm | 2 +- cpan/ExtUtils-MakeMaker/t/basic.t | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm index 68d19fa..f7c8f22 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm @@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue); # If we make $VERSION an our variable parse_version() breaks use vars qw($VERSION); -$VERSION = '6.64_01'; +$VERSION = '6.64_02'; $VERSION = eval $VERSION; require ExtUtils::MM_Any; diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm index fbe854b..5bdd517 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm @@ -18,7 +18,7 @@ our @Overridable; my @Prepend_parent; my %Recognized_Att_Keys; -our $VERSION = '6.64_01'; +our $VERSION = '6.64_02'; $VERSION = eval $VERSION; # Emulate something resembling CVS $Revision$ diff --git a/cpan/ExtUtils-MakeMaker/t/basic.t b/cpan/ExtUtils-MakeMaker/t/basic.t index fb374c0..cd53c65 100644 --- a/cpan/ExtUtils-MakeMaker/t/basic.t +++ b/cpan/ExtUtils-MakeMaker/t/basic.t @@ -411,9 +411,5 @@ close SAVERR; sub _normalize { my $hash = shift; - - while(my($k,$v) = each %$hash) { - delete $hash->{$k}; - $hash->{lc $k} = $v; - } + %$hash= map { lc($_) => $hash->{$_} } keys %$hash; } -- 1.7.5.4
Resolved now that 6.66 is out and in blead.