Project

General

Profile

Actions

Bug #3973

closed

Unexpected error and segmentation fault without close

Added by niw (Yoshimasa Niwa) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
Backport:
[ruby-dev:42439]

Description

=begin
Run next small code on ruby 1.9.2p0 shows unexpected TypeError on line 3.

while true
f = File.open("/dev/null", "w")
f.write("a") # => in `': wrong argument type #Class:0x0000010086dbb0 (expected Data) (TypeError)
end

This code doesn't have "f.close" so it's buggy, but it may not raise TypeError.
Also, next code causes segmentation fault.

require 'net/http'
while true
Net::HTTP.get(URI.parse("http://localhost/"))
f = File.open("/dev/null", "w")
f.write("a")
end

Ruby 1.9.2p0で、closeし忘れのopenがwhileの中にあると、予期しないTypeErrorが発生し、
また場合によってはSegmentation Faultが発生します。
=end


Related issues 1 (0 open1 closed)

Is duplicate of Backport192 - Backport #3910: SEGV at fptr_finalizeClosedyugui (Yuki Sonoda)10/06/2010Actions
Actions #1

Updated by nagachika (Tomoyuki Chikanaga) over 13 years ago

=begin
すみません、チケット作ったらとすすめたのはわたしなのですが、
おそらく http://redmine.ruby-lang.org/issues/show/3910 と同一でした。
=end

Actions #2

Updated by naruse (Yui NARUSE) over 13 years ago

  • Status changed from Open to Closed

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0