This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 0/1] Pseudo console support in PTY (v3)


Hi Takashi,

On Apr  6 20:13, Takashi Yano wrote:
> The major changes from v2 is as follows.
> 
> (1) I dig into this problem,
>     https://www.cygwin.com/ml/cygwin-developers/2019-04/msg00000.html
>     and adoptted another approach. Slave process is left unattached
>     by some reason if the executable is a windows GUI binary, such
>     as mintty. So the code is added in stdio_init() in dtable.cc,
>     which makes slave attach to pseudo console and fix up handles,
>     if the slave is on pty but not attached. The previous approach,
>     which uses fhandler_console::need_invisible(), has a side effect
>     that the mintty looks running on cons*, although it actually has
>     no TTY.
> 
> (2) The ctrl-C issue reported in
>     https://cygwin.com/ml/cygwin-developers/2019-04/msg00012.html
>     has been fixed. This seems to be caused by race condition of a
>     variable, switch_to_pcon. This variable holds the state for
>     switching I/O between pseudo console for native console apps
>     and conventional pty for cygwin apps. The handling of this
>     variable is refined. I suppose the issue is fixed in v3.

This looks better, but there's still some problem:

$ cygport gawk.cygport build
>>> Compiling gawk-4.2.62-1.x86_64
[pressing Ctrl-C multiple times]
     14 [main] chmod (7016) child_copy: cygheap read copy failed, 0x180376408..0
x1803887A8, done 0, windows pid 7016, Win32 error 299
    766 [main] chmod (7016) C:\cygwin64\bin\chmod.exe: *** fatal error - ccalloc would have returned NULL
     14 [main] chmod (7016) child_copy: cygheap read copy failed, 0x180376408..0x1803887A8, done 0, windows pid 7016, Win32 error 299
    766 [main] chmod (7016) C:\cygwin64\bin\chmod.exe: *** fatal error - ccalloc
 would have returned NULL

I can reproduce this pretty easily, 1 out of 5 or so.  Since I wasn't
sure this is really your patch, I checked again without your patch but
I can't get it to fail like this.

> (3) Code page handling is refined a bit. Now, code page 65001 (UTF8)
>     and native code page in your region should work without garbled
>     characters. This works properly only on terminal which supports
>     UTF-8.
> 
> (4) Synchronization between real terminal and pseudo console screen
>     buffer is improved. For this, screen is cleared on startup of pty
>     slave app. Also echo for key input is pushed into pseudo console
>     screen buffer.

Apart from the above problem, this looks good from what I see in my
testing.

Tell me as soon as you're confident enough with your code to push it to
master.  Even if there are still bugs, it allows to test this with a
slightly bigger audience via the developer snapshots.  But that's your
choice, no pressure from my side.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]