Bug #9547

TCPSocket.new causes an infinite loop when interrupted by a signal

Added by Shugo Maeda about 1 year ago. Updated about 1 year ago.

[ruby-core:60940]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.2.0dev (2014-02-21 trunk 45076) [x86_64-freebsd10.0] Backport:1.9.3: DONE, 2.0.0: DONE, 2.1: DONE

Description

The script attached in #9356 goes in an infinite loop on FreeBSD (and other platforms conforming to SUSv3).
Naruse-san asked me to create a separate ticket for backporting.

This bug seems to have been introduced by r31424.


Related issues

Related to Ruby trunk - Bug #9356: TCPSocket.new does not seem to handle INTR Closed 01/03/2014
Copied from Ruby trunk - Bug #9546: TCPSocket.new causes an infinite loop when interrupted by a signal Rejected 02/21/2014

Associated revisions

Revision 45084
Added by Shugo Maeda about 1 year ago

  • ext/socket/init.c (wait_connectable): break if the socket is writable to avoid infinite loops on FreeBSD and other platforms which conforms to SUSv3. This problem cannot be reproduced with loopback interfaces, so it's hard to write test code. rsock_connect() and wait_connectable() are overly complicated, so they should be refactored, but I commit this fix as a workaround for the release of Ruby 1.9.3 scheduled on Feb 24. [Bug #9547]

Revision 45084
Added by Shugo Maeda about 1 year ago

  • ext/socket/init.c (wait_connectable): break if the socket is writable to avoid infinite loops on FreeBSD and other platforms which conforms to SUSv3. This problem cannot be reproduced with loopback interfaces, so it's hard to write test code. rsock_connect() and wait_connectable() are overly complicated, so they should be refactored, but I commit this fix as a workaround for the release of Ruby 1.9.3 scheduled on Feb 24. [Bug #9547]

History

#1 Updated by Shugo Maeda about 1 year ago

  • Copied from Bug #9546: TCPSocket.new causes an infinite loop when interrupted by a signal added

#2 Updated by Shugo Maeda about 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45084.


  • ext/socket/init.c (wait_connectable): break if the socket is writable to avoid infinite loops on FreeBSD and other platforms which conforms to SUSv3. This problem cannot be reproduced with loopback interfaces, so it's hard to write test code. rsock_connect() and wait_connectable() are overly complicated, so they should be refactored, but I commit this fix as a workaround for the release of Ruby 1.9.3 scheduled on Feb 24. [Bug #9547]

#3 Updated by Usaku NAKAMURA about 1 year ago

  • Related to Bug #9356: TCPSocket.new does not seem to handle INTR added

#4 Updated by Usaku NAKAMURA about 1 year ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: DONE, 2.0.0: REQUIRED, 2.1: REQUIRED

backported into ruby_1_9_3 at r45092.

#5 Updated by Tomoyuki Chikanaga about 1 year ago

  • Backport changed from 1.9.3: DONE, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: DONE, 2.0.0: DONE, 2.1: REQUIRED

r45084 was backported to ruby_2_0_0 at r45103.

#6 Updated by Yui NARUSE about 1 year ago

  • Backport changed from 1.9.3: DONE, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: DONE, 2.0.0: DONE, 2.1: DONE

ruby_2_1 r45129 merged revision(s) 45084.

Also available in: Atom PDF