[#35027] [Ruby 1.9-Bug#4352][Open] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s) — "James M. Lawrence" <redmine@...>

Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)

16 messages 2011/02/01

[#35114] [Ruby 1.9-Bug#4373][Open] http.rb:677: [BUG] Segmentation fault — Christian Fazzini <redmine@...>

Bug #4373: http.rb:677: [BUG] Segmentation fault

59 messages 2011/02/06

[#35171] [Ruby 1.9-Bug#4386][Open] encoding: directive does not affect regex expressions — mathew murphy <redmine@...>

Bug #4386: encoding: directive does not affect regex expressions

9 messages 2011/02/09

[#35237] [Ruby 1.9-Bug#4400][Open] nested at_exit hooks run in strange order — Suraj Kurapati <redmine@...>

Bug #4400: nested at_exit hooks run in strange order

12 messages 2011/02/15

[ruby-core:35203] [Ruby 1.9-Bug#4390][Open] TCPSocket#readline doesn't raise if the socket is #close'd in another thread

From: Alex Young <redmine@...>
Date: 2011-02-11 16:19:17 UTC
List: ruby-core #35203
Bug #4390: TCPSocket#readline doesn't raise if the socket is #close'd in another thread
http://redmine.ruby-lang.org/issues/show/4390

Author: Alex Young
Status: Open, Priority: Normal
Category: core, Target version: 1.9.2
ruby -v: ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]

In Ruby 1.8.7-p302, the following code outputs "Success!". On 1.9.2-p136, it hangs at q.pop, because the blocked readline doesn't raise (or, more precisely, it does, I think, but the thread isn't woken up to process it).

 require 'socket'
 require 'thread'

 server = TCPServer.new("localhost", 0)
 serv_thread = Thread.new{ server.accept }
 sleep(0.1)
 sock = TCPSocket.new("localhost", server.addr[1])

 q = Queue.new
 client_thread = Thread.new{
   begin
     sock.readline
     q.push "OK"
   rescue StandardError => e
     p e
     q.push(e)
   end
 }


 sleep(0.1) while client_thread.status == "run"
 sock.close
 err = q.pop
 puts "Success!"


It's not immediately clear which is the correct behaviour, but I'm raising an issue against 1.9.2 on the principle that unless there was a conscious decision to change behaviour, a change indicates that something broke. I should also add that this behaviour is *not* observed in i386-cygwin.


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

In This Thread

Prev Next