[前][次][番号順一覧][スレッド一覧]

ruby-changes:32608

From: charliesome <ko1@a...>
Date: Thu, 23 Jan 2014 14:07:53 +0900 (JST)
Subject: [ruby-changes:32608] charliesome:r44687 (trunk): * process.c (recv_child_error): Fix deadlock in rb_fork_internal when a

charliesome	2014-01-23 14:07:48 +0900 (Thu, 23 Jan 2014)

  New Revision: 44687

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44687

  Log:
    * process.c (recv_child_error): Fix deadlock in rb_fork_internal when a
      signal is sent to the parent process while Ruby is forking in IO.popen.
    
      Patch by Scott Francis. Closes GH-513.

  Modified files:
    trunk/process.c
Index: process.c
===================================================================
--- process.c	(revision 44686)
+++ process.c	(revision 44687)
@@ -3339,8 +3339,11 @@ recv_child_error(int fd, int *statep, VA https://github.com/ruby/ruby/blob/trunk/process.c#L3339
     }
 #define READ_FROM_CHILD(ptr, len) \
     (NIL_P(io) ? read(fd, (ptr), (len)) : rb_io_bufread(io, (ptr), (len)))
-    if ((size = READ_FROM_CHILD(&err, sizeof(err))) < 0) {
+    while ((size = READ_FROM_CHILD(&err, sizeof(err))) < 0) {
         err = errno;
+        if (err != EINTR) {
+            break;
+        }
     }
     *errp = err;
     if (size == sizeof(err) &&

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]