Comment 8 for bug 2049197

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

# Verification Mantic

root@ruby31-segfault-fix:~# dpkg -l ruby3.1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-================-============-======================================================
ii ruby3.1 3.1.2-7ubuntu3.1 amd64 Interpreter of object-oriented scripting language Ruby
root@ruby31-segfault-fix:~# cat reproducer.rb
require 'nokogiri'

# must have an error in it to cause pthread_setspecific to be called
html = "<div foo='asdf>asdf</div>"

Thread.new { Nokogiri::HTML4::Document.parse(html) }
sleep 3 # THREAD_CACHE_TIME

exit 0
root@ruby31-segfault-fix:~# time while true; do ruby reproducer.rb; done
^Creproducer.rb:7:in `sleep': Interrupt
 from reproducer.rb:7:in `<main>'

real 8m5.499s
user 0m10.297s
sys 0m4.874s

More than 8 minutes running the script without any segfault.

# Verification Jammy

root@ruby30-segfault-fix:~# dpkg -l ruby3.0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-================-============-======================================================
ii ruby3.0 3.0.2-7ubuntu2.5 amd64 Interpreter of object-oriented scripting language Ruby
root@ruby30-segfault-fix:~# cat reproducer.rb
require 'nokogiri'

# must have an error in it to cause pthread_setspecific to be called
html = "<div foo='asdf>asdf</div>"

Thread.new { Nokogiri::HTML4::Document.parse(html) }
sleep 3 # THREAD_CACHE_TIME

exit 0
root@ruby30-segfault-fix:~# time while true; do ruby reproducer.rb; done
^Creproducer.rb:7:in `sleep': Interrupt
 from reproducer.rb:7:in `<main>'

real 8m4.811s
user 0m10.094s
sys 0m4.370s

More than 8 minutes running the script without any segfault.