Skip Menu |
 

This queue is for tickets about the YAML-Syck CPAN distribution.

Report information
The Basics
Id: 41199
Status: resolved
Priority: 0/
Queue: YAML-Syck

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.05
Fixed in: (no value)



Subject: Dumping a filehandle leaks memory
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 200
Download (untitled) / with headers
text/plain 200b
This program leaks memory at a high rate: perl -le 'use YAML::Syck; while (){ open my $fh, "/etc/hosts" or die; YAML::Syck::Dump($fh)}' > /dev/null Let me know if you need further details. Thanks!
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-24143-1227605410-1587.41199-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 662
Download (untitled) / with headers
text/plain 662b
On Mon Nov 24 22:21:22 2008, ANDK wrote: Show quoted text
> This program leaks memory at a high rate: > > perl -le 'use YAML::Syck; while (){ open my $fh, "/etc/hosts" or die; > YAML::Syck::Dump($fh)}' > /dev/null > > Let me know if you need further details. > > Thanks!
Devel::Leak shows that it's leaking one SV per iteration. The SV dump looks like this: new 0x823d6f0 : SV = PVIV(0x823f0c0) at 0x823d6f0 REFCNT = 1 FLAGS = (POK,FAKE,READONLY,pPOK) IV = 1529493059 PV = 0x8239a78 "=" CUR = 1 LEN = 0 Checking the process memory also suggests that it's only this SV, per iteration it's leaking about 24 to 28 bytes, depending on perl/OS. Regards, Slaven
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-6782-1274354383-350.41199-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1517
Download (untitled) / with headers
text/plain 1.4k
On Mon Nov 24 22:21:22 2008, ANDK wrote: Show quoted text
> This program leaks memory at a high rate: > > perl -le 'use YAML::Syck; while (){ open my $fh, "/etc/hosts" or die; > YAML::Syck::Dump($fh)}' > /dev/null > > Let me know if you need further details.
A failing test would be nice, you could e.g. run it on linux only and check ps -o rss $$, then see if it's e.g. 2x what it used to be after a few thousand iterations. See also this boring form letter I'm pasting around: (This is a form-reply that isn't specific to your particular report) YAML::Syck has just acquired one new maintainer (me), it still doesn't have anyone that *cares* about it. But I'm willing to help solve your report & release a new version with the fix if it's easy for me. It now has a Git repository at: http://github.com/avar/YAML-Syck If your report is a patch that fixes a problem, great. Please remake the patch against Git by forking that repo and sending me a pull request on GitHub (or an update to this bug if you prefer git-format-patch(1) or some other repo provider..). Make sure to include a test for what you fixed. If your report is some code that fails (and you have a testcase for it) a patch against the test suite to demonstrate that failure would be very useful. It's OK if the test crashes and burns, see Test::More's docs for how to make TODO tests that fail now, but shouldn't. Even if it segfaults perl C<system $^X => qw/ -Mblib -MYAML::Syck .../> or something like that and checking the return value will do.
X-RT-Interface: REST
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
RT-Message-ID: <rt-4.0.18-11744-1494493139-4.41199-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 73
Ticket migrated to github as https://github.com/toddr/YAML-Syck/issues/42


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.