Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 1.9.3/2.0.0 segfault #884

Closed
jcoyne opened this issue Apr 8, 2013 · 4 comments
Closed

Ruby 1.9.3/2.0.0 segfault #884

jcoyne opened this issue Apr 8, 2013 · 4 comments

Comments

@jcoyne
Copy link

jcoyne commented Apr 8, 2013

Triggered by running rake

This may be due to linking against libxml 2.9.0?

/Users/justin/workspace/nokogiri/test/helper.rb:11: version info: {"warnings"=>[], "nokogiri"=>"1.5.9", "ruby"=>{"version"=>"1.9.3", "platform"=>"x86_64-darwin11.4.2", "description"=>"ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin11.4.2]", "engine"=>"ruby"}, "libxml"=>{"binding"=>"extension", "compiled"=>"2.9.0", "loaded"=>"2.9.0"}}
/Users/justin/workspace/nokogiri/lib/nokogiri/html/document.rb:124: [BUG] Segmentation fault
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin11.4.2]

-- Control frame information -----------------------------------------------
c:0025 p:---- s:0114 b:0114 l:000113 d:000113 CFUNC  :read_memory
c:0024 p:0373 s:0107 b:0107 l:000106 d:000106 METHOD /Users/justin/workspace/nokogiri/lib/nokogiri/html/document.rb:124
c:0023 p:0050 s:0099 b:0099 l:000098 d:000098 METHOD /Users/justin/workspace/nokogiri/lib/nokogiri/html.rb:15
c:0022 p:0070 s:0091 b:0091 l:000090 d:000090 METHOD /Users/justin/workspace/nokogiri/lib/nokogiri.rb:71
c:0021 p:0071 s:0083 b:0083 l:000082 d:000082 METHOD /Users/justin/workspace/nokogiri/lib/nokogiri.rb:126
c:0020 p:0040 s:0077 b:0077 l:000076 d:000076 METHOD /Users/justin/workspace/nokogiri/test/test_convert_xpath.rb:7

I get a similar segfault at the same location with ruby 2.0.0

@dchandekstark
Copy link

I have experienced the same problem with rake. I also have libxml2 2.9.0 (and libxslt 1.1.28) from homebrew (0.9.4). I resolved the issue by installing nokogiri this way:

gem install nokogiri -- --with-iconv-lib=/usr/local/opt/libiconv/lib --with-iconv-include=/usr/local/opt/libiconv/include --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.0/lib --with-xml2-include=/usr/local/Cellar/libxml2/2.9.0/include/libxml2

I get warnings -- "WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.9.0" -- but AFAICT it's working fine.

@jcoyne
Copy link
Author

jcoyne commented Apr 12, 2013

Is there a way I can pass these arguments to the "rake test" task inside nokogiri?

@agent462
Copy link

I had a similar issue using an embedded Ruby but nokogiri is doing something with system Ruby. The embedded Ruby is 2.0.0 and the system is 1.8.7

/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.so: [BUG] Segmentation fault

it then spits out ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

If I switch the system ruby to point at the embedded Ruby, everything works fine. I've tried installing the libs from source and installing nokogiri with the argvs. Nothing fixed it. I ended up installing nokogiri under system ruby and moved it to the embedded gem path.

@flavorjones
Copy link
Member

I'm not sure there's anything actionable here, as libxml 2.9.0 is buggy and not supported by nokogiri at this time (see #829 for an example).

Please try nokogiri 1.6.0.rc1 which will compile libxml2 and libxslt for you at gem installation time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants