Skip Menu |

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 16105
Status: resolved
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: user2004 [...] bk.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.14
  • 1.16
  • 1.17
Fixed in: (no value)



Subject: Memory leak in first()
Distribution name and version: Scalar-List-Utils-1.17 Perl version: v5.8.7 OS: FreeBSD 5.4-RELEASE-p4 i386 Distribution name and version: Scalar-List-Utils-1.13 Perl version: v5.8.4 OS: Linux Knoppix 2.6.11 i686 Code: ------------------------------------------------------------ #!/usr/bin/perl use warnings; use strict; use Devel::Peek; use List::Util qw(first); my @list = (1, 2, 3, 4, 5); my $value = 1; print "BEFORE:\n---------------\n"; Dump($value); my $foo = first { $_ > $value } @list; print "AFTER:\n---------------\n"; Dump($value); ------------------------------------------------------------ Output: ------------------------------------------------------------ BEFORE: --------------- SV = IV(0x8076880) at 0x8057bf8 REFCNT = 1 FLAGS = (PADBUSY,PADMY,IOK,pIOK) IV = 1 AFTER: --------------- SV = IV(0x8076880) at 0x8057bf8 REFCNT = 2 FLAGS = (PADBUSY,PADMY,IOK,pIOK) IV = 1 ------------------------------------------------------------ REFCNT changed from 1 to 2. It's a bug, I mean.
From: Graham Barr <gbarr [...] pobox.com>
Subject: Re: [cpan #16105] Memory leak in first()
Date: Fri, 25 Nov 2005 10:59:57 -0600
To: bug-Scalar-List-Utils [...] rt.cpan.org
RT-Send-Cc:
This is fixed in 1.18 which has just been released to CPAN. Graham.