Skip Menu |
 

This queue is for tickets about the XML-LibXSLT CPAN distribution.

Report information
The Basics
Id: 71345
Status: open
Priority: 0/
Queue: XML-LibXSLT

People
Owner: Nobody in particular
Requestors: fschlich [...] zedat.fu-berlin.de
Cc:
AdminCc:

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



Subject: segfault in free()
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1317329235-3047-30"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 462
Download (untitled) / with headers
text/plain 462b
Hi, I'm forwarding http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568382 "I'm now becoming convinced that this is a memory management issue between Perl and libxslt - I think that both are trying to free the same objects..." / "I'm guessing that this means it's possibly Perl's garbage collection interfering?" Of the attached samples, 568382a.pl runs ok, whereas 568382a1.pl with only minimal changes ("push @keep, @_;" removed) causes a segfault. Florian
Subject: 568382a.pl
MIME-Version: 1.0
Content-Type: application/x-perl; name="568382a.pl"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="568382a.pl"
Content-Transfer-Encoding: base64
Content-Length: 922
Download 568382a.pl
text/x-perl 922b
#!/usr/bin/perl -w use strict; use warnings; use XML::LibXSLT; use XML::LibXML; my $xslt = XML::LibXSLT->new(); my $ext_uri = "urn:local"; my @keep; XML::LibXSLT->register_function($ext_uri, "uc", sub { push @keep, @_; return uc shift; } ); my $stylesheet = $xslt->parse_stylesheet(XML::LibXML->load_xml(string => <<'EOF')); <xsl:stylesheet version="1.0" extension-element-prefixes="exsl local" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:local="urn:local"> <xsl:template match="/"> <xsl:variable name="foo"><foo a="foo"/></xsl:variable> <bar><xsl:value-of select="local:uc(exsl:node-set($foo)//@a)"/></bar> </xsl:template> </xsl:stylesheet> EOF my $input = XML::LibXML->load_xml(string => "<input/>"); print $stylesheet->transform($input)->toString; # Next line crashes Perl @keep = undef;
Subject: 568382a1.pl
MIME-Version: 1.0
Content-Type: application/x-perl; name="568382a1.pl"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="568382a1.pl"
Content-Transfer-Encoding: base64
Content-Length: 906
Download 568382a1.pl
text/x-perl 906b
#!/usr/bin/perl -w use strict; use warnings; use XML::LibXSLT; use XML::LibXML; my $xslt = XML::LibXSLT->new(); my $ext_uri = "urn:local"; my @keep; XML::LibXSLT->register_function($ext_uri, "uc", sub { return uc shift; } ); my $stylesheet = $xslt->parse_stylesheet(XML::LibXML->load_xml(string => <<'EOF')); <xsl:stylesheet version="1.0" extension-element-prefixes="exsl local" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:local="urn:local"> <xsl:template match="/"> <xsl:variable name="foo"><foo a="foo"/></xsl:variable> <bar><xsl:value-of select="local:uc(exsl:node-set($foo)//@a)"/></bar> </xsl:template> </xsl:stylesheet> EOF my $input = XML::LibXML->load_xml(string => "<input/>"); print $stylesheet->transform($input)->toString; # Next line crashes Perl @keep = undef;
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-2602-1317971685-403.71345-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
From: fschlich [...] zedat.fu-berlin.de
X-RT-Original-Encoding: utf-8
Content-Length: 235
Download (untitled) / with headers
text/plain 235b
Show quoted text
> Of the attached samples, 568382a.pl runs ok, whereas 568382a1.pl with > only minimal changes ("push @keep, @_;" removed) causes a segfault.
perhaps interestingly, with recently-released XML::LibXSLT 1.72, both examples now segfault
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-2598-1319813806-1998.71345-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 162
Download (untitled) / with headers
text/plain 162b
I've written a fix for this here: https://bitbucket.org/timbrody/perl-xml-libxslt/changeset/95fe5c0be0ae See the commit log for what I think caused the segfault.
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-2598-1319813806-1998.71345-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.8.HEAD-2598-1319813806-1998.71345-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2601-1319815322-99.71345-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 752
Download (untitled) / with headers
text/plain 752b
Hi Tim, On Fri Oct 28 10:56:46 2011, TIMBRODY wrote: Show quoted text
> I've written a fix for this here: > https://bitbucket.org/timbrody/perl-xml-libxslt/changeset/95fe5c0be0ae > > See the commit log for what I think caused the segfault.
Many thanks for the fix! You're awesome. Some notes, however for next time: 1. The fix should include a description of the modifications in the "Changes" file. 2. The newly added files (the t/*.t in our case) should be added to the MANIFEST. 3. The test assertions should include a blurb. 4. The test assertions should include a leading Test-Count "# TEST" annotation. I will fix all those myself this time, but please pay attention next time. Maybe I'll add all of those to a HACKING document. Regards, -- Shlomi Fish


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.