[PATCH v2 0/1] Cygwin: pty: Add a workaround for ^C handling.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH v2 0/1] Cygwin: pty: Add a workaround for ^C handling.

Takashi Yano
- Pseudo console support introduced by commit
  169d65a5774acc76ce3f3feeedcbae7405aa9b57 sometimes cause random
  crash or freeze by pressing ^C while cygwin and non-cygwin
  processes are executed simultaneously in the same pty. This
  patch is a workaround for this issue.

v2:
Make the behaviour of pty and console identical.

Takashi Yano (1):
  Cygwin: pty: Add a workaround for ^C handling.

 winsup/cygwin/fork.cc  | 1 -
 winsup/cygwin/spawn.cc | 6 ++++++
 2 files changed, 6 insertions(+), 1 deletion(-)

--
2.21.0

Reply | Threaded
Open this post in threaded view
|

[PATCH v2 1/1] Cygwin: pty: Add a workaround for ^C handling.

Takashi Yano
- Pseudo console support introduced by commit
  169d65a5774acc76ce3f3feeedcbae7405aa9b57 sometimes cause random
  crash or freeze by pressing ^C while cygwin and non-cygwin
  processes are executed simultaneously in the same pty. This
  patch is a workaround for this issue.
---
 winsup/cygwin/fork.cc  | 1 -
 winsup/cygwin/spawn.cc | 6 ++++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index a3a7e7505..0a929dffd 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -213,7 +213,6 @@ frok::child (volatile char * volatile here)
      - terminate the current fork call even if the child is initialized. */
   sync_with_parent ("performed fork fixups and dynamic dll loading", true);
 
-  init_console_handler (myself->ctty > 0);
   ForceCloseHandle1 (fork_info->forker_finished, forker_finished);
 
   pthread::atforkchild ();
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 4bb28c47b..15cba3610 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -635,6 +635,12 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
       if (ptys)
  ptys->fixup_after_attach (!iscygwin ());
 
+      if (!iscygwin ())
+ {
+  init_console_handler (myself->ctty > 0);
+  myself->ctty = 0;
+ }
+
     loop:
       /* When ruid != euid we create the new process under the current original
  account and impersonate in child, this way maintaining the different
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/1] Cygwin: pty: Add a workaround for ^C handling.

Corinna Vinschen-2
In reply to this post by Takashi Yano
On Sep  4 22:47, Takashi Yano wrote:

> - Pseudo console support introduced by commit
>   169d65a5774acc76ce3f3feeedcbae7405aa9b57 sometimes cause random
>   crash or freeze by pressing ^C while cygwin and non-cygwin
>   processes are executed simultaneously in the same pty. This
>   patch is a workaround for this issue.
>
> v2:
> Make the behaviour of pty and console identical.
>
> Takashi Yano (1):
>   Cygwin: pty: Add a workaround for ^C handling.
>
>  winsup/cygwin/fork.cc  | 1 -
>  winsup/cygwin/spawn.cc | 6 ++++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> --
> 2.21.0
Pushed.


Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment