Bug #3910: SEGV at fptr_finalize
http://redmine.ruby-lang.org/issues/show/3910

起票者: Masaki Matsushita
ステータス: Open, 優先度: Normal
Target version: 1.9.2
ruby -v: ruby 1.9.2p0 (2010-08-18) [i686-linux]

次のようなコードを実行すると、SEGVします。

#-*- coding: utf-8 -*-
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'RMagick'

def create
  io = open("data","w+:UTF-8")
  io.print "hoge"
end

create

doc = Nokogiri::XML(open("http://www.google.co.jp/"))

puts "sleep"
sleep

--ここまで--

~/ruby% ruby SEGV.rb
<internal:lib/rubygems/custom_require>:29: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18) [i686-linux]

-- control frame ----------
c:0014 p:---- s:0088 b:0088 l:000087 d:000087 CFUNC  :require
c:0013 p:0013 s:0084 b:0084 l:000083 d:000083 METHOD <internal:lib/rubygems/custom_require>:29
c:0012 p:0132 s:0079 b:0079 l:000078 d:000078 METHOD /usr/local/lib/ruby/1.9.1/open-uri.rb:260
c:0011 p:0024 s:0059 b:0059 l:000058 d:000058 METHOD /usr/local/lib/ruby/1.9.1/open-uri.rb:769
c:0010 p:0047 s:0053 b:0053 l:000ca0 d:000052 BLOCK  /usr/local/lib/ruby/1.9.1/open-uri.rb:203
c:0009 p:---- s:0051 b:0051 l:000050 d:000050 FINISH
c:0008 p:---- s:0049 b:0049 l:000048 d:000048 CFUNC  :catch
c:0007 p:0491 s:0045 b:0045 l:000ca0 d:000ca0 METHOD /usr/local/lib/ruby/1.9.1/open-uri.rb:201
c:0006 p:0328 s:0031 b:0031 l:000030 d:000030 METHOD /usr/local/lib/ruby/1.9.1/open-uri.rb:146
c:0005 p:0022 s:0020 b:0020 l:000019 d:000019 METHOD /usr/local/lib/ruby/1.9.1/open-uri.rb:671
c:0004 p:0096 s:0015 b:0015 l:000014 d:000014 METHOD /usr/local/lib/ruby/1.9.1/open-uri.rb:33
c:0003 p:0093 s:0008 b:0007 l:0024ec d:001bf8 EVAL   SEGV.rb:14
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0024ec d:0024ec TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
SEGV.rb:14:in `<main>'
/usr/local/lib/ruby/1.9.1/open-uri.rb:33:in `open'
/usr/local/lib/ruby/1.9.1/open-uri.rb:671:in `open'
/usr/local/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
/usr/local/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop'
/usr/local/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
/usr/local/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop'
/usr/local/lib/ruby/1.9.1/open-uri.rb:769:in `buffer_open'
/usr/local/lib/ruby/1.9.1/open-uri.rb:260:in `open_http'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'

-- C level backtrace information -------------------------------------------
ruby(rb_vm_bugreport+0xa5) [0x81613e5]
ruby() [0x81a0189]
ruby(rb_bug+0x28) [0x81a0238]
ruby() [0x80f34d8]
[0x2a3410]
ruby() [0x8137b72]
ruby(rb_class_path+0x16) [0x8137d76]
ruby(rb_obj_classname+0x3a) [0x813888a]
ruby() [0x81a1835]
ruby(rb_check_typeddata+0x26) [0x81a18f6]
ruby(rb_mutex_lock+0x1c) [0x816723c]
ruby(rb_mutex_synchronize+0x12) [0x81677e2]
ruby() [0x8077edc]
ruby() [0x80782ed]
ruby(rb_io_fptr_finalize+0xd4) [0x8078c44]
ruby() [0x806711e]
ruby(rb_gc_finalize_deferred+0x29) [0x8067679]
ruby() [0x8164e35]
ruby() [0x8151a8f]
ruby(rb_funcall+0x9a) [0x815264a]
ruby(rb_hash_aref+0x5d) [0x806cb1d]
ruby() [0x81a8dbb]
ruby(rb_realpath_internal+0x179) [0x81a9999]
ruby() [0x814929e]
ruby(rb_iseq_new_with_opt+0x7b) [0x814b5bb]
ruby() [0x8139a91]
ruby() [0x813daf4]
ruby() [0x813b1cb]
ruby(rb_iseq_compile_node+0x85c) [0x81438fc]
ruby(rb_iseq_new_with_opt+0x8a) [0x814b5ca]
ruby() [0x8139a91]
ruby() [0x813e276]
ruby() [0x813b1cb]
ruby(rb_iseq_compile_node+0x85c) [0x81438fc]
ruby(rb_iseq_new_with_opt+0x8a) [0x814b5ca]
ruby() [0x8139a91]
ruby() [0x813e276]
ruby() [0x813b1cb]
ruby(rb_iseq_compile_node+0x68e) [0x814372e]
ruby() [0x814af82]
ruby(rb_iseq_new_top+0x41) [0x814b1c1]
ruby() [0x81a2705]
ruby(rb_require_safe+0x54a) [0x81a3d9a]
ruby() [0x8158181]
ruby() [0x815a528]
ruby() [0x815df06]
ruby() [0x815f09d]
ruby(rb_catch_obj+0x9f) [0x814c86f]
ruby() [0x814da96]
ruby() [0x814ccc5]
ruby() [0x8158181]
ruby() [0x815a528]
ruby() [0x815df06]
ruby(rb_iseq_eval_main+0x1c7) [0x815e2d7]
ruby() [0x805e492]
ruby(ruby_run_node+0x32) [0x805fcb2]
ruby(main+0x5a) [0x805d6ca]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x3d4bd6]
ruby() [0x805d5d1]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

zsh: abort      ruby SEGV.rb

rmagickのバージョンは2.13.1、nokogiriは1.4.3.1です。
--disable-sharedでないと再現しません。


----------------------------------------
http://redmine.ruby-lang.org