tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Python issues, mostly
> Date: Tue, 17 Sep 2024 15:59:52 +0000 (UTC)
> From: John Klos <john%klos.com@localhost>
>
> Also, python310 still hangs on non-interactive build.
Are you running in the background with stdin as a tty but with stdout
to a log file? Is this reproducible if you run with `</dev/null',
i.e., with stdin not being a tty?
If the answers are `yes' and `no', respectively, then this is probably
still the unfixed PR pkg/57886, <https://gnats.NetBSD.org/57886>
(please put followups on the PR so it's easier to track):
>Synopsis: lang/pythonN build suspends itself with SIGTTOU
>Description:
Now that readline is unconditionally included in the lang/pythonN packages, Python will unconditionally do silly things when stdin is a tty but stdout is not (e.g., redirect output to a file but don't redirect input, in a background job) -- under these circumstances it decides to initialize readline, and initializing readline makes it do TIOCGWINSZ, which is fine, and then TIOCSWINSZ, which suspends the process with SIGTTOU.
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 */
}
See https://mail-index.netbsd.org/tech-pkg/2024/01/03/msg028751.html and the thread leading into that for more detail.
>How-To-Repeat:
build python or things that use python at build-time in a background job with output redirected to a file and input from the tty
>Fix:
Workaround: run the build with input redirected from /dev/null.
Home |
Main Index |
Thread Index |
Old Index