nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:238: [BUG] Segmentation fault

58 views
Skip to first unread message

Iñaki Baz Castillo

unread,
Nov 13, 2009, 8:57:15 AM11/13/09
to nokogi...@googlegroups.com
Hi, using ruby 1.8.6 (2007-09-24) [i486-linux] Nokogiti 1.4.0 issues a
segment fault.

Basically I ask for a node with Xpath as follows:

cp:ruleset/cp:rule/cp:conditions/cp:identity/namespace::*

It *only* crahses if I try to printf the returned nodeset:

doc_xml = parse(doc)
nodeset = doc_xml.xpath(xpath, ns)
puts "nodeset = \n#{nodeset.to_s}" <--- CRASH


I know that "namespace::*" is not a Xpath feature, but it shouldn't
crash due to it :)


Using Ruby 1.9.1p129 it also crashes:


/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:238:
[BUG] Segmentation fault
ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux]

-- control frame ----------
c:0041 p:0011 s:0180 b:0179 l:00003c d:000178 BLOCK
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:238
c:0040 p:---- s:0176 b:0176 l:000175 d:000175 FINISH
c:0039 p:---- s:0174 b:0174 l:0005e0 d:000173 IFUNC :[]
c:0038 p:0015 s:0172 b:0171 l:000161 d:000170 BLOCK
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:207
c:0037 p:---- s:0168 b:0168 l:000167 d:000167 FINISH
c:0036 p:---- s:0166 b:0166 l:000165 d:000165 CFUNC :upto
c:0035 p:0022 s:0162 b:0162 l:000161 d:000161 METHOD
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:206
c:0034 p:---- s:0158 b:0158 l:000157 d:000157 FINISH
c:0033 p:---- s:0156 b:0156 l:0005e0 d:0005e0 CFUNC :map
c:0032 p:0011 s:0153 b:0153 l:00003c d:00003c METHOD
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:238

-- Ruby level backtrace information-----------------------------------------
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:238:in
`block in to_s'
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:207:in
`block in each'
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:206:in
`upto'
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:206:in
`each'
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:238:in
`map'
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node_set.rb:238:in
`to_s'


--
Iñaki Baz Castillo
<i...@aliax.net>

Aaron Patterson

unread,
Nov 13, 2009, 3:06:32 PM11/13/09
to nokogi...@googlegroups.com
On Fri, Nov 13, 2009 at 5:57 AM, Iñaki Baz Castillo <i...@aliax.net> wrote:
>
> Hi, using ruby 1.8.6 (2007-09-24) [i486-linux] Nokogiti 1.4.0 issues a
> segment fault.
>
> Basically I ask for a node with Xpath as follows:
>
>  cp:ruleset/cp:rule/cp:conditions/cp:identity/namespace::*
>
> It *only* crahses if I try to printf the returned nodeset:
>
>  doc_xml = parse(doc)
>  nodeset = doc_xml.xpath(xpath, ns)
>  puts "nodeset = \n#{nodeset.to_s}"  <--- CRASH
>
>
> I know that "namespace::*" is not a Xpath feature, but it shouldn't
> crash due to it :)

Interesting. Do you have sample XML we can use to reproduce the problem?

--
Aaron Patterson
http://tenderlovemaking.com/

Iñaki Baz Castillo

unread,
Nov 14, 2009, 5:07:06 PM11/14/09
to nokogi...@googlegroups.com

Yes, I'll try to get it and post it during these days.

Iñaki Baz Castillo

unread,
Nov 15, 2009, 9:33:17 AM11/15/09
to nokogi...@googlegroups.com

A working example (for 1.8 and 1.9):


nokogiri_02.rb:
----------------------------------------------------------------
#!/usr/bin/env ruby

require "rubygems"
require "nokogiri"


XML_PARSE_OPTIONS = \
Nokogiri::XML::ParseOptions::NONET + \
Nokogiri::XML::ParseOptions::NOERROR

NS = {"pr"=>"urn:ietf:params:xml:ns:pres-rules",
"cp"=>"urn:ietf:params:xml:ns:common-policy"}

