tenderlove/nokogiri — Issue #600: Segfault: Nokogiri 1.5.0, ruby 1.9.2p290, libxml2.7.8
Author: benmiles
Created: 2012-01-17 15:48:40+00:00
State: open

I am getting intermittent segfaults when running this code (segfaults about 50% of the time)

require 'nokogiri'
require 'CGI'

html = %Q{Foo & bar}

node = Nokogiri::XML::DocumentFragment.parse(html).at('.//sec')
s = node.inner_text

node.swap %(#{s}) # segfault
# node.swap %(#{CGI::escapeHTML s}) # no segfault

output of nokogiri -v

# Nokogiri (1.5.0)
---
warnings: []
nokogiri: 1.5.0
ruby:
version: 1.9.2
platform: x86_64-darwin10.8.0
description: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
engine: ruby
libxml:
binding: extension
compiled: 2.7.8
loaded: 2.7.8