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

Node#swap crashing bug #362

Closed
flavorjones opened this issue Oct 29, 2010 · 5 comments
Closed

Node#swap crashing bug #362

flavorjones opened this issue Oct 29, 2010 · 5 comments

Comments

@flavorjones
Copy link
Member

From the mailing list:

f = Nokogiri::XML.fragment( "<div class='section'><span class='greeting'></span></div>" )
f.css( 'div' ).each do | node |
  node.swap( '<h1>hi</h1>' )
end

reproduced with

ruby: 
  engine: mri
  version: 1.8.7
  platform: x86_64-linux
libxml: 
  loaded: 2.7.6
  binding: extension
  compiled: 2.7.6
nokogiri: 1.4.3.1
@flavorjones
Copy link
Member Author

This is actually a bug in calling Node#fragment from a node in a fragment. Repro:

Nokogiri::XML.fragment("<div></div>").children.first.fragment("<h1></h1>")

@flavorjones
Copy link
Member Author

Wow, nutty problem. Looks like a bug in libxml2. Working on getting a repro case in C for submission to libxml2.

@flavorjones
Copy link
Member Author

I've reproduced this bug in C code calling libxml2. Will submit bug, and a Nokogiri workaround is imminent.

@flavorjones
Copy link
Member Author

test and workaround for libxml in-context parsing bug. closed by cedc5d8.

@flavorjones
Copy link
Member Author

opened a bug with libxml2: https://bugzilla.gnome.org/show_bug.cgi?id=634005

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

No branches or pull requests

1 participant