Re: self contains no data

Bruce Miller <[email protected]> Tue, 11 Sep 2012 11:26:44 -0400
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
A bit of followup to the problem described below.

The data corruption seems to be occurring when
  * some XML data is found by childNodes, or findnodes, or...
  * that data is modified, particularly with things like removeChild
  * the data goes out of scope.
Presumably Perl is doing cleanup, and
either expecting non-null data, or freeing things
that have already been freed, or...?

I'm guessing that some operations aren't clearing
all the fields they should during modification,
or not correctly adjusting reference counts for garbage collection.

I can write my code to dance around a bit more
and seemingly avoid segfaults, but that doesn't
really fix the problem.

However, I'm not sure how to proceed to find the
actual problem. Any hints?

Thanks;
bruce

On 09/09/2012 10:45 PM, Bruce Miller wrote:
> Hi gang;
>     After a long and productive, mostly uneventful, period of XML crunching
> -- Thanks, in part, to your code & support! ---
> I've started to see a number of segfaults occurring
> in connection (sometimes) with a message along the lines of
>     XML::LibXML::Node::nodeType -- self contains no data
>
> This happens typically after long & complex document
> construction & manipulation, so it's hard to pinpoint
> what exactly happened.
>
> My de-segfaulting skills have gotten quite rusty, and I was never so
> good with XS, so I can only guess how to interpret what it
> means that INT2PTR has given null.
>
> I've gotten a reference to an int that is no longer
> a valid indicator of a libxml2 Node object !?!?!
> How would I have done that?
>
> I realize that I noone can debug from the information
> I've given, and it's hard for me to send a reproducible case;
> but can anyone suggest places to start looking?
> Is there some sort of tree-walk or validation I can
> do to try to determine when this invalid thing might
> have come into existence?
>
> FWIW, I suspect that the problem is showing up now
> because the evolution of my code is exercising
> XML::LibXML differently, rather than a new bug in LibXML.
> (also it seems to occur in versions 1.90 and 2.00, maybe earlier?)
>
> Thanks in advance
> bruce
> _______________________________________________
> Perl-XML mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs