about summary refs log tree commit diff
path: root/assert/test-assert-perr.c
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-04-15 22:08:56 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-04-17 23:04:41 +0200
commit346b6eab3c14ead0b716d53e2235464b822f48f2 (patch)
treeb22d3751ad187257d15ff79a3bcafd879c425c5f /assert/test-assert-perr.c
parente411e31b7b74f4b2326b65544994c89d84d2cdd8 (diff)
downloadglibc-346b6eab3c14ead0b716d53e2235464b822f48f2.tar.gz
glibc-346b6eab3c14ead0b716d53e2235464b822f48f2.tar.xz
glibc-346b6eab3c14ead0b716d53e2235464b822f48f2.zip
hurd: Run init_pids () before init_dtable ()
Much as the comment says, things on _hurd_subinit assume that _hurd_pid
is already initialized by the time _hurd_subinit is run, so
_hurd_proc_subinit has to run before it. Specifically, init_dtable ()
calls _hurd_port2fd (), which uses _hurd_pid and _hurd_pgrp to set up
ctty handling. With _hurd_subinit running before _hurd_proc_subinit,
ctty setup was broken:

  13<--33(pid1255)->term_getctty () = 0    4<--39(pid1255)
task16(pid1255)->mach_port_deallocate (pn{ 10}) = 0
  13<--33(pid1255)->term_open_ctty (0 0) = 0x40000016 (Invalid argument)

Fix this by running the _hurd_proc_subinit hook in the correct place --
just after _hurd_portarray is set up (so the proc server port is
available in its usual place) and just before running _hurd_subinit.

Fixes 1ccbb9258eed0f667edf459a28ba23a805549b36
("hurd: Notify the proc server later during initialization").

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Diffstat (limited to 'assert/test-assert-perr.c')
0 files changed, 0 insertions, 0 deletions