|
Re: XML::LibXML-1.56: msg#00029lang.perl.xml
Hi again, On Wednesday 10 December 2003 13:06, Petr Pajas wrote: > Hi Joachim, All, > > can you please try to reproduce the problem with latest CVS version of > LibXML and LibXSLT? > > cvs -z3 -d:pserver:anonymous@xxxxxxxxx:/home/cvs co XML-LibXML > OK just testet the cvs version. no changes (see below) :-( [XML-LibXSLT-1.53][jmbdev]# gdb perl GNU gdb 6.0 Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...(no debugging symbols found)... (gdb) set args t/10functions.t (gdb) run Starting program: /usr/bin/perl t/10functions.t (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...1..14 (no debugging symbols found)...[New Thread 1024 (LWP 7746)] ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 7746)] PmmREFCNT_dec (node=0x30312f74) at perl-libxml-mm.c:241 241 retval = PmmREFCNT(node)--; (gdb) bt #0 PmmREFCNT_dec (node=0x30312f74) at perl-libxml-mm.c:241 #1 0x402fddb3 in PmmREFCNT_dec (node=0x82ee7b0) at perl-libxml-mm.c:269 #2 0x402f1912 in XS_XML__LibXML__Node_DESTROY (cv=0x82cfee4) at LibXML.xs:3448 #3 0x0809c70c in Perl_pp_entersub () #4 0x0805cdb5 in S_call_body () #5 0x0805cb96 in perl_call_sv () #6 0x080a269d in Perl_sv_clear () #7 0x080a2bae in Perl_sv_free () #8 0x080a2952 in Perl_sv_clear () #9 0x080a2bae in Perl_sv_free () #10 0x080b3b76 in Perl_free_tmps () #11 0x4031139e in LibXSLT_generic_function () from /usr/local/lib/perl/5.6.1/auto/XML/LibXSLT/LibXSLT.so #12 0x402406af in xmlXPathCompOpEval (ctxt=0x82ee440, op=0x82ea5c8) at xpath.c:10218 #13 0x40240e89 in xmlXPathCompOpEval (ctxt=0x82ee440, op=0x82ea5f0) at xpath.c:10503 #14 0x402411c9 in xmlXPathRunEval (ctxt=0x82ee440) at xpath.c:10621 #15 0x402414ec in xmlXPathCompiledEval (comp=0x8101e20, ctx=0x82eba40) at xpath.c:10789 #16 0x40334e53 in xsltValueOf (ctxt=0x82eb918, node=0x8101fb0, inst=0x8101e40, comp=0x8101d58) at transform.c:2830 #17 0x40332fa0 in xsltApplyOneTemplate (ctxt=0x82eb918, node=0x8101fb0, list=0x82e8160, templ=0x82eb308, params=0x0) at transform.c:1519 #18 0x40332d75 in xsltProcessOneNode (ctxt=0x82eb918, node=0x8101fb0, params=0x0) at transform.c:1358 #19 0x4033651f in xsltApplyStylesheetInternal (style=0x82e9510, doc=0x8101fb0, params=0xbffff2b0, output=0x0, profile=0x0, userCtxt=0x0) at transform.c:3919 #20 0x4033687a in xsltApplyStylesheet (style=0x82e9510, doc=0x8101fb0, params=0xbffff2b0) at transform.c:4058 #21 0x40311f14 in XS_XML__LibXSLT__Stylesheet_transform () from /usr/local/lib/perl/5.6.1/auto/XML/LibXSLT/LibXSLT.so #22 0x0809c70c in Perl_pp_entersub () #23 0x08097090 in Perl_runops_standard () #24 0x0805c565 in S_run_body () #25 0x0805c2cb in perl_run () #26 0x08059ca0 in main () (gdb) thx & best regards, ~/joachim > PmmREFCNT_dec is the most usual place of crashes because most freeing > happens there. It doesn't imply the problem is in PmmREFCNT_dec. > > Maybe I didn't follow this thread carefully enough, but I think the > subject isn't correct here. If the sigsegv happens within LibXSLT's > self tests on functions, it is most probably problem related to > LibXSLT not LibXML. > > -- Petr > > Joachim Bauernberger <jbauernberger@xxxxxxxxxxxxxxxx> writes: > > Hi, > > > > sill me!!! > > > > <duh>I got the subject of this thread wrong....</duh> > > > > What I'm are debugging here is XML::LibXML-1.56 + XML::LibXSLT-1.53 > > (XML::LibXML-1.53 is probably fine I dunno ...) > > > > Regards, > > ~/joachim > > > > On Wednesday 10 December 2003 12:24, Joachim Bauernberger wrote: > >> Hi, > >> > >> i just had some spare time and was able to confine the problem further > >> to the PmmREFCNT_dec() function in perl-libxml-mm.c of XML-LibXML-1.56: > >> > >> I have added some debug printf statements to demonstrate where it > >> crashes > >> > >> /* decrements the proxy counter. if the counter becomes zero or less, > >> this method will free the proxy node. If the node is part of a > >> subtree, PmmREFCNT_def will fix the reference counts and delete > >> the subtree if it is not required any more. > >> */ > >> int > >> PmmREFCNT_dec( ProxyNodePtr node ) > >> { > >> xmlNodePtr libnode = NULL; > >> ProxyNodePtr owner = NULL; > >> int retval = 0; > >> > >> if ( node != NULL && node) { > >> printf("## Before PmmREFCNT(node)\n"); > >> retval = PmmREFCNT(node)--; > >> printf("## node->count=%d\n",node->count); > >> printf("## PmmREFCNT(node)=%d\n",PmmREFCNT(node)); > >> printf("## retval=%d\n",retval); > >> if ( PmmREFCNT(node) <= 0 ) { > >> xs_warn( "NODE DELETATION\n" ); > >> libnode = PmmNODE( node ); > >> if ( libnode != NULL ) { > >> if ( libnode->_private != node ) { > >> xs_warn( "lost node\n" ); > >> libnode = NULL; > >> } > >> else { > >> libnode->_private = NULL; > >> } > >> } > >> > >> PmmNODE( node ) = NULL; > >> if ( PmmOWNER(node) && PmmOWNERPO(node) ) { > >> xs_warn( "DOC NODE!\n" ); > >> owner = PmmOWNERPO(node); > >> PmmOWNER( node ) = NULL; > >> if( libnode != NULL && libnode->parent == NULL ) { > >> /* this is required if the node does not directly > >> * belong to the document tree > >> */ > >> xs_warn( "REAL DELETE" ); > >> PmmFreeNode( libnode ); > >> } > >> xs_warn( "decrease owner" ); > >> > >> /* > >> > >> At this point owner is a dangling pointer which will crash when > >> dereferencing it in the next call to PmmREFCNT_dec( ) -> remember this > >> func is recursive ... > >> */ > >> > >> printf("## Before 1 PmmREFCNT_dec(owner)\n"); > >> PmmREFCNT_dec( owner ); > >> > >> /* we won't get here */ > >> printf("## After 1 PmmREFCNT_dec()\n"); > >> } > >> else if ( libnode != NULL ) { > >> xs_warn( "STANDALONE REAL DELETE" ); > >> PmmFreeNode( libnode ); > >> } > >> Safefree( node ); > >> /* free( node ); */ > >> } > >> } > >> else { > >> xs_warn("lost node" ); > >> } > >> printf ("Returning retval=%d\n",retval); > >> return retval; > >> } > >> > >> > >> ~~~~~~~~~~~~~~~~~~~~~ > >> ~~~~~~~~~~~~~~~~~~~~~ > >> > >> Having a quick look at the state of "owner" shows that it is probably > >> not fit for being passwd around: > >> > >> (gdb) p *node->owner > >> $10 = {_private = 0x30312f74, type = 1668183398, name = 0x6e6f6974 > >> <Address 0x6e6f6974 out of bounds>, children = 0x742e73, last = > >> 0x4015a6e8, parent = 0x41, next = 0x0, > >> prev = 0x0, doc = 0x0, ns = 0x0, content = 0x0, properties = 0x0, > >> nsDef = 0x82eb5e8} > >> > >> But where does owner get srewed up in the first place? I doubt that it's > >> anywhere in perl-libxml-mm.c !! > >> > >> I will try to look deeper into this when I have more time at hand, -> > >> also I am not familiar with the code so the person who wrote this might > >> be able to spot the problem faster than me ... > >> > >> Note that you have to add the -g switch to CFLAGS in the XML-LibXML > >> Makefile to get any meaningful debugging with gdb. > >> > >> Cheers, > >> ~/joachim > >> > >> On Tuesday 09 December 2003 08:55, Joachim Bauernberger wrote: > >> > Hi Grant, > >> > > >> > On Monday 08 December 2003 18:49, Grant McLean wrote: > >> > <snip/> > >> > > >> > > > [t][jmbdev]# perl ./10functions.t > >> > > > 1..14 > >> > > > ok 1 > >> > > > ok 2 > >> > > > ok 3 > >> > > > ok 4 > >> > > > ok 5 > >> > > > ok 6 > >> > > > Segmentation fault > >> > > > >> > > One obvious difference between running 'make test' and running the > >> > > test directly is that make test uses the recently built version of > >> > > LibXML sitting in the blib directory whereas your simple perl > >> > > command to run the test script uses the version of LibXML installed > >> > > on your system. > >> > > >> > That version of LibXML was already installed from before, so it should > >> > not make a difference (I also double checked by using the -Include > >> > switches as you did below but it's all the same...) > >> > > >> > cheers, > >> > ~/joachim > >> > > >> > > You could try editing the command line generated by 'make test': > >> > > > >> > > PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib \ > >> > > -I/usr/lib/perl/5.6.1 -I/usr/share/perl/5.6.1 t/10functions.t > >> > > > >> > > or you could use the 'prove' script that comes with recent versions > >> > > of Test::Harness to achieve a similar thing. > >> > > > >> > > Of course if you've already run 'make install' then the files from > >> > > blib should have been copied to /usr/local/lib already. > >> > > > >> > > Cheers > >> > > Grant -- Phone: +49 (0) 89 490 267 726 Fax: +49 (0) 89 490 267 701 Mobile: +49 (0) 179 674 3611 mailto: joachim.bauernberger@xxxxxxxxxxxxxxxx Web: http://www.friendscout24.de _______________________________________________ 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::LibXML-1.56, Petr Pajas |
|---|---|
| Next by Date: | Re: XML::LibXML-1.56, Joachim Bauernberger |
| Previous by Thread: | Re: XML::LibXML-1.56, Petr Pajas |
| Next by Thread: | Re: XML::LibXML-1.56, Joachim Bauernberger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |