Thanks for reporting this issue.
I was able to reproduce this in a fresh jammy installation in a VM.
Reproducer (as proposed in https://github.com/ruby/ruby/pull/7663):
# apt update && apt install -y ruby ruby-nokogiri
# cat > reproducer.rb <<EOF 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 EOF
# while true; do ruby reproducer.rb; done
After a while (this may take several minutes to manifest) I got the reported error:
[BUG] Segmentation fault at 0x0000000000000440[BUG] Segmentation fault at 0x0000000000000440 ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
-- Machine register context ------------------------------------------------ RIP: 0x00007c8ec2ac2fcb RBP: 0x000059ae2e596d20 RSP: 0x00007c8ebc5fed70 RAX: 0x0000000000000000 RBX: 0x00007c8ebc5ff640 RCX: 0x0000000000000006 RDX: 0x0000000000000002[BUG] [BUG] Segmentation fault at 0x0000000000000440 ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
-- Machine register context ------------------------------------------------ RIP: 0x000075c4b4ec2fcb RBP: 0x000062693580e190 RSP: 0x000075c4ae9fed70 RAX: 0x0000000000000000 RBX: 0x000075c4ae9ff640 RCX: 0x0000000000000006 RDX: 0x0000000000000002 RDI: 0x000062693580e190 RSI: 0x0000000000000000 R8: 0x000075c4ae9fede4 R9: 0x00000000000000ca R10: 0x0000000000000000 R11: 0x0000000000000246 R12: 0x000075c4b5170b40 R13: 0x000075c4ae9fedc0
Thanks for reporting this issue.
I was able to reproduce this in a fresh jammy installation in a VM.
Reproducer (as proposed in https:/ /github. com/ruby/ ruby/pull/ 7663):
# apt update && apt install -y ruby ruby-nokogiri
# cat > reproducer.rb <<EOF
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
EOF
# while true; do ruby reproducer.rb; done
After a while (this may take several minutes to manifest) I got the reported error:
[BUG] Segmentation fault at 0x0000000000000 440[BUG] Segmentation fault at 0x0000000000000440
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
-- Machine register context ------- ------- ------- ------- ------- ------- ------ 002[BUG] [BUG] Segmentation fault at 0x0000000000000440
RIP: 0x00007c8ec2ac2fcb RBP: 0x000059ae2e596d20 RSP: 0x00007c8ebc5fed70
RAX: 0x0000000000000000 RBX: 0x00007c8ebc5ff640 RCX: 0x0000000000000006
RDX: 0x0000000000000
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
-- Machine register context ------- ------- ------- ------- ------- ------- ------
RIP: 0x000075c4b4ec2fcb RBP: 0x000062693580e190 RSP: 0x000075c4ae9fed70
RAX: 0x0000000000000000 RBX: 0x000075c4ae9ff640 RCX: 0x0000000000000006
RDX: 0x0000000000000002 RDI: 0x000062693580e190 RSI: 0x0000000000000000
R8: 0x000075c4ae9fede4 R9: 0x00000000000000ca R10: 0x0000000000000000
R11: 0x0000000000000246 R12: 0x000075c4b5170b40
R13: 0x000075c4ae9fedc0