Bugs item #26564, was opened at 2009-07-08 17:53
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=26564&group_id=494

Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Mars Hall (marsipan)
>Assigned to: Charlie Savage (cfis)
Summary: invalid XPath causes segmentation fault on Solaris

Initial Comment:
Doing a #find using an invalid XPath indirectly causes a segmentation fault on 
Solaris. I say "indirectly", because the XPath eval error does not immediately 
cause the segfault; instead the segfault occurs at some point after the invalid 
XPath eval.

On Mac OS X, invalid XPath does not cause the ruby app to exit.

The error logged is:

Error: Invalid expression.
xmlXPathEval: evaluation failed
/usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3/lib/libxml/node.rb:71: 
[BUG] Segmentation fault
ruby 1.8.6 (2007-03-13) [i386-solaris2.10]


The invalid path in question mistakenly used a double-pipe "||" instead of a 
single-pipe "|" for a logical "or". Correcting this XPath prevents the 
segfault, but ideally this XPath error should raise a ruby exception, not kill 
the process.

----------------------------------------------------------------------

>Comment By: Charlie Savage (cfis)
Date: 2011-04-22 22:56

Message:
This is fixed in the latest release.

Thanks for the report - Charlie

----------------------------------------------------------------------

Comment By: Lars Haugseth (lhz)
Date: 2009-11-06 04:28

Message:
I also get segfaults on Ubuntu 8.04 with libxml-ruby 1.1.3 when trying to 
evaluate an invalid XPath expression:

Error: Invalid expression.
xmlXPathEval: evaluation failed
/usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3/lib/libxml/document.rb:119: 
[BUG] Segmentation fault
ruby 1.8.6 (2009-08-04) [x86_64-linux]


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=26564&group_id=494
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to