PRES_RULES = <<-EOF
<?xml version='1.0' encoding='UTF-8'?>
<cp:ruleset xmlns:pr="#{NS["pr"]}" xmlns:cp="#{NS["cp"]}">
<cp:rule id="pres_whitelist">
<cp:conditions>
<cp:identity>
<cp:one id="a"/>
<cp:one id="b"/>
</cp:identity>
</cp:conditions>
<cp:actions>
<pr:sub-handling>allow</pr:sub-handling>
</cp:actions>
</cp:rule>
<cp:rule id="pres_blacklist">
<cp:conditions>
<cp:identity>
<cp:one id="m"/>
</cp:identity>
</cp:conditions>
<cp:actions>
<pr:sub-handling>block</pr:sub-handling>
</cp:actions>
</cp:rule>
</cp:ruleset>
EOF

PATH =
'/cp:ruleset/cp:rule[@id="pres_whitelist"]/cp:conditions/cp:identity/cp:one/namespace::*'

xml = ::Nokogiri::XML::Document.parse(PRES_RULES, nil, nil, XML_PARSE_OPTIONS)
node = xml.xpath(PATH, NS)

puts "Now it will crash..."
puts node # <--- It crashes HERE !!!
puts "No, it didn't crash"
----------------------------------------------------------------


Note that the PATH expression is invalid since the last node "namespace::*"
has no XML namespace prefix:
PATH =
'/cp:ruleset/cp:rule[@id="pres_whitelist"]/cp:conditions/cp:identity/cp:one/namespace::*'


In Ruby 1.8.7 if just crashes if it's "namespace::*", if you try *any* other
final node name it will just raise "Nokogiri::XML::XPath::SyntaxError". So
this means that "namespace::*" could be an official Xpath feature (not just
used in XCAP as I though) but Nokogiri crashes when handling it:

------------------------------------
$ ruby1.8 ./nokogiri_02.rb
Now it will crash...
./nokogiri_02.rb:46: [BUG] Segmentation fault
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

Canceled
------------------------------------

Note that it has crashed when running "puts node".


But in Ruby 1.9 it crashes in any case if the NS prefix doesn't exist in the
final node, which seems a worse bug. In fact it also crashes with the
following PATH:

PATH =
'/cp:ruleset/cp:rule[@id="pres_whitelist"]/cp:conditions/cp:identity/cp:one/lala:lolo'

