|
Re: XML::LibXSLT registered functions: a preliminary fix: msg#00036lang.perl.xml
(While in the middle of a reply to Robin, which will show up later in the list) At 17:02 +0100 12/11/03, Petr Pajas wrote: I'm sorry for joining this discussion so late, I'm being too busy You're welcome... I hope I can also be part of the solution... ;-) Robin Berjon <robin.berjon@xxxxxxxxx> writes: I agree with that it would be nice. However, at this point in time, my goal is to get it right for LibXSLT, as my customer is committed to that... ... The only real That indeed looks like a bug to me, yes... Also, it should be noted, that Liz's workaround is only needed for It only ever was intended for LibXSLT. I do appreciate Elizabeth's code (there are certaninly some nice Agreed. Strangely enough, I'm able to reproduce the problem even when the Please note that in 5.8.2, there is a bug with completely empty subroutines. This may or may not be related to that. Does this happen in < 5.8.2 also? In this case, the nodeset passed to the extension function originates I don't think that's what I'm seeing: to test I just redefined XML::LibXML::Node::DESTROY and just had it display the refaddr of the object being destroyed. As soon as the Perl sub is finished, the "cloned" node is destroyed, which apparently frees up libxml structures when it shouldn't (judging from the valgrind output). If Perl returns some nodes, they are clonned as well. Liz, you My fix was only for nodes passed _to_ the Perl sub, _not_ when returned from it. That seems to be fixed in the CVS version, albeit maybe with memory leaks (as Matt Sergeant seems to indicate). >> I've traced this problem to DESTROY being called on the node that Destruction happens at the end of the extension call... and why the nodes (which have been cloned by LibXSLT) are still part of Maybe they aren't cloned? (I'm on a limb here) One more note: The problem with the approach used in Liz's code is, Well, that's the odd thing. If I run my sample program with XML::LibXSLT::Functions under valgrind with leak-checks enabled, I get: ==32189== 112 bytes in 1 blocks are definitely lost in loss record 12 of 30 ==32189== at 0x400296B2: malloc (vg_replace_malloc.c:153) ==32189== by 0x80A1750: Perl_my_setenv (in /usr/local/bin/perl5.8.2-unthreaded) ==32189== by 0x805FD91: perl_parse (in /usr/local/bin/perl5.8.2-unthreaded) ==32189== by 0x805E257: main (in /usr/local/bin/perl5.8.2-unthreaded) ==32189== ==32189== ==32189== 124 bytes in 1 blocks are definitely lost in loss record 13 of 30 ==32189== at 0x400296B2: malloc (vg_replace_malloc.c:153) ==32189== by 0x80A31EB: Perl_safesysmalloc (in /usr/local/bin/perl5.8.2-unthreaded) ==32189== by 0x80947ED: Perl_pregcomp (in /usr/local/bin/perl5.8.2-unthreaded) ==32189== by 0x80D1325: Perl_pp_regcomp (in /usr/local/bin/perl5.8.2-unthreaded) which seem to indicate problems with Perl leaking itself, rather than anything libxml / XML::LibXML related. The first leak also happens if you do: valgrind --leak-check=yes perl -e '1' so that one should basically be ignored. ;-) So anyone willing to help me with further investigation of this issue Check out my next mail... Liz _______________________________________________ Perl-XML mailing list Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: XML::LibXSLT registered functions: a preliminary fix, Petr Pajas |
|---|---|
| Next by Date: | Re: XML::LibXSLT registered functions: a preliminary fix, Elizabeth Mattijsen |
| Previous by Thread: | Re: XML::LibXSLT registered functions: a preliminary fix, Petr Pajas |
| Next by Thread: | Re: XML::LibXSLT registered functions: a preliminary fix, Petr Pajas |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |