List Info

Thread: 2.6.26 xpath returns too many nodes?




2.6.26 xpath returns too many nodes?
user name
2006-06-26 09:25:55
Hi,

> -----Original Message-----
> From: xml-bouncesgnome.org [mailtoml-bo
uncesgnome.org] On 
> Behalf Of Arnold Hendriks

> We recently upgraded from libxml2 version 2.6.13 to
2.6.26, 
> and are now 
> running into problems with the xpath code. It appears
that, very 
> infrequently, the result of xmlXPathEvalExpression
contains too many 
> nodes (the correct node and a handful of nodes that
appear a 
> bit later 
> in the document, but not necessary only the immediate 
> siblings or chilrden).
> 
> The problem is hard to reproduce, and would appear to
be some sort of 
> race condition. So far I can't come up with a testcase
that 
> consistently 
> reproduces it. The 2.6.24 libxml2 however, works fine.
> 
> This is a win32 build, using C++ Builder 5, and I'm
checking 
> xmlHasFeature(XML_WITH_THREAD) at startup to make sure
I've 
> really got a 
> threaded version of libxml2. The code is running inside
a 
> multithreaded 
> webserver using a thread pool, but in this specific
case, the 
> xmlDoc and 
> xpath expressions aren't accessed by different threads
(the 
> code fails 
> during the 'startup' phase of a http request
handling, and 
> the objects are not passed between threads in that
phase yet)
> 
> Any suggestions on where to look for the problem?

Can you provide the XPath expression which are in use?
You write "the correct node and a handful of
nodes". Do you
use expressions with positional predicates (e.g.
"[1]")?
If yes, then the source of the error should be one of the
optimizations, which were added in 2.6.26.
I'll look into this, but if you could post the expressions,
then this would be easier.

Regards,

Kasimier
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
2.6.26 xpath returns too many nodes?
user name
2006-06-26 09:41:53
Buchcik, Kasimier wrote:

>Can you provide the XPath expression which are in use?
>You write "the correct node and a handful of
nodes". Do you
>use expressions with positional predicates (e.g.
"[1]")?
>  
>
Yes. All of the expressions have a form such as:
//p:pages/p:page[xml:id="main"]/p[9]/p[1]/p

(I execute an xpath, and then recurse with a deeper xpath. I
know this 
isn't the most efficient way of running through a DOM, but
I'm 
delivering the nodes to a language binding which doesn't
understand 
pointers and just starts new xpaths with an ever deeper
path)

>If yes, then the source of the error should be one of
the
>optimizations, which were added in 2.6.26.
>I'll look into this, but if you could post the
expressions,
>then this would be easier.
>  
>
All expressions start with //p:pages/p:page[xml:id="main"], followed by 
one or more /p[xxx] and
finally a /p expression.
I can put .26 back 
in and grab a few more failing expressions, but they all
boil down to 
that basic form.

-- 
Arnold Hendriks <a.hendriksb-lex.nl>
B-Lex Information Technologies <http://www.b-lex.com/>
Postbus 545, 7500 AM Enschede, The Netherlands

B-Lex: +31 (0)53 4836543
Mobile: +31 (0)6 51710159
MSN: a.hendriksb-lex.nl
ICQ: 86313731

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )