Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: xmltwig [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.18
  • 1.19
Fixed in: (no value)



Subject: Segfault when a variable is destroyed after using weaken a large number of times (between 23K and 24K)
Download (untitled) / with headers
text/plain 1.1k
As per the descriptive title. I create a tree with a single root and thousands of children. The link from the root to the first child is strong, as is the link from each node to its next sibling. The link from each node to the root is weakened. The program crashes when the root goes out of scope. See the attached code which tries to find the esact number. Change the $NB_ELT_INIT and the $STEP values to find it. Note that the limit can vary (23790 and 23810 in my limited tests). I had the same problem with XML::Twig, which also builds a tree, at about the same number of nodes. Twig uses weaken several times for each node though, so that might be an element. Note that it is not the total number of weaken that counts, just the number in the block in which the variables are in scope. This behaviour happens in Scalar::Util 1.18 and 1.19 perl -v: This is perl, v5.8.8 built for i486-linux-gnu-thread-multi Note that I have had reports of bugs in XML::Twig that look suspiciously like they could come from this problem, on various machines (just today: Solaris in c.l.p.m, perl 5.8.5 and 5.8.8, and perl v5.8.7 built for i386-freebsd-64int by mail). I hope that helps __ mirod
Subject: gen_internal_big_doc
Download gen_internal_big_doc
application/octet-stream 751b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #28365] Segfault when a variable is destroyed after using weaken a large number of times (between 23K and 24K)
Date: Wed, 18 Jul 2007 19:09:07 -0500
To: bug-Scalar-List-Utils [...] rt.cpan.org
From: Graham Barr <gbarr [...] pobox.com>
Download (untitled) / with headers
text/plain 280b
On Jul 18, 2007, at 9:51 AM, via RT wrote: Show quoted text
> As per the descriptive title.
Scalar::Util::weaken is just giving access to a C function inside perl. If there is a bug with weak references then it should be reported using the perlbug script to report a core perl bug. Graham.
Subject: Re: [rt.cpan.org #28365] Segfault when a variable is destroyed after using weaken a large number of times (between 23K and 24K)
Date: Thu, 19 Jul 2007 03:41:14 +0200
To: bug-Scalar-List-Utils [...] rt.cpan.org
From: "Michel Rodriguez" <xmltwig [...] gmail.com>
Download (untitled) / with headers
text/plain 474b
On 7/19/07, Graham Barr via RT <bug-Scalar-List-Utils@rt.cpan.org> wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=28365 > > > On Jul 18, 2007, at 9:51 AM, via RT wrote:
> > As per the descriptive title.
> > Scalar::Util::weaken is just giving access to a C function inside > perl. If there is a bug with weak references then it should be > reported using the perlbug script to report a core perl bug.
Thanks Graham, I have just sent the bug report. -- mirod
closing old ticket


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.