Project

General

Profile

This project is closed and read-only.

Actions

Backport #2473

closed

Handle leak in TCPServer on Windows

Backport #2473: Handle leak in TCPServer on Windows

Added by TimWalters (Tim Walters) almost 17 years ago. Updated about 7 years ago.

Status:
Closed
[ruby-core:27138]

Description

=begin

  1. Run the following program on Windows (XP, haven't tried others) using Ruby 1.9.1p0:

require 'socket'

server = TCPServer.open(2000)
while (true)
socket = server.accept
cmd = socket.readline.chomp
puts cmd
socket.close
end

  1. Open the task manager, add "Handles" to the columns being viewed, and observe how many handles are being used.

  2. Open an irb window and execute the following lines:

s = TCPSocket.new('localhost', 2000)
s.puts('foo')

  1. In the task manager, note that the number of handles used by the first process has increased. Every time you connect, three handles are added; when you write and the socket is closed, only two are released.

  2. Try the same instructions using Ruby 1.8.2. All the handles are released, and there is no leak.
    =end

Updated by usa (Usaku NAKAMURA) almost 17 years ago Actions #1

  • Status changed from Open to Assigned
  • Assignee set to yugui (Yuki Sonoda)

=begin
It's fixed on trunk, in r25569.
Yugui, can you backport the first hunk of the changeset?
=end

Updated by yugui (Yuki Sonoda) over 16 years ago Actions #2

  • Category set to core
  • Assignee changed from yugui (Yuki Sonoda) to usa (Usaku NAKAMURA)

=begin
I did not merge r24218 into ruby_1_9_1, so r25569 is not applicable.

Is the reported problem still reproducible? < unak
=end

Updated by usa (Usaku NAKAMURA) over 16 years ago Actions #3

=begin
Sorry, I've mistaken.
Please backport the first hunk of r25611.
=end

Updated by usa (Usaku NAKAMURA) over 16 years ago Actions #4

  • Assignee changed from usa (Usaku NAKAMURA) to yugui (Yuki Sonoda)

=begin

=end

Updated by jeremyevans0 (Jeremy Evans) about 7 years ago Actions #5

  • Description updated (diff)
  • Status changed from Assigned to Closed
Actions

Also available in: PDF Atom