* [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave.
@ 2020-05-19 11:35 Takashi Yano
2020-05-19 13:28 ` Corinna Vinschen
2020-05-19 19:04 ` Ken Brown
0 siblings, 2 replies; 5+ messages in thread
From: Takashi Yano @ 2020-05-19 11:35 UTC (permalink / raw)
To: cygwin-patches
- Current pty cannot show system_printf() output after closing pty
slave. This patch fixes the issue.
---
winsup/cygwin/fhandler_tty.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 5a1bcd3ce..02b78cd2c 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -948,6 +948,10 @@ fhandler_pty_slave::open (int flags, mode_t)
init_console_handler (true);
}
+ get_ttyp ()->pcon_pid = 0;
+ get_ttyp ()->switch_to_pcon_in = false;
+ get_ttyp ()->switch_to_pcon_out = false;
+
set_open_status ();
return 1;
@@ -1008,6 +1012,7 @@ fhandler_pty_slave::close ()
termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex);
if (pcon_attached_to == get_minor ())
get_ttyp ()->num_pcon_attached_slaves --;
+ set_switch_to_pcon (2); /* Make system_printf() work after close. */
return 0;
}
--
2.21.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave.
2020-05-19 11:35 [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave Takashi Yano
@ 2020-05-19 13:28 ` Corinna Vinschen
2020-05-19 19:04 ` Ken Brown
1 sibling, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2020-05-19 13:28 UTC (permalink / raw)
To: cygwin-patches
On May 19 20:35, Takashi Yano via Cygwin-patches wrote:
> - Current pty cannot show system_printf() output after closing pty
> slave. This patch fixes the issue.
> ---
> winsup/cygwin/fhandler_tty.cc | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
> index 5a1bcd3ce..02b78cd2c 100644
> --- a/winsup/cygwin/fhandler_tty.cc
> +++ b/winsup/cygwin/fhandler_tty.cc
> @@ -948,6 +948,10 @@ fhandler_pty_slave::open (int flags, mode_t)
> init_console_handler (true);
> }
>
> + get_ttyp ()->pcon_pid = 0;
> + get_ttyp ()->switch_to_pcon_in = false;
> + get_ttyp ()->switch_to_pcon_out = false;
> +
> set_open_status ();
> return 1;
>
> @@ -1008,6 +1012,7 @@ fhandler_pty_slave::close ()
> termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex);
> if (pcon_attached_to == get_minor ())
> get_ttyp ()->num_pcon_attached_slaves --;
> + set_switch_to_pcon (2); /* Make system_printf() work after close. */
> return 0;
> }
>
> --
> 2.21.0
Pushed.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave.
2020-05-19 11:35 [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave Takashi Yano
2020-05-19 13:28 ` Corinna Vinschen
@ 2020-05-19 19:04 ` Ken Brown
2020-05-20 8:46 ` Takashi Yano
1 sibling, 1 reply; 5+ messages in thread
From: Ken Brown @ 2020-05-19 19:04 UTC (permalink / raw)
To: cygwin-patches
Hi Takashi,
On 5/19/2020 7:35 AM, Takashi Yano via Cygwin-patches wrote:
> - Current pty cannot show system_printf() output after closing pty
> slave. This patch fixes the issue.
Sorry to be returning the favor so soon, but this patch causes 'make check' in
the texinfo source tree to hang. I don't have time at the moment to try to
produce a simple test case, so here's a complicated way to reproduce the problem:
1. Clone the texinfo git repo:
$ git clone https://git.savannah.gnu.org/git/texinfo.git
2. Build texinfo:
$ cd texinfo
$ ./autogen.sh && ./configure # Maybe CFLAGS='-g -O0' for debugging
$ make
3. Test the standalone info reader:
$ cd info
$ make check
It hangs while running the test t/malformed-split.sh, leaving a ginfo process
and a pseudotty process running, with ginfo trying to close a pty slave.
Note that this test uses both ptys and fifos, so there's always a chance that
this is another fifo bug. But reverting your patch fixes the problem, so I
think it's probably a pty bug.
Ken
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave.
2020-05-19 19:04 ` Ken Brown
@ 2020-05-20 8:46 ` Takashi Yano
2020-05-21 8:23 ` Takashi Yano
0 siblings, 1 reply; 5+ messages in thread
From: Takashi Yano @ 2020-05-20 8:46 UTC (permalink / raw)
To: cygwin-patches
On Tue, 19 May 2020 15:04:24 -0400
Ken Brown via Cygwin-patches <cygwin-patches@cygwin.com> wrote:
> Hi Takashi,
>
> On 5/19/2020 7:35 AM, Takashi Yano via Cygwin-patches wrote:
> > - Current pty cannot show system_printf() output after closing pty
> > slave. This patch fixes the issue.
>
> Sorry to be returning the favor so soon, but this patch causes 'make check' in
> the texinfo source tree to hang. I don't have time at the moment to try to
> produce a simple test case, so here's a complicated way to reproduce the problem:
>
> 1. Clone the texinfo git repo:
>
> $ git clone https://git.savannah.gnu.org/git/texinfo.git
>
> 2. Build texinfo:
>
> $ cd texinfo
> $ ./autogen.sh && ./configure # Maybe CFLAGS='-g -O0' for debugging
> $ make
>
> 3. Test the standalone info reader:
>
> $ cd info
> $ make check
>
> It hangs while running the test t/malformed-split.sh, leaving a ginfo process
> and a pseudotty process running, with ginfo trying to close a pty slave.
>
> Note that this test uses both ptys and fifos, so there's always a chance that
> this is another fifo bug. But reverting your patch fixes the problem, so I
> think it's probably a pty bug.
Sorry for inconvenience. I can reproduce your problem.
I will check what is happening. Please wait a while.
--
Takashi Yano <takashi.yano@nifty.ne.jp>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave.
2020-05-20 8:46 ` Takashi Yano
@ 2020-05-21 8:23 ` Takashi Yano
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Yano @ 2020-05-21 8:23 UTC (permalink / raw)
To: cygwin-patches
On Wed, 20 May 2020 17:46:11 +0900
Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> wrote:
> On Tue, 19 May 2020 15:04:24 -0400
> Ken Brown via Cygwin-patches <cygwin-patches@cygwin.com> wrote:
> > Hi Takashi,
> >
> > On 5/19/2020 7:35 AM, Takashi Yano via Cygwin-patches wrote:
> > > - Current pty cannot show system_printf() output after closing pty
> > > slave. This patch fixes the issue.
> >
> > Sorry to be returning the favor so soon, but this patch causes 'make check' in
> > the texinfo source tree to hang. I don't have time at the moment to try to
> > produce a simple test case, so here's a complicated way to reproduce the problem:
> >
> > 1. Clone the texinfo git repo:
> >
> > $ git clone https://git.savannah.gnu.org/git/texinfo.git
> >
> > 2. Build texinfo:
> >
> > $ cd texinfo
> > $ ./autogen.sh && ./configure # Maybe CFLAGS='-g -O0' for debugging
> > $ make
> >
> > 3. Test the standalone info reader:
> >
> > $ cd info
> > $ make check
> >
> > It hangs while running the test t/malformed-split.sh, leaving a ginfo process
> > and a pseudotty process running, with ginfo trying to close a pty slave.
> >
> > Note that this test uses both ptys and fifos, so there's always a chance that
> > this is another fifo bug. But reverting your patch fixes the problem, so I
> > think it's probably a pty bug.
>
> Sorry for inconvenience. I can reproduce your problem.
> I will check what is happening. Please wait a while.
I found the cause. If pty master is closed, wait_pcon_fwd()
stucks because pty_master_fwd_thread is not running.
I will submit a patch to fix this issue soon.
--
Takashi Yano <takashi.yano@nifty.ne.jp>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-05-21 8:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 11:35 [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave Takashi Yano
2020-05-19 13:28 ` Corinna Vinschen
2020-05-19 19:04 ` Ken Brown
2020-05-20 8:46 ` Takashi Yano
2020-05-21 8:23 ` Takashi Yano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).