Re: self contains no data
Bruce Miller <[email protected]> Thu, 13 Sep 2012 09:21:45 -0400
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
On 09/13/2012 05:49 AM, Nick Wellnhofer wrote:
> On 13/09/2012 00:33, Bruce Miller wrote:
>> I did find something curious. So, XML::LibXML nodes are
>> references to integers. I don't know if those numbers "mean"
>> anything --- in ancient times, they were constant, and
>> you could test node equality by $$a == $$b.
>> At some point (an update related to thread safety?),
>> they're no longer constant, and there's a specific
>> method $a->isSameNode($b). Would be interested in the back-story.
>
> These numbers are raw C pointers.
Ah, I'd suspected that....
but they're actually moving around a bit in modern C? interesting...
[If I fetch the "same" nodes from a document at several points
in the program, I'll get different values]
>> At any rate, printing out the dereferenced integer while walking
>> the tree gives me nice 8-digit numbers like 54824480...
>> until the broken node which has 12 digits (249739024344)
>> and then I get a segfault before any of the Node methods
>> can tell me anything about the node!
>
> The 12-digit number seems to be a corrupted pointer, so the previous
> operation on that node is probably the culprit. Can you tell what the
> previous operation is? Or how the node is created if it's not
> manipulated in any way?
The structure is roughly:
<Math>
<XMath>
<XMTok>
...
In this case, the pointer is (or should be) to the <XMath>
and was obtained either by $m->firstChild or $m->childNodes
(where $m is to the <Math>); both fail.
The children/structure under the <XMath> has been manipulated
and rearranged, rather vigorously.
But the <Math> was not touched directly.
(or possibly an attribute set on it? no, not till later).
However, it would appear that the <Math>'s child list
has gotten corrupted.
Hmmmmm.....
Thanks for your thoughts;
bruce
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs