[Melbourne-pm] An old one but an important one

Timothy S. Nelson wayland at wayland.id.au
Tue Jan 29 12:27:48 PST 2008

On Tue, 29 Jan 2008, Scott Penrose wrote:

> Bum !
> I use XML::LibXML and LibXSLT on many VERY high loaded apache servers and 
> have not had that problem.

 	Well, I suppose in my case, that's what you get for trying to write an 
XML database :).  Part of my problem was, any time I changed any part of the 
code, the segfault would move :).  Someone on the perl-xml list came up with a 
way of reproducing a segfault that involved (IIRC) both the modules you 
mentioned (whereas I don't use libXSLT), but was unsure which module it was 

 	I'll quote the message (which I didn't write):

> It's something to do with the implicit "aliasing" of the array elements
> - the "nodes" are references to scalars containing a C pointer to a
> libxml element structure and blessed into the package
> XML::LibXML::Element - it seems that the aliasing alters the pointer
> somehow so when it gets passed back to the libxml function to perform
> the findvalue() it points to the wrong thing and consequently gives rise
> to the segfault.
> That the "aliasing" is what is causing the problem can be demonstrated
> by doing:
>   foreach my $node ( @nodes )
>     {
>        my $foo = $node->findvalue(XPATH);
>     }
> instead of the sort - the foreach also does the aliasing and this code
> also gives rise to the segfault.
> I don't know who's bug it is if bug at all, and I don't really fancy
> building a debugging perl to find out :-O


| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayland at wayland.id.au    | I am                           |

Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- 
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-

More information about the Melbourne-pm mailing list