ruby-changes:39471
From: nagachika <ko1@a...>
Date: Wed, 12 Aug 2015 23:55:36 +0900 (JST)
Subject: [ruby-changes:39471] nagachika:r51552 (ruby_2_2): merge revision(s) 51202, 51203, 51204: [Backport #11340]
nagachika 2015-08-12 23:55:00 +0900 (Wed, 12 Aug 2015) New Revision: 51552 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51552 Log: merge revision(s) 51202,51203,51204: [Backport #11340] * win32/win32.c (waitpid): return immediately if interrupted. reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/test/ruby/test_process.rb branches/ruby_2_2/version.h branches/ruby_2_2/win32/win32.c Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 51551) +++ ruby_2_2/ChangeLog (revision 51552) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Wed Aug 12 23:53:39 2015 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (waitpid): return immediately if interrupted. + reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340] + Wed Aug 12 01:05:58 2015 Jeremy Evans <merch-redmine@j...> * test/openssl/test_ssl.rb: Fix LocalJumpErrors being raised Index: ruby_2_2/win32/win32.c =================================================================== --- ruby_2_2/win32/win32.c (revision 51551) +++ ruby_2_2/win32/win32.c (revision 51552) @@ -4297,7 +4297,9 @@ waitpid(rb_pid_t pid, int *stat_loc, int https://github.com/ruby/ruby/blob/trunk/ruby_2_2/win32/win32.c#L4297 while (!(pid = poll_child_status(child, stat_loc))) { /* wait... */ - if (rb_w32_wait_events_blocking(&child->hProcess, 1, timeout) != WAIT_OBJECT_0) { + int ret = rb_w32_wait_events_blocking(&child->hProcess, 1, timeout); + if (ret == WAIT_OBJECT_0 + 1) return -1; /* maybe EINTR */ + if (ret != WAIT_OBJECT_0) { /* still active */ if (options & WNOHANG) { pid = 0; Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 51551) +++ ruby_2_2/version.h (revision 51552) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.3" #define RUBY_RELEASE_DATE "2015-08-12" -#define RUBY_PATCHLEVEL 158 +#define RUBY_PATCHLEVEL 159 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 8 Index: ruby_2_2/test/ruby/test_process.rb =================================================================== --- ruby_2_2/test/ruby/test_process.rb (revision 51551) +++ ruby_2_2/test/ruby/test_process.rb (revision 51552) @@ -1299,6 +1299,29 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_process.rb#L1299 end end + def test_wait_exception + bug11340 = '[ruby-dev:49176] [Bug #11340]' + t0 = t1 = nil + IO.popen([RUBY, '-e', 'puts;STDOUT.flush;Thread.start{gets;exit};sleep(3)'], 'r+') do |f| + pid = f.pid + f.gets + t0 = Time.now + th = Thread.start(Thread.current) do |main| + Thread.pass until main.stop? + main.raise Interrupt + end + begin + assert_raise(Interrupt) {Process.wait(pid)} + ensure + th.kill.join + end + t1 = Time.now + f.puts + end + assert_operator(t1 - t0, :<, 3, + ->{"#{bug11340}: #{t1-t0} seconds to interrupt Process.wait"}) + end + def test_abort with_tmpchdir do s = run_in_child("abort") Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r51202-51204 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/