Skip Menu |

This queue is for tickets about the Devel-Size CPAN distribution.

Report information
The Basics
Id: 17586
Status: resolved
Worked: 5 min
Priority: 0/
Queue: Devel-Size

People
Owner: TELS [...] cpan.org
Requestors: nospam-abuse [...] bloodgate.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.64
Fixed in: 0.66



Subject: Reports wrong size for strings after '.= ""'
# perl -MDevel::Size=size -le '$a = 122; $a .= ""; print $a," " , size($a)' 122 154 # perl -MDevel::Size=size -le '$a = 12; $a .= ""; print $a," " , size($a)' 12 43 The size varies wildly even tho the string is only one byte different ("122" vs "12"). For comparisation # perl -MDevel::Size=size -le 'print size("12")' 27 # perl -MDevel::Size=size -le 'print size("122")' 28 perl -MDevel::Size\ 99 Devel::Size version 99 required--this is only version 0.64. BEGIN failed--compilation aborted. # perl -v This is perl, v5.8.6 built for i686-linux Copyright 1987-2004, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. I first notice the issue (but couldn't find out the exact details) when a memory comparisation for Graph::Easy reported suddenly about twice the memory used after an upgrade to Devel::Size. If I can send in additional details, please let me know. Best wishes, Tels
From: nelhage [...] MIT.EDU
The problem is solved by the fix in 0.64 to handle PVIV sizes. Adding the SvIVX to the size is only appropriate iff the OOK flag is set, indicating the offset hack is in effect (see SvOOK in perlapi). The attached patch makes Devel::Size handle such scalars correctly.
--- Devel-Size-0.64/Size.xs 2007-02-07 00:30:06.000000000 -0500 +++ Devel-Size/Size.xs 2007-02-07 00:37:28.000000000 -0500 @@ -400,7 +400,8 @@ case SVt_PVIV: total_size += sizeof(XPVIV); total_size += SvLEN(thing); - total_size += SvIVX(thing); + if(SvOOK(thing)) + total_size += SvIVX(thing); break; /* A string with a float part? */ case SVt_PVNV:
Subject: Re: [rt.cpan.org #17586] Reports wrong size for strings after '.= ""'
Date: Wed, 7 Feb 2007 18:50:01 +0100
To: bug-Devel-Size [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Moin, On Wednesday 07 February 2007 06:47:10 Nelson Elhage via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=17586 > > > The problem is solved by the fix in 0.64 to handle PVIV sizes. Adding > the SvIVX to the size is only appropriate iff the OOK flag is set, > indicating the offset hack is in effect (see SvOOK in perlapi). The > attached patch makes Devel::Size handle such scalars correctly.
Thank you, I had already forgotten I filed that bugreport. When can I expect a new release? :) best wishes, tels - -- Signed on Wed Feb 7 18:49:33 2007 with key 0x93B84C15. View my photo gallery: http://bloodgate.com/photos PGP key on http://bloodgate.com/tels.asc or per email. "A Thaum is the basic unit of magical strength. It has been universally established as the amount of magic needed to create one small white pigeon or three normal-sized billiard balls." -- Terry Pratchett -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iQEUAwUBRcoRSXcLPEOTuEwVAQICGwf3TNDWbVBYnFkhqEIguymVsOirCv/5stR3 5dvs7ZBkM7UWQK2TjSZbB6eeKkrinF/HtH53Pc5OAgkKdID717CMfUcW5Bjgj7F+ T+ChD/3uQ7P7GbiHayAw3hkDcxcS0F9W/lnupiV48hXR7Jk0B1sx+6wWCUek+tB1 TmwbcpIbwNwDoTsAs65gW31o8WvuFY8QzY26tQrswbVuID0MtgldU4osnNxda51y 5j1BfvNRO70jkK6G23OK318xFq2Nc8kVDhpIhu+GF1ISZFvDI9vkN5L0FRSDCnxX VzoaIA8M9QdQuH6S0suhDvErlRgzNUvczzk9iM6nA5ew79BTOZzq =seKe -----END PGP SIGNATURE-----
The patch has been applied and this issue was fixed in 0.65.