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>"
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.
# Verification Mantic
root@ruby31- segfault- fix:~# dpkg -l ruby3.1 Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ====-== ======= ======= -====== ======- ======= ======= ======= ======= ======= ======= ======= ===== segfault- fix:~# cat reproducer.rb
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii ruby3.1 3.1.2-7ubuntu3.1 amd64 Interpreter of object-oriented scripting language Ruby
root@ruby31-
require 'nokogiri'
# must have an error in it to cause pthread_setspecific to be called asdf</div> "
html = "<div foo='asdf>
Thread.new { Nokogiri: :HTML4: :Document. parse(html) }
sleep 3 # THREAD_CACHE_TIME
exit 0 segfault- fix:~# time while true; do ruby reproducer.rb; done rb:7:in `sleep': Interrupt
root@ruby31-
^Creproducer.
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 Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ====-== ======= ======= -====== ======- ======= ======= ======= ======= ======= ======= ======= ===== segfault- fix:~# cat reproducer.rb
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii ruby3.0 3.0.2-7ubuntu2.5 amd64 Interpreter of object-oriented scripting language Ruby
root@ruby30-
require 'nokogiri'
# must have an error in it to cause pthread_setspecific to be called asdf</div> "
html = "<div foo='asdf>
Thread.new { Nokogiri: :HTML4: :Document. parse(html) }
sleep 3 # THREAD_CACHE_TIME
exit 0 segfault- fix:~# time while true; do ruby reproducer.rb; done rb:7:in `sleep': Interrupt
root@ruby30-
^Creproducer.
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.