tech-pkg archive

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

Re: Workaround for Suspended (tty output) in python?



Have anyone had a chance to look at this?  This is still a problem -
just got bitten by it again when rebuilding packages.

I don't believe I'm the only one who uses

  make > log 2>&1 &

I think breaking backgrounded builds is pretty much unacceptable,
un-unixy thing.

Any python experts that can figure out wtf readline tries to get
initialized in a non-interactive script?


On Wed, Jan 03, 2024 at 19:04:20 +0300, Valery Ushakov wrote:

> On Wed, Jan 03, 2024 at 18:25:44 +0300, Valery Ushakov wrote:
> 
> > I've just got bitten by this when updating packages:
> > 
> >   http://mail-index.netbsd.org/pkgsrc-users/2024/01/03/msg038706.html
> > 
> > On Sun, Dec 31, 2023 at 03:48:00 +0000, Taylor R Campbell wrote:
> > 
> > > > Date: Sun, 31 Dec 2023 02:25:06 +0000 (UTC)
> > > > From: John Klos <john%klos.com@localhost>
> > > > 
> > > > #0  0x000070df4cd7f0da in ioctl () from /usr/lib/libc.so.12
> > > 
> > > Do you know which ioctl it is?  Can you ktrace it?
> > 
> > TIOCGETP, I would presume.  readline-8.1.2/rltty.c:
> 
> Ah, I was not paying attention (this is like n-th level diversion from
> what I actually wanted to do, sorry).
> 
> 
> static int
> get_tty_settings (int tty, TIOTYPE *tiop)
> {
>   set_winsize (tty);
> ...
> }
> 
> /* Dummy call to force a backgrounded readline to stop before it tries
>    to get the tty settings. */
> static void
> set_winsize (tty)
>      int tty;
> {
> #if defined (TIOCGWINSZ)
>   struct winsize w;
> 
>   if (ioctl (tty, TIOCGWINSZ, &w) == 0)
>       (void) ioctl (tty, TIOCSWINSZ, &w);
> #endif /* TIOCGWINSZ */
> }
> 
> 
> -uwe

-uwe


Home | Main Index | Thread Index | Old Index