# \[Ruby 1.9-Bug#3910\]\[Open\] SEGV at fptr\_finalize

**URL:** <https://www.ruby-forum.com/t/ruby-1-9-bug-3910-open-segv-at-fptr-finalize/196055>\
**Category:** Development\
**Created:** [October 6, 2010, 4:22am UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3910-open-segv-at-fptr-finalize/196055 "2010-10-06T04:22:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masaki\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Masaki\_M](https://www.ruby-forum.com/u/Masaki_M)\
**Post date:** [October 6, 2010, 4:22am UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3910-open-segv-at-fptr-finalize/196055/1 "2010-10-06T04:22:21Z")

</div>

Bug #3910: SEGV at fptr\_finalize  
[http://redmine.ruby-lang.org/issues/show/3910](http://redmine.ruby-lang.org/issues/show/3910)

e$B5/I\<\<Te(B: Masaki M.  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
Target version: 1.9.2  
ruby -v: ruby 1.9.2p0 (2010-08-18) [i686-linux]

e$B\<!$N$h$&$J%3!\<%I$r\<B9T$9$k$H!"e(BSEGVe$B$7$^$9!#e(B

#-_- 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/](http://www.google.co.jp/)”))

puts “sleep”  
sleep

–e$B$3$3$^$Ge(B–

~/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](http://www.ruby-lang.org/bugreport.html)

zsh: abort ruby SEGV.rb

rmagicke$B$N%P!\<%8%g%s$Oe(B2.13.1e$B!"e(Bnokogirie$B$Oe(B1.4.3.1e$B$G$9!#e(B  
–disable-sharede$B$G$J$$$H:F8=$7$^$;$s!#e(B

---

<div class="post-metadata">

**Author:** ![Masaki\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Masaki\_M](https://www.ruby-forum.com/u/Masaki_M)\
**Post date:** [October 6, 2010, 4:41am UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3910-open-segv-at-fptr-finalize/196055/2 "2010-10-06T04:41:40Z")

</div>

e$B%A%1%C%He(B #3910 e$B$,99?7$5$l$^$7$?!#e(B (by Shota F.)

sora\_he$B$G$9!#e(B  
e$B30It%i%$%V%i%j0MB8$r30$7$F$\_$^$7$?$,!":#EY$Oe(BC level  
tracktracee$B$,=PNO$5$l$J$/$J$j$^$7$?$M!#e(B

#-_- coding: utf-8 -_-  
require ‘open-uri’

def create  
io = open(“/dev/null”,“w”)  
io.print “hoge”  
end

create

doc = open(“[http://www.google.co.jp/](http://www.google.co.jp/)”)

–

internal:lib/rubygems/custom\_require:29: [BUG] Segmentation fault  
ruby 1.9.2p0 (2010-08-18) [x86\_64-darwin10.4.0]

## – control frame ---------- c:0014 p:---- s:0087 b:0087 l:000086 d:000086 CFUNC :require c:0013 p:0013 s:0083 b:0083 l:000082 d:000082 METHOD internal:lib/rubygems/custom\_require:29 c:0012 p:0132 s:0078 b:0078 l:000077 d:000077 METHOD /Users/sorah/git/ruby/core/lib/open-uri.rb:260 c:0011 p:0024 s:0058 b:0058 l:000057 d:000057 METHOD /Users/sorah/git/ruby/core/lib/open-uri.rb:769 c:0010 p:0047 s:0052 b:0052 l:002290 d:000051 BLOCK /Users/sorah/git/ruby/core/lib/open-uri.rb:203 c:0009 p:---- s:0050 b:0050 l:000049 d:000049 FINISH c:0008 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :catch c:0007 p:0491 s:0044 b:0044 l:002290 d:002290 METHOD /Users/sorah/git/ruby/core/lib/open-uri.rb:201 c:0006 p:0328 s:0030 b:0030 l:000029 d:000029 METHOD /Users/sorah/git/ruby/core/lib/open-uri.rb:146 c:0005 p:0022 s:0019 b:0019 l:000018 d:000018 METHOD /Users/sorah/git/ruby/core/lib/open-uri.rb:671 c:0004 p:0096 s:0014 b:0014 l:000013 d:000013 METHOD /Users/sorah/git/ruby/core/lib/open-uri.rb:33 c:0003 p:0050 s:0007 b:0007 l:001598 d:0018a0 EVAL test.rb:11 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:001598 d:001598 TOP

## – Ruby level backtrace information

test.rb:11:in `<main>' /Users/sorah/git/ruby/core/lib/open-uri.rb:33:in `open’  
/Users/sorah/git/ruby/core/lib/open-uri.rb:671:in `open' /Users/sorah/git/ruby/core/lib/open-uri.rb:146:in `open\_uri’  
/Users/sorah/git/ruby/core/lib/open-uri.rb:201:in `open_loop' /Users/sorah/git/ruby/core/lib/open-uri.rb:201:in `catch’  
/Users/sorah/git/ruby/core/lib/open-uri.rb:203:in `block in open_loop' /Users/sorah/git/ruby/core/lib/open-uri.rb:769:in `buffer\_open’  
/Users/sorah/git/ruby/core/lib/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

[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](http://www.ruby-lang.org/bugreport.html)

* * *

[http://redmine.ruby-lang.org/issues/show/3910](http://redmine.ruby-lang.org/issues/show/3910)

---

<div class="post-metadata">

**Author:** ![Masaki\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Masaki\_M](https://www.ruby-forum.com/u/Masaki_M)\
**Post date:** [October 6, 2010, 5:16am UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3910-open-segv-at-fptr-finalize/196055/3 "2010-10-06T05:16:47Z")

</div>

e$B%A%1%C%He(B #3910 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B

This issue was solved with changeset r29415.  
Makoto, thank you for reporting this issue.  
Your contribution to Ruby is greatly appreciated.  
May Ruby be with you.

* * *

[http://redmine.ruby-lang.org/issues/show/3910](http://redmine.ruby-lang.org/issues/show/3910)
