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
[bug] Nokogiri::HTML::DocumentFragment#path causes a segmentation fault #2250
Comments
Thanks for opening this issue. I'll take a look shortly! |
DiagnosisI've git-bisected the introduction of this issue to libxml2@e20c9c1, which causes HistoryThe In a REPL prompt, showing a question mark in error cases might make sense; but not for a function that is supposed to return a valid XPath query. What's the right behavior?Which brings me to my question for you: What do you expect this method to return for a assert_equal(xml_document, xml_document.at_xpath(xml_document.path))
assert_equal(xml_node, xml_document.at_xpath(xml_node.path)) and so maybe the answer is "it doesn't matter, as long as we can get back the But then that gets more complicated because a What's the "right-now" behavior?Would you be open to me fixing this to just return "?" as before in this case (in the v1.11.x release series), to avoid breaking anybody relying on this behavior; and then we can look into fixing this For Real™ in a future minor or major release? |
Fixed in v1.11.6, just released. |
Please describe the bug
Nokogiri 1.11.4+ segfaults when you call
path
on a Nokogiri::HTML::DocumentFragment.Help us reproduce what you're seeing
Expected behavior
Nokogiri 1.11.3 and below returned
?
(as does Nokogiri::XML::DocumentFragment#path), but 1.11.4 and 1.11.5 both segfault.Environment
Additional context
Initially reported to teamcapybara/capybara#2466.
The text was updated successfully, but these errors were encountered: