bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] coprocess pseudo-tty bug


From: arnold
Subject: Re: [bug-gawk] coprocess pseudo-tty bug
Date: Wed, 03 Jan 2018 06:41:40 -0700
User-agent: Heirloom mailx 12.4 7/29/08

Git bisect in the gawk-4.1-stable branch between 4.1.2 and 4.1.4 will
be fastest. (What does 4.1.3 do?)

It may not be a bug.

Let's see what git bisect tells us.

Thanks,

Arnold

"Andrew J. Schorr" <address@hidden> wrote:

> Hi,
>
> A discussion in comp.lang.awk about coprocess deadlock and pseudo-ttys has
> revealed what appears to be a bug, although I do not yet understand what
> is going wrong.
>
> https://groups.google.com/forum/#!topic/comp.lang.awk/pz4gmSw0uas
>
> bash-4.2$ cat /tmp/pty.awk 
> BEGIN {
>    cmd = "tr A-Z a-z"
>    PROCINFO[cmd, "pty"] = 1
>    input = "ABCD"
>    print input |& cmd
>    cmd |& getline x
>    print x
> }
>
> This works correctly in gawk 4.1.2:
>
> bash-4.2$ ./gawk --version | head -1
> GNU Awk 4.1.2, API: 1.1 (GNU MPFR 3.1.1, GNU MP 6.0.0)
> bash-4.2$ ./gawk -f /tmp/pty.awk 
> abcd
> bash-4.2$ ./gawk -f /tmp/pty.awk  | od -c
> 0000000   a   b   c   d  \n
> 0000005
>
> By 4.1.4, it is broken:
> bash-4.2$ cd ../gawk-4.1.4
> bash-4.2$ ./gawk --version | head -1
> GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.1, GNU MP 6.0.0)
> bash-4.2$ ./gawk -f /tmp/pty.awk 
> ABCD
> bash-4.2$ ./gawk -f /tmp/pty.awk  | od -c
> 0000000   A   B   C   D  \r  \n
> 0000006
>
> And it is still broken in the gawk-4.2-stable branch:
>
> bash-4.2$ ./gawk --version | head -1
> GNU Awk 4.2.0b, API: 2.0 (GNU MPFR 3.1.1, GNU MP 6.0.0)
> bash-4.2$ ./gawk -f /tmp/pty.awk 
> ABCD
> bash-4.2$ ./gawk -f /tmp/pty.awk  | od -c
> 0000000   A   B   C   D  \r  \n
> 0000006
>
> I have not had a chance to chase this down yet. I guess "git bisect" is
> the way to go.
>
> Regards,
> Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]