Bug #4535

[PATCH] fix race in blocking send_io/recv_io

Added by Eric Wong about 4 years ago. Updated almost 4 years ago.

[ruby-core:35574]
Status:Closed
Priority:Normal
Assignee:Motohiro KOSAKI
ruby -v:ruby 1.9.3dev (2011-03-28 trunk 31195) [x86_64-linux] Backport:

Description

=begin
There is no need to call select() before entering a blocking I/O
region since other threads may run. select() cannot guarantee
readability if the IO is shared across different
threads/processes. Furthermore, we actually need to select() on
EAGAIN/EINTR since the functions are intended to be blocking so
we move the select() calls into the retry loop.

=end

0001-ext-socket-unixsocket.c-fix-race-in-blocking-send_io.patch Magnifier (1.69 KB) Eric Wong, 03/29/2011 06:23 AM

0002-test-socket-test_unix.rb-test-case-for-bug-4535.patch Magnifier - test case which reproduces the fixed error on my machine (1.92 KB) Eric Wong, 03/29/2011 06:37 AM

History

#1 Updated by Eric Wong about 4 years ago

=begin
I managed to get a reproducible test case working on a machine I have access to.
=end

#2 Updated by Eric Wong about 4 years ago

Eric Wong normalperson@yhbt.net wrote:


Bug #4535: [PATCH] fix race in blocking send_io/recv_io
http://redmine.ruby-lang.org/issues/4535

Btw, this was pushed this out to my git repo for convenience, I've
just rebased and repushed:

git pull git://bogomips.org/ruby fix-unix-send-recv-io

I really look forward to this fix getting into trunk and backported to
1.9.2, thanks!

--
Eric Wong

#3 Updated by Eric Wong almost 4 years ago

Eric Wong normalperson@yhbt.net wrote:


Bug #4535: [PATCH] fix race in blocking send_io/recv_io
http://redmine.ruby-lang.org/issues/4535

Ping? This may become a big issue for some apps I'm working on.

--
Eric Wong

#4 Updated by Koichi Sasada almost 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to Motohiro KOSAKI

#5 Updated by Akira Tanaka almost 4 years ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF