Project

General

Profile

Backport #6296

Please backport r35249, r35250 (Ctrl-C handler do not work from exec process (Windows))

Added by h.shirosaki (Hiroshi Shirosaki) almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:44360]

Description

Backport request for #6131.

r35249 fix for bug #6131
Reverting CREATE_NEW_PROCESS_GROUP flag usage would be better for compatibility with existing applications.

r35250 fix for bug #5812
Alternative fix for TestThreadGroup#test_thread_timer_and_interrupt on Windows.

Associated revisions

Revision 97d00bcd
Added by naruse (Yui NARUSE) almost 8 years ago

merge revision(s) 35249,35250: [Backport #6296]

    * include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration of
      new function.

    * process.c (enum): add EXEC_OPTION_PGROUP and move the position
      above for the usage in proc_spawn_n().

    * process.c (proc_spawn_n): add an argument to pass new option
      `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
      CreateProcessW(). This flag is necessary for the usage of
      Process.kill on the subprocess on Windows.

    * process.c (rb_exec_arg_addopt): ditto.

    * process.c (rb_spawn_process): ditto.

    * process.c (documentation for rb_f_spawn): add documentation for new
      option `new_pgroup` of spawn.

    * test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
      add tests for option `new_pgroup`.

    * test/ruby/test_thread.rb
      (TestThreadGroup#test_thread_timer_and_interrupt):
      add option `new_pgroup: true` to spawn on Windows. It's needed for
      Process.kill on a subprocess.

    * win32/win32.c (CreateChild): add an argument to pass
      dwCreationFlags of CreateProcessW().

    * win32/win32.c (rb_w32_spawn): ditto.

    * win32/win32.c (rb_w32_aspawn_flags): add new function to pass
      dwCreationFlags.

    * win32/win32.c (rb_w32_aspawn): refactor to move the content to
      rb_w32_aspawn_flags().
      [ruby-core:43245][Bug #6131]

    * test/ruby/test_thread.rb
      (TestThreadGroup#test_thread_timer_and_interrupt): skip on Windows.
      Process.kill cannot kill a subprocess if CREATE_NEW_PROCESS_GROUP
      flag is not specified in a call to CreateProcessW().

    * win32/win32.c (CreateChild): revert the usage of
      CREATE_NEW_PROCESS_GROUP flag for compatibility.
      [ruby-core:43245][Bug #6131]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35332
Added by naruse (Yui NARUSE) almost 8 years ago

merge revision(s) 35249,35250: [Backport #6296]

* include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration of
  new function.

* process.c (enum): add EXEC_OPTION_PGROUP and move the position
  above for the usage in proc_spawn_n().

* process.c (proc_spawn_n): add an argument to pass new option
  `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
  CreateProcessW(). This flag is necessary for the usage of
  Process.kill on the subprocess on Windows.

* process.c (rb_exec_arg_addopt): ditto.

* process.c (rb_spawn_process): ditto.

* process.c (documentation for rb_f_spawn): add documentation for new
  option `new_pgroup` of spawn.

* test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
  add tests for option `new_pgroup`.

* test/ruby/test_thread.rb
  (TestThreadGroup#test_thread_timer_and_interrupt):
  add option `new_pgroup: true` to spawn on Windows. It's needed for
  Process.kill on a subprocess.

* win32/win32.c (CreateChild): add an argument to pass
  dwCreationFlags of CreateProcessW().

* win32/win32.c (rb_w32_spawn): ditto.

* win32/win32.c (rb_w32_aspawn_flags): add new function to pass
  dwCreationFlags.

* win32/win32.c (rb_w32_aspawn): refactor to move the content to
  rb_w32_aspawn_flags().
  [ruby-core:43245][Bug #6131]

* test/ruby/test_thread.rb
  (TestThreadGroup#test_thread_timer_and_interrupt): skip on Windows.
  Process.kill cannot kill a subprocess if CREATE_NEW_PROCESS_GROUP
  flag is not specified in a call to CreateProcessW().

* win32/win32.c (CreateChild): revert the usage of
  CREATE_NEW_PROCESS_GROUP flag for compatibility.
  [ruby-core:43245][Bug #6131]

History

#1

Updated by naruse (Yui NARUSE) almost 8 years ago

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

This issue was solved with changeset r35332.
Hiroshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 35249,35250: [Backport #6296]

* include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration of
  new function.

* process.c (enum): add EXEC_OPTION_PGROUP and move the position
  above for the usage in proc_spawn_n().

* process.c (proc_spawn_n): add an argument to pass new option
  `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
  CreateProcessW(). This flag is necessary for the usage of
  Process.kill on the subprocess on Windows.

* process.c (rb_exec_arg_addopt): ditto.

* process.c (rb_spawn_process): ditto.

* process.c (documentation for rb_f_spawn): add documentation for new
  option `new_pgroup` of spawn.

* test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
  add tests for option `new_pgroup`.

* test/ruby/test_thread.rb
  (TestThreadGroup#test_thread_timer_and_interrupt):
  add option `new_pgroup: true` to spawn on Windows. It's needed for
  Process.kill on a subprocess.

* win32/win32.c (CreateChild): add an argument to pass
  dwCreationFlags of CreateProcessW().

* win32/win32.c (rb_w32_spawn): ditto.

* win32/win32.c (rb_w32_aspawn_flags): add new function to pass
  dwCreationFlags.

* win32/win32.c (rb_w32_aspawn): refactor to move the content to
  rb_w32_aspawn_flags().
  [ruby-core:43245][Bug #6131]

* test/ruby/test_thread.rb
  (TestThreadGroup#test_thread_timer_and_interrupt): skip on Windows.
  Process.kill cannot kill a subprocess if CREATE_NEW_PROCESS_GROUP
  flag is not specified in a call to CreateProcessW().

* win32/win32.c (CreateChild): revert the usage of
  CREATE_NEW_PROCESS_GROUP flag for compatibility.
  [ruby-core:43245][Bug #6131]

Also available in: Atom PDF