Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 28808
Status: resolved
Priority: 0/
Queue: YAML-LibYAML

People
Owner: Nobody in particular
Requestors: mail [...] maasha.dk
Cc:
AdminCc:

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



Subject: Fwd: Memory leak in YAML::XS 0.26
Date: Mon, 13 Aug 2007 16:40:45 +1000
To: bug-YAML-LibYAML [...] rt.cpan.org
From: "Martin A. Hansen" <mail [...] maasha.dk>
Show quoted text
---------- Forwarded message ---------- From: Martin A. Hansen <mail@maasha.dk> Date: Aug 13, 2007 4:39 PM Subject: Memory leak in YAML::XS 0.26 To: ingy@cpan.org Hi, There appear to be a terrible memory leak in YAML::XS (ver 0.26). To reproduce: perl -MYAML::XS -le 'while (1) { $foo = "x" x 100000; print Dump( $foo ) }'
> /dev/null
According to my activity monitor, memory is being eaten away at a fast pace! This is perl, v5.8.8 built for darwin-2level - MacOSX Is this a problem with YAML::XS - or the underlying libyaml? Best regards, Martin Asser Hansen Cand. Scient., PhD John Mattick Group Institute for Molecular Bioscience University of Queensland Australia E-mail: mail@maasha.dk Web: www.maasha.dk Phone: +61 07 3365238 Skype: martinasserhansen
Fixed by the attached patch. The dump return value wasn't mortalized.
Change 285496 by gisle@gisle-or on 2008/05/13 12:51:09 The YAML::XS::Dump() return value wasn't mortalized. Fixes http://rt.cpan.org/Ticket/Display.html?id=28808 Affected files ... ... //depot/main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c#5 edit Differences ... ==== //depot/main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c#5 (text) ==== Index: main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c --- main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c.~1~ Tue May 13 21:51:44 2008 +++ main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c Tue May 13 21:51:44 2008 @@ -493,8 +493,10 @@ yaml_emitter_delete(&dumper.emitter); /* Put the YAML stream scalar on the XS output stack */ - if (yaml) + if (yaml) { + sv_2mortal(yaml); XPUSHs(yaml); + } PUTBACK; } End of Patch.
Resolved in 0.27. Thanks gisle.