--------------------------------------------
$ ./nokogiri_02.rb
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:142:in
`evaluate': Undefined namespace prefix (Nokogiri::XML::XPath::SyntaxError)
from
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:142:in
`block in xpath'
from
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:139:in
`map'
from
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:139:in
`xpath'
from ./nokogiri_02.rb:43:in `<main>'
<main>:219: [BUG] Segmentation fault
ruby 1.9.1p129 (2009-05-12 revision 23412) [x86_64-linux]

-- control frame ----------
c:0001 p:0000 s:0002 b:0002 l:0022d8 d:0022d8 TOP <main>:219
---------------------------


-- Ruby level backtrace information-----------------------------------------

-- C level backtrace information -------------------------------------------
0x4e8e3b ruby1.9(rb_vm_bugreport+0x3b) [0x4e8e3b]
0x517080 ruby1.9 [0x517080]
0x5171f1 ruby1.9(rb_bug+0xb1) [0x5171f1]
0x493bbf ruby1.9 [0x493bbf]
0x7fdad005f080 /lib/libpthread.so.0 [0x7fdad005f080]
0x44335e ruby1.9(rb_obj_is_kind_of+0x12e) [0x44335e]
0x41aacf ruby1.9(ruby_cleanup+0x1cf) [0x41aacf]
0x41abaa ruby1.9(ruby_run_node+0x3a) [0x41abaa]
0x417f5d ruby1.9(main+0x4d) [0x417f5d]
0x7fdacf4335a6 /lib/libc.so.6(__libc_start_main+0xe6) [0x7fdacf4335a6]
0x417e49 ruby1.9 [0x417e49]
--------------------------------------------

Note that it has crashed when running "node = xml.xpath(PATH, NS)".


So there are two different issues here:


1) Fetching node namespaces (xpath = ....../namespace::*) is not implemented
(it crashes) in Nokogiri but it's implemented in libxml2. Nokogiri crashes
when doing "puts node".
Note however that I couldn't find a specifications about this feature, but
just in XCAP RFC 4825:
http://tools.ietf.org/html/rfc4825#section-7.10
So, I'm not sure if it exists for Xpath or not. However Nokogiri with ruby 1.8
just crashes with "/namespace::*" (and not with "/lalala::*/").


2) Using Ruby1.9 Nokogiri crashes if a non existing prefix is used in XPath.

Aaron Patterson

unread,
Nov 15, 2009, 2:53:28 PM11/15/09
to nokogi...@googlegroups.com

Thanks for the report! I'll look in to this and see what I can do.

Mike Dalessio

unread,
Nov 16, 2009, 8:48:47 PM11/16/09
to nokogi...@googlegroups.com
Hi! Thanks for this bug report. I have a fix that I will commit to master tonight.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To post to this group, send email to nokogi...@googlegroups.com
To unsubscribe from this group, send email to nokogiri-tal...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/nokogiri-talk?hl=en
-~----------~----~----~----~------~----~------~--~---




--
mike dalessio
mi...@csa.net

Iñaki Baz Castillo

unread,
Nov 17, 2009, 5:45:57 AM11/17/09
to nokogi...@googlegroups.com
El Martes, 17 de Noviembre de 2009, Mike Dalessio escribió:
> Hi! Thanks for this bug report. I have a fix that I will commit to master
> tonight.

Great, please notify it to me (or announce it here) so I'll check ti :)

Mike Dalessio

unread,
Nov 17, 2009, 11:47:27 AM11/17/09
to nokogi...@googlegroups.com
It's in master now.

Iñaki Baz Castillo <i...@aliax.net>

--


You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To post to this group, send email to nokogi...@googlegroups.com.
To unsubscribe from this group, send email to nokogiri-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nokogiri-talk?hl=.





--
mike dalessio
mi...@csa.net

Iñaki Baz Castillo

unread,
Nov 17, 2009, 1:03:36 PM11/17/09
to nokogi...@googlegroups.com
El Martes, 17 de Noviembre de 2009, Mike Dalessio escribió:
> It's in master now.

Thanks, I'll check it.

Iñaki Baz Castillo

unread,
Nov 17, 2009, 1:13:36 PM11/17/09
to nokogi...@googlegroups.com
El Martes, 17 de Noviembre de 2009, Mike Dalessio escribió:
> It's in master now.

Ops, it doesn't pass the rake tests with Ruby 1.9.1p243 (but they are passed
with ruby 1.8.7):


/usr/src/ruby/nokogiri# rake1.9
(in /usr/src/ruby/nokogiri)
warning: couldn't activate the debugging plugin, skipping
cp tmp/x86_64-linux/nokogiri/1.9.1/nokogiri.so lib/nokogiri/nokogiri.so
/usr/local/bin/ruby1.9 -w -Ilib:ext:bin:test -e 'require "rubygems"; require
"test/unit"; require "test/css/test_nthiness.rb"; require
"test/css/test_parser.rb"; require "test/css/test_tokenizer.rb"; require
"test/css/test_xpath_visitor.rb"; require "test/ffi/test_document.rb"; require
"test/html/sax/test_parser.rb"; require
"test/html/sax/test_parser_context.rb"; require "test/html/test_builder.rb";
require "test/html/test_document.rb"; require
"test/html/test_document_encoding.rb"; require
"test/html/test_document_fragment.rb"; require
"test/html/test_element_description.rb"; require
"test/html/test_named_characters.rb"; require "test/html/test_node.rb";
require "test/html/test_node_encoding.rb"; require
"test/test_convert_xpath.rb"; require "test/test_css_cache.rb"; require
"test/test_gc.rb"; require "test/test_memory_leak.rb"; require
"test/test_nokogiri.rb"; require "test/test_reader.rb"; require
"test/test_xslt_transforms.rb"; require "test/xml/node/test_save_options.rb";
require "test/xml/node/test_subclass.rb"; require
"test/xml/sax/test_parser.rb"; require "test/xml/sax/test_parser_context.rb";
require "test/xml/sax/test_push_parser.rb"; require "test/xml/test_attr.rb";
require "test/xml/test_attribute_decl.rb"; require "test/xml/test_builder.rb";
require "test/xml/test_cdata.rb"; require "test/xml/test_comment.rb"; require
"test/xml/test_document.rb"; require "test/xml/test_document_encoding.rb";
require "test/xml/test_document_fragment.rb"; require "test/xml/test_dtd.rb";
require "test/xml/test_dtd_encoding.rb"; require
"test/xml/test_element_content.rb"; require "test/xml/test_element_decl.rb";
require "test/xml/test_entity_decl.rb"; require
"test/xml/test_entity_reference.rb"; require "test/xml/test_namespace.rb";
require "test/xml/test_node.rb"; require "test/xml/test_node_attributes.rb";
require "test/xml/test_node_encoding.rb"; require "test/xml/test_node_set.rb";
require "test/xml/test_parse_options.rb"; require
"test/xml/test_processing_instruction.rb"; require
"test/xml/test_reader_encoding.rb"; require "test/xml/test_relax_ng.rb";
require "test/xml/test_schema.rb"; require "test/xml/test_syntax_error.rb";
require "test/xml/test_text.rb"; require "test/xml/test_unparented_node.rb";
require "test/xml/test_xpath.rb"; require "test/test_encoding_handler.rb"'
/usr/local/lib/ruby1.9/1.9.1/test/unit/assertions.rb:31: warning: shadowing
outer local variable - line
/usr/src/ruby/nokogiri/lib/nokogiri/css/generated_parser.rb:645: warning:
mismatched indentations at 'end' with 'module' at 11
/usr/src/ruby/nokogiri/lib/nokogiri/css/generated_parser.rb:646: warning:
mismatched indentations at 'end' with 'module' at 10
/usr/src/ruby/nokogiri/test/helper.rb:15: libxml version info:
{"warnings"=>[], "nokogiri"=>"1.4.0", "libxml"=>{"binding"=>"extension",
"compiled"=>"2.7.6", "loaded"=>"2.7.6"}}
Loaded suite -e
Started
....................................................................................................................................................................................................................................................................................F......F.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 3.099649 seconds.

1) Failure:
test_broken_encoding(Nokogiri::XML::SAX::TestPushParser)
[/usr/src/ruby/nokogiri/test/xml/sax/test_push_parser.rb:129]:
<"Gau\xDF"> expected but was
<"[\"Gau\", \"\\xDF\"]">.

2) Failure:
test_recover(Nokogiri::XML::SAX::TestPushParser)
[/usr/src/ruby/nokogiri/test/xml/sax/test_push_parser.rb:120]:
<"FooBar"> expected but was
<"[\"\\nFoo\\n\",\"\\nBar\\n\"]">.






These tests were passed before this update.

Debian Lenny 64 bits with libxml installed from Debian testing to get a more
recent version.

libxml2-dev 2.7.6.dfsg-1
libxml2 2.7.6.dfsg-1
libxslt1-dev 1.1.24-2
libxslt1.1 1.1.24-2

Iñaki Baz Castillo

unread,
Nov 17, 2009, 1:24:58 PM11/17/09
to nokogi...@googlegroups.com
El Martes, 17 de Noviembre de 2009, Iñaki Baz Castillo escribió:
> El Martes, 17 de Noviembre de 2009, Mike Dalessio escribió:
> > It's in master now.
>
> Ops, it doesn't pass the rake tests with Ruby 1.9.1p243 (but they are
> passed with ruby 1.8.7):

However I don't see the master updated yet. The revision I've got by doing
"git pull" is:

commit ebd44837af1abeb80dc787cb6a94794448697afa
Author: Mike Dalessio <mi...@csa.net>
Date: Tue Nov 17 03:27:23 2009 -0500

Node#replace reimplemented using reparent_node_with. Fixes GH #162.



Is that? (it remains crashing at before).

Mike Dalessio

unread,
Nov 17, 2009, 3:34:29 PM11/17/09
to nokogi...@googlegroups.com
Hello.

The failures you are seeing on 1.9 are not related. The 'master' branch is a work-in-progress and should not be considered production-ready until we bundle a release.

The fixes for your issue are:
commit b94ce7c2cd42bfc5df86bf4c760f40208e801290
Author: Mike Dalessio <mi...@csa.net>
Date:   Mon Nov 16 11:45:28 2009 -0500

    FFI: making node set namespace decl tests pass

commit 8111e7bc40f28caeb2adbcfe098e2ff11b95c08f
Author: Mike Dalessio <mi...@csa.net>
Date:   Mon Nov 16 11:43:25 2009 -0500

    C: making node set namespace decl tests pass

commit 760ea12779a35862d8569e944e601fa0f13f2a84
Author: Mike Dalessio <mi...@csa.net>
Date:   Mon Nov 16 11:42:57 2009 -0500

    introducing failing tests for node sets containing namespace declarations.
which are in master. Look at the log and you will see them there.

When you say "it remains crashing", would you be so kind as to provide to me the same information that we ask everyone for when they submit bugs: libxml2 version, nokogiri version, ruby version, and the output that you are seeing.

I promise you, your bug is fixed on libxml2 2.7.5 / nokogiri commit ebd44837 / ruby 1.8.7. If you are still seeing the issue, then either you haven't build nokogiri properly, or your environment is different from mine, and I need to konw that information.




--

You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To post to this group, send email to nokogi...@googlegroups.com.
To unsubscribe from this group, send email to nokogiri-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nokogiri-talk?hl=.





--
mike dalessio
mi...@csa.net

Iñaki Baz Castillo

unread,
Nov 17, 2009, 4:03:46 PM11/17/09
to nokogi...@googlegroups.com
El Martes, 17 de Noviembre de 2009, Mike Dalessio escribió:
> Hello.
>
> The failures you are seeing on 1.9 are not related. The 'master' branch is
> a work-in-progress and should not be considered production-ready until we
> bundle a release.
ok


> The fixes for your issue are:
>
> commit b94ce7c2cd42bfc5df86bf4c760f40208e801290
> Author: Mike Dalessio <mi...@csa.net>
> Date: Mon Nov 16 11:45:28 2009 -0500
>
> FFI: making node set namespace decl tests pass
>
> commit 8111e7bc40f28caeb2adbcfe098e2ff11b95c08f
> Author: Mike Dalessio <mi...@csa.net>
> Date: Mon Nov 16 11:43:25 2009 -0500
>
> C: making node set namespace decl tests pass
>
> commit 760ea12779a35862d8569e944e601fa0f13f2a84
> Author: Mike Dalessio <mi...@csa.net>
> Date: Mon Nov 16 11:42:57 2009 -0500
>
> introducing failing tests for node sets containing namespace
> declarations.
>
> which are in master. Look at the log and you will see them there.

ok





> When you say "it remains crashing", would you be so kind as to provide to
> me the same information that we ask everyone for when they submit bugs:
> libxml2 version, nokogiri version, ruby version, and the output that you
> are seeing.

Sure, but I already provided this info in my last mail though. Well, I provide
it now and also provide a ruby script which makes Nokogiri *master branch* to
crash:


- OS:
Debian Lenny 64 bits with libxml2 installed from Debian testing to get a more
recent version.

- libxml2 and libxslt:
libxml2-dev 2.7.6.dfsg-1
libxml2 2.7.6.dfsg-1
libxslt1-dev 1.1.24-2
libxslt1.1 1.1.24-2

- Ruby version:
Ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
Ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

- Nokogiri master branch:
--------------------------------------
/usr/src/ruby/nokogiri# git pull
Current branch master is up to date.
--------------------------------------




The script which causes the crash in ruby 1.8 and 1.9:

-----nokogiri_02.rb---------------------------------
require "rubygems"
#require "nokogiri"
require "/usr/src/ruby/nokogiri/lib/nokogiri.rb"
puts "No, it didn't crash :)"
----------------------------------------------------


The crash:

- Running ruby 1.8:
--------------------------------------------------
# ruby1.8 -wd nokogiri_02.rb
Exception `LoadError' at /usr/local/lib/site_ruby/1.8/rubygems.rb:1113 - no such file to load -- rubygems/defaults/operating_system
Exception `NoMethodError' at /usr/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `LoadError' at /usr/local/lib/site_ruby/1.8/rubygems/config_file.rb:34 - no such file to load -- Win32API
Exception `LoadError' at /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- nokogiri/nokogiri
Now it will crash...
nokogiri_02.rb:51: [BUG] Segmentation fault
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

Aborted
--------------------------------------------------


- Running Ruby 1.9:
--------------------------------------------------
# ruby1.9 -wd nokogiri_02.rb
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/css/generated_parser.rb:645: warning: mismatched indentations at 'end' with 'module' at 11
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/css/generated_parser.rb:646: warning: mismatched indentations at 'end' with 'module' at 10
Now it will crash...
nokogiri_02.rb:51: [BUG] Segmentation fault
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

-- control frame ----------
c:0005 p:---- s:0014 b:0014 l:000013 d:000013 CFUNC :puts
c:0004 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC :puts
c:0003 p:0210 s:0008 b:0008 l:0019c8 d:000268 EVAL nokogiri_02.rb:51
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0019c8 d:0019c8 TOP
---------------------------
-- Ruby level backtrace information-----------------------------------------
nokogiri_02.rb:51:in `puts'
nokogiri_02.rb:51:in `puts'
nokogiri_02.rb:51:in `<main>'

-- C level backtrace information -------------------------------------------
0x4e9f4b ruby1.9(rb_vm_bugreport+0x3b) [0x4e9f4b]
0x51859e ruby1.9 [0x51859e]
0x518701 ruby1.9(rb_bug+0xb1) [0x518701]
0x494c9f ruby1.9 [0x494c9f]
0x7fccc6692a80 /lib/libpthread.so.0 [0x7fccc6692a80]
0x4d6420 ruby1.9 [0x4d6420]
0x4d6493 ruby1.9(rb_get_method_body+0x23) [0x4d6493]
0x4d65d9 ruby1.9(rb_method_basic_definition_p+0x9) [0x4d65d9]
0x4e61b3 ruby1.9(rb_obj_respond_to+0x73) [0x4e61b3]
0x441116 ruby1.9 [0x441116]
0x4440ae ruby1.9(rb_check_convert_type+0x7e) [0x4440ae]
0x42a094 ruby1.9(rb_io_puts+0x54) [0x42a094]
0x42a25d ruby1.9 [0x42a25d]
0x4ef5a8 ruby1.9 [0x4ef5a8]
0x42a080 ruby1.9(rb_io_puts+0x40) [0x42a080]
0x4e2adb ruby1.9 [0x4e2adb]
0x4e57ef ruby1.9(rb_funcall2+0x6f) [0x4e57ef]
0x4d7e1d ruby1.9 [0x4d7e1d]
0x4e5ab0 ruby1.9 [0x4e5ab0]
0x4dac84 ruby1.9 [0x4dac84]
0x4dfe40 ruby1.9 [0x4dfe40]
0x4dff89 ruby1.9(rb_iseq_eval_main+0xa9) [0x4dff89]
0x41944c ruby1.9(ruby_exec_node+0xac) [0x41944c]
0x41aa33 ruby1.9(ruby_run_node+0x33) [0x41aa33]
0x417ecd ruby1.9(main+0x4d) [0x417ecd]
0x7fccc5a871a6 /lib/libc.so.6(__libc_start_main+0xe6) [0x7fccc5a871a6]
0x417db9 ruby1.9 [0x417db9]

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted
--------------------------------------------------



Also, there is still the other problem I reported (which just affects to Ruby1.9):

If you change the script and set:

PATH = '/cp:ruleset/cp:rule[@id="pres_whitelist"]/cp:conditions/cp:identity/cp:one/lalala:lololo'


Then Ruby1.8 doesn't crash but Ruby1.9 does:

---------------------------------------------------
# ruby1.9 -wd nokogiri_02.rb
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/css/generated_parser.rb:645: warning: mismatched indentations at 'end' with 'module' at 11
/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/css/generated_parser.rb:646: warning: mismatched indentations at 'end' with 'module' at 10
Exception `Nokogiri::XML::XPath::SyntaxError' at /usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:142 - Undefined namespace prefix

/usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:142:in `evaluate': Undefined namespace prefix (Nokogiri::XML::XPath::SyntaxError)
from /usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:142:in `block in xpath'
from /usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:139:in `map'
from /usr/local/lib/ruby1.9/gems/1.9.1/gems/nokogiri-1.4.0/lib/nokogiri/xml/node.rb:139:in `xpath'
from nokogiri_02.rb:48:in `<main>'
<main>:139: [BUG] Segmentation fault
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

-- control frame ----------
c:0001 p:0000 s:0002 b:0002 l:0019c8 d:0019c8 TOP <main>:139
---------------------------
-- Ruby level backtrace information-----------------------------------------

-- C level backtrace information -------------------------------------------
0x4e9f4b ruby1.9(rb_vm_bugreport+0x3b) [0x4e9f4b]
0x51859e ruby1.9 [0x51859e]
0x518701 ruby1.9(rb_bug+0xb1) [0x518701]
0x494c9f ruby1.9 [0x494c9f]
0x7f644f8f7a80 /lib/libpthread.so.0 [0x7f644f8f7a80]
0x44303e ruby1.9(rb_obj_is_kind_of+0x12e) [0x44303e]
0x41a95f ruby1.9(ruby_cleanup+0x1cf) [0x41a95f]
0x41aa3a ruby1.9(ruby_run_node+0x3a) [0x41aa3a]
0x417ecd ruby1.9(main+0x4d) [0x417ecd]
0x7f644ecec1a6 /lib/libc.so.6(__libc_start_main+0xe6) [0x7f644ecec1a6]
0x417db9 ruby1.9 [0x417db9]
---------------------------------------------------





> I promise you, your bug is fixed on libxml2 2.7.5 / nokogiri commit
> ebd44837 / ruby 1.8.7. If you are still seeing the issue, then either you
> haven't build nokogiri properly, or your environment is different from
> mine, and I need to konw that information.

As you see above I satisfy these requeriments (well, my libxml2 version
is greater than yours, 2.7.6, but I expect it's not a problem).




If you need more data I could give you access to my server.

Thanks a lot.

Mike Dalessio

unread,
Nov 18, 2009, 1:46:30 AM11/18/09
to nokogi...@googlegroups.com
I'd like to suggest we take this discussion of the nokogiri-talk list. This bug has been fixed in master, and I suspect you are still seeing this issue due to load-path configuration. I'll send you a direct email.

Also, please try to keep threads limited to one issue each. In fact, we'd greatly prefer if everyone filed a github issue for any serious issues: http://github.com/tenderlove/nokogiri/issues

Iñaki Baz Castillo <i...@aliax.net>

--

You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To post to this group, send email to nokogi...@googlegroups.com.
To unsubscribe from this group, send email to nokogiri-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nokogiri-talk?hl=.





--
mike dalessio
mi...@csa.net

Iñaki Baz Castillo

unread,
Nov 18, 2009, 5:06:35 AM11/18/09
to nokogi...@googlegroups.com
El Miércoles, 18 de Noviembre de 2009, Mike Dalessio escribió:
> I'd like to suggest we take this discussion of the nokogiri-talk list. This
> bug has been fixed in master, and I suspect you are still seeing this issue
> due to load-path configuration. I'll send you a direct email.

Received and replied, thanks.


> Also, please try to keep threads limited to one issue each.

Sure. The fact is that at the beggining I thought it was the same bug but
after further testing I realized of the second one.


> In fact, we'd
> greatly prefer if everyone filed a github issue for any serious issues:
> http://github.com/tenderlove/nokogiri/issues

Sure, ok.
Reply all
Reply to author
Forward
0 new messages