* [Bug libc/28853] Problems with terminal control
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
@ 2022-02-02 17:15 ` schwab@linux-m68k.org
2022-02-02 18:04 ` danglin at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: schwab@linux-m68k.org @ 2022-02-02 17:15 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
Since hppa is big endian, this could be an endian bug clobbering the terminal
process group.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] Problems with terminal control
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
2022-02-02 17:15 ` [Bug libc/28853] " schwab@linux-m68k.org
@ 2022-02-02 18:04 ` danglin at gcc dot gnu.org
2022-02-02 18:08 ` danglin at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: danglin at gcc dot gnu.org @ 2022-02-02 18:04 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
--- Comment #2 from John David Anglin <danglin at gcc dot gnu.org> ---
I suppose this is the problematic part of the change:
/* Set the controlling terminal. */
if ((attr->__flags & POSIX_SPAWN_TCSETPGROUP) != 0)
{
/* Check if it is possible to avoid an extra syscall. */
pid_t pgrp = (attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
&& attr->__pgrp != 0
? attr->__pgrp : __getpgid (0);
if (__tcsetpgrp (attr->__ctty_fd, pgrp) != 0)
goto fail;
}
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] Problems with terminal control
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
2022-02-02 17:15 ` [Bug libc/28853] " schwab@linux-m68k.org
2022-02-02 18:04 ` danglin at gcc dot gnu.org
@ 2022-02-02 18:08 ` danglin at gcc dot gnu.org
2022-02-02 19:35 ` carlos at redhat dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: danglin at gcc dot gnu.org @ 2022-02-02 18:08 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
--- Comment #3 from John David Anglin <danglin at gcc dot gnu.org> ---
The function tcsetpgrp() makes the process group with process group ID
pgrp the foreground process group on the terminal associated to fd,
which must be the controlling terminal of the calling process, and
still be associated with its session. Moreover, pgrp must be a
(nonempty) process group belonging to the same session as the calling
process.
If tcsetpgrp() is called by a member of a background process group in
its session, and the calling process is not blocking or ignoring SIGT-
TOU, a SIGTTOU signal is sent to all members of this background process
group.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] Problems with terminal control
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (2 preceding siblings ...)
2022-02-02 18:08 ` danglin at gcc dot gnu.org
@ 2022-02-02 19:35 ` carlos at redhat dot com
2022-02-02 19:35 ` [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation) carlos at redhat dot com
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: carlos at redhat dot com @ 2022-02-02 19:35 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
Carlos O'Donell <carlos at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |carlos at redhat dot com
--- Comment #4 from Carlos O'Donell <carlos at redhat dot com> ---
Dave,
Thanks for the bug report.
I can confirm that posix/tst-spawn6 breaks out of the support/* isolation and
in doing so impacts the shell / process group / session on the terminal.
e.g.
[2]+ Stopped less ~/build/glibc-review/check.log
(In reply to John David Anglin from comment #2)
> I suppose this is the problematic part of the change:
>
> /* Set the controlling terminal. */
> if ((attr->__flags & POSIX_SPAWN_TCSETPGROUP) != 0)
> {
> /* Check if it is possible to avoid an extra syscall. */
> pid_t pgrp = (attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
> && attr->__pgrp != 0
> ? attr->__pgrp : __getpgid (0);
> if (__tcsetpgrp (attr->__ctty_fd, pgrp) != 0)
> goto fail;
> }
This is not problematic per-se, since this is what you want to do for shell
control, but if the test isolation code doesn't stop this affecting your
current shell then that's a problem.
The posix/tst-spawn6 test is the *only* test in which we exercise process group
control testing, and so it may break the testing isolation we expect.
(In reply to John David Anglin from comment #3)
> The function tcsetpgrp() makes the process group with process group ID
> pgrp the foreground process group on the terminal associated to fd,
> which must be the controlling terminal of the calling process, and
> still be associated with its session. Moreover, pgrp must be a
> (nonempty) process group belonging to the same session as the calling
> process.
> If tcsetpgrp() is called by a member of a background process group in
> its session, and the calling process is not blocking or ignoring SIGT-
> TOU, a SIGTTOU signal is sent to all members of this background process
> group.
Yes, for the current /dev/tty (in the test), we make the posix_spawn'd
process the foreground process group for the session to verify the test works
correctly.
I can't easily containerize the test because we don't setup an alternative
TTY/session/pgrp in the container e.g. tests-container += tst-spawn6.
make[2]: Leaving directory '/home/carlos/src/glibc-review/posix'
FAIL: posix/tst-spawn6
original exit status 1
error: tst-spawn6.c:138: open64 ("/dev/tty", 0x0, 0600): No such file or
directory
error: 1 test failures
make[1]: Leaving directory '/home/carlos/src/glibc-review'
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (3 preceding siblings ...)
2022-02-02 19:35 ` carlos at redhat dot com
@ 2022-02-02 19:35 ` carlos at redhat dot com
2022-02-02 19:37 ` carlos at redhat dot com
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: carlos at redhat dot com @ 2022-02-02 19:35 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
Carlos O'Donell <carlos at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Problems with terminal |tst-spawn6 changes current
|control |foreground process group
| |(breaks test isolation)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (4 preceding siblings ...)
2022-02-02 19:35 ` [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation) carlos at redhat dot com
@ 2022-02-02 19:37 ` carlos at redhat dot com
2022-02-03 1:22 ` sam at gentoo dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: carlos at redhat dot com @ 2022-02-02 19:37 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
--- Comment #5 from Carlos O'Donell <carlos at redhat dot com> ---
The solution here is that the test needs it's own session with a new process
group, and new terminal. So posix/tst-spawn6 needs some additional work to
avoid affecting build systems.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (5 preceding siblings ...)
2022-02-02 19:37 ` carlos at redhat dot com
@ 2022-02-03 1:22 ` sam at gentoo dot org
2022-02-03 4:09 ` carlos at redhat dot com
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: sam at gentoo dot org @ 2022-02-03 1:22 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sam at gentoo dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (6 preceding siblings ...)
2022-02-03 1:22 ` sam at gentoo dot org
@ 2022-02-03 4:09 ` carlos at redhat dot com
2022-02-03 11:10 ` adhemerval.zanella at linaro dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: carlos at redhat dot com @ 2022-02-03 4:09 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
--- Comment #6 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Carlos O'Donell from comment #5)
> The solution here is that the test needs it's own session with a new process
> group, and new terminal. So posix/tst-spawn6 needs some additional work to
> avoid affecting build systems.
And we have a fix posted for this:
https://sourceware.org/pipermail/libc-alpha/2022-February/136033.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (7 preceding siblings ...)
2022-02-03 4:09 ` carlos at redhat dot com
@ 2022-02-03 11:10 ` adhemerval.zanella at linaro dot org
2022-02-03 11:11 ` adhemerval.zanella at linaro dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2022-02-03 11:10 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
--- Comment #7 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
Fixed on 2.36.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (8 preceding siblings ...)
2022-02-03 11:10 ` adhemerval.zanella at linaro dot org
@ 2022-02-03 11:11 ` adhemerval.zanella at linaro dot org
2022-02-03 11:13 ` adhemerval.zanella at linaro dot org
2022-02-07 16:40 ` adhemerval.zanella at linaro dot org
11 siblings, 0 replies; 13+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2022-02-03 11:11 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
As per last comment.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (9 preceding siblings ...)
2022-02-03 11:11 ` adhemerval.zanella at linaro dot org
@ 2022-02-03 11:13 ` adhemerval.zanella at linaro dot org
2022-02-07 16:40 ` adhemerval.zanella at linaro dot org
11 siblings, 0 replies; 13+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2022-02-03 11:13 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |2.36
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libc/28853] tst-spawn6 changes current foreground process group (breaks test isolation)
2022-02-02 16:37 [Bug libc/28853] New: Problems with terminal control danglin at gcc dot gnu.org
` (10 preceding siblings ...)
2022-02-03 11:13 ` adhemerval.zanella at linaro dot org
@ 2022-02-07 16:40 ` adhemerval.zanella at linaro dot org
11 siblings, 0 replies; 13+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2022-02-07 16:40 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28853
Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
--- Comment #9 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
*** Bug 28836 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread