bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] make check hangs


From: arnold
Subject: Re: [bug-gawk] make check hangs
Date: Sun, 11 Dec 2016 21:07:43 -0700
User-agent: Heirloom mailx 12.4 7/29/08

Hi.

After some further thought, I think what's happening is this.

1. Gawk tries to open a pty and fails.
2. It falls back to using a two-way pipe to run the command.
3. The command is

        c = "echo 123 > /dev/tty; read x < /dev/tty; echo \"x is $x\""

   But at this point, /dev/tty is not the expected pty, but rather
   the tty of the user running the command. So it hangs in the read.

When I comment out the line

        PROCINFO[c, "pty"] = 1

and run this, gawk pauses; if I type something what I type gets
echoed back out.

So basically, it's working as designed.  I don't have a way inside the
shell command being run by gawk to determine that /dev/tty isn't what
is expected.

I think we just have to treat this as a point of information.

Thanks,

Arnold

address@hidden wrote:

> Hi.
>
> Can you compile for debugging and trace this? In particular, the
> code in io.c:two_way_open should handle a failure to acquire a pty.
>
> I don't have an easy way to reproduce this on my Linux system.
>
> Thanks,
>
> Arnold
>
> Curtis Doty <address@hidden> wrote:
>
> > On a system temporarily out of ptys, `make check` won't pass or fail. But
> > will hang indefinitely--even when ptys are freed up again.
> >
> > Can reproduce on macOS by opening up 127 terminals (until you can't open
> > any more due to kern.tty.ptmx_max=127), and then run gawk tests.
> >
> > $ brew install gawk
> > > ==> Using the sandbox
> > > ==> Downloading https://ftpmirror.gnu.org/gawk/gawk-4.1.4.tar.xz
> > > Already downloaded: 
> > > /Users/curtis/Library/Caches/Homebrew/gawk-4.1.4.tar.xz
> > > ==> ./configure --prefix=/usr/local/Cellar/gawk/4.1.4_1
> > > --without-libsigsegv-prefix
> > > ==> make
> > > ==> make check
> > > 123
> > > ...hung here...even after freeing up some ptys...
> > >
> >
> > Note the '123' output is spammed on the terminal and _pty1 file is empty.
> >
> > I know this is a corner case on a resource-starved build host. But still it
> > should fail the test instead of hanging indefinitely.
> >
> > Not sure how to fix pty1.awk test or whether this is just an FYI instead of
> > a fixable bug. Obviously, workaround is to free up some ptys and start over.
> >
> > ../C



reply via email to

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