Hi,
I've installed XML::LibXSLT-1.63 and XML::LibXML-1.65 on Solaris and can successfully transform XML documents through XSL stylesheets.
However, once XML::LibXSLT::transform() has been called, Perl coredumps (both in command line and under mod_perl) when it exits the scope of the XML parser and the XSLT object and tries to dispose of them.
Here is a small test script:
#!/bin/perl
use XML::LibXML;
use XML::LibXSLT;
my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
my $source = $parser->parse_string(<<'EOT');
<hello>
<msg>Hello LibXSLT</msg>
</hello>
EOT
my $styledoc = $parser->parse_string(<<'EOT');
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="hello/msg"/>
</xsl:template>
</xsl:stylesheet>
EOT
my $stylesheet = $xslt->parse_stylesheet($styledoc);
# up to this line, LibXSLT does not cause Perl to core dump
my $result = $stylesheet->transform($source);
print STDOUT "transformed document " . $result->toString();
# Hello LibXSLT appears in the standard output
# however, once transform() has been called, Perl will core dump when
# trying to dispose of $parser and $xslt after exiting this scope
exit();
Here is the backtrace I get from the core file when the example above is run in command line:
gdb /bin/perl core
bt
#0 0xfef8857c in xmlDictOwns (dict=0x134440, str=0x138610 "Hello LibXSLT") at dict.c:872
#1 0xfeed36fc in xmlFreeNodeList (cur=0x139718) at tree.c:3397
#2 0xfeed0b74 in xmlFreeDoc (cur=0x139400) at tree.c:1224
#3 0xfee0bab8 in PmmFreeNode ()
from {perl_install_path}/perl-5.8.6/lib/site_perl/5.8.6/sun4-solaris/auto/XML/LibXML/LibXML.so
#4 0xfee0bc78 in PmmREFCNT_dec ()
from {perl_install_path}/perl-5.8.6/lib/site_perl/5.8.6/sun4-solaris/auto/XML/LibXML/LibXML.so
#5 0xfeded1b0 in XS_XML__LibXML__Node_DESTROY ()
from {perl_install_path}/perl-5.8.6/lib/site_perl/5.8.6/sun4-solaris/auto/XML/LibXML/LibXML.so
#6 0x00089d20 in Perl_pp_entersub ()
#7 0x00028f8c in S_call_body ()
#8 0x00028cac in Perl_call_sv ()
#9 0x00092eb0 in Perl_sv_clear ()
#10 0x000936ac in Perl_sv_free ()
#11 0x00097800 in Perl_sv_unref_flags ()
#12 0x0009168c in Perl_sv_force_normal_flags ()
#13 0x000ac5d8 in Perl_leave_scope ()
#14 0x000aa144 in Perl_pop_scope ()
#15 0x0002cec4 in S_my_exit_jump ()
#16 0x0002cc64 in Perl_my_exit ()
#17 0x000b4af4 in Perl_pp_exit ()
#18 0x00081928 in Perl_runops_standard ()
#19 0x000284cc in S_run_body ()
#20 0x000280e8 in perl_run ()
#21 0x00024ce0 in main ()
Is there something I missed during the installation or is it an issue with LibXSLT? |