| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I used these shell commands:
../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc && git commit -am"[this commit message]")
and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 6694 files FOO.
I then removed trailing white space from benchtests/bench-pthread-locks.c
and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this
diagnostic from Savannah:
remote: *** pre-commit check failed ...
remote: *** error: lines with trailing whitespace found
remote: error: hook declined to update refs/heads/master
|
|
|
|
|
| |
Libc has actually been using mach's lock-internal.h mutex for a long
time already.
|
|
|
|
|
|
| |
Notifying the proc server is an involved task, and unleashes various signal
handling etc. so we have to do this after e.g. ifunc relocations are
completed.
|
|
|
|
|
|
|
|
| |
It fixes the issue report by Joseph [1].
Checked with a build-many-glibcs.py build for i686-gnu.
[1] https://sourceware.org/pipermail/libc-alpha/2020-July/116134.html
|
|
|
|
|
| |
* sysdeps/hurd/include/hurd/fd.h (HURD_FD_PORT_USE_CANCEL): Evaluate fd
before calling _hurd_critical_section_lock.
|
|
|
|
|
| |
* sysdeps/hurd/include/hurd/port.h: Include <libc-lock.h>.
(HURD_PORT_USE_CANCEL): Add local port variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HURD_*PORT_USE link fd and port with a stack-stored structure, so on
thread cancel we need to cleanup this.
* hurd/fd-cleanup.c: New file.
* hurd/port-cleanup.c (_hurd_port_use_cleanup): New function.
* hurd/Makefile (routines): Add fd-cleanup.
* sysdeps/hurd/include/hurd.h (__USEPORT_CANCEL): New macro.
* sysdeps/hurd/include/hurd/fd.h (_hurd_fd_port_use_data): New
structure.
(_hurd_fd_port_use_cleanup): New prototype.
(HURD_DPORT_USE_CANCEL, HURD_FD_PORT_USE_CANCEL): New macros.
* sysdeps/hurd/include/hurd/port.h (_hurd_port_use_data): New structure.
(_hurd_port_use_cleanup): New prototype.
(HURD_PORT_USE_CANCEL): New macro.
* hurd/hurd/fd.h (HURD_FD_PORT_USE): Also refer to HURD_FD_PORT_USE_CANCEL.
* hurd/hurd.h (__USEPORT): Also refer to __USEPORT_CANCEL.
* hurd/hurd/port.h (HURD_PORT_USE): Also refer to HURD_PORT_USE_CANCEL.
* hurd/fd-read.c (_hurd_fd_read): Call HURD_FD_PORT_USE_CANCEL instead
of HURD_FD_PORT_USE.
* hurd/fd-write.c (_hurd_fd_write): Likewise.
* sysdeps/mach/hurd/send.c (__send): Call HURD_DPORT_USE_CANCEL instead
of HURD_DPORT_USE.
* sysdeps/mach/hurd/sendmsg.c (__libc_sendmsg): Likewise.
* sysdeps/mach/hurd/sendto.c (__sendto): Likewise.
* sysdeps/mach/hurd/recv.c (__recv): Likewise.
* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise.
* sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Call __USEPORT_CANCEL
instead of __USEPORT, and HURD_DPORT_USE_CANCEL instead of
HURD_DPORT_USE.
|
|
|
|
|
|
|
|
| |
_hurdsig_preemptors and _hurdsig_preempted_set are not ABI symbols,
so do not declare them. HURD_PREEMPT_SIGNAL_P is an implementation
detail, so move it as well.
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds _hurd_sigstate_set_global_rcv used by libpthread to enable
POSIX-confirming behavior of signals on a per-thread basis.
This also provides a sigstate destructor _hurd_sigstate_delete, and a
global process signal state, which needs to be locked and check when
global disposition is enabled, thus the addition of _hurd_sigstate_lock
_hurd_sigstate_actions _hurd_sigstate_pending _hurd_sigstate_unlock helpers.
This also updates all the glibc code accordingly.
This also drops support for get_int(INIT_SIGMASK), which did not make sense
any more since we do not have a single signal thread any more.
During fork/spawn, this also reinitializes the child global sigstate's
lock. That cures an issue that would very rarely cause a deadlock in the
child in fork, tries to unlock ss' critical section lock at the end of
fork. This will typically (always?) be observed in /bin/sh, which is not
surprising as that is the foremost caller of fork.
To reproduce an intermediate state, add an endless loop if
_hurd_global_sigstate is locked after __proc_dostop (cast through
volatile); that is, while still being in the fork's parent process.
When that triggers (use the libtool testsuite), the signal thread has
already locked ss (which is _hurd_global_sigstate), and is stuck at
hurdsig.c:685 in post_signal, trying to lock _hurd_siglock (which the
main thread already has locked and keeps locked until after
__task_create). This is the case that ss->thread == MACH_PORT_NULL, that
is, a global signal. In the main thread, between __proc_dostop and
__task_create is the __thread_abort call on the signal thread which would
abort any current kernel operation (but leave ss locked). Later in fork,
in the parent, when _hurd_siglock is unlocked in fork, the parent's
signal thread can proceed and will unlock eventually the global sigstate.
In the client, _hurd_siglock will likewise be unlocked, but the global
sigstate never will be, as the client's signal thread has been configured
to restart execution from _hurd_msgport_receive. Thus, when the child
tries to unlock ss' critical section lock at the end of fork, it will
first lock the global sigstate, will spin trying to lock it, which can
never be successful, and we get our deadlock.
Options seem to be:
* Move the locking of _hurd_siglock earlier in post_signal -- but that
may generally impact performance, if this locking isn't generally
needed anyway?
On the other hand, would it actually make sense to wait here until we
are not any longer in a critical section (which is meant to disable
signal delivery anyway (but not for preempted signals?))?
* Clear the global sigstate in the fork's child with the rationale that
we're anyway restarting the signal thread from a clean state. This
has now been implemented.
Why has this problem not been observed before Jérémie's patches? (Or has
it? Perhaps even more rarely?) In _S_msg_sig_post, the signal is now
posted to a *global receiver thread*, whereas previously it was posted to
the *designated signal-receiving thread*. The latter one was in a
critical section in fork, so didn't try to handle the signal until after
leaving the critical section? (Not completely analyzed and verified.)
Another question is what the signal is that is being received
during/around the time __proc_dostop executes.
|
|
|
|
|
|
| |
* sysdeps/mach/include/mach-shortcuts-hidden.h [!_ISOMAC]: Do not
declare libc hidden prototypes.
* sysdeps/mach/include/mach/mach_traps.h [!_ISOMAC]: Likewise.
|
|
|
|
|
|
|
| |
* sysdeps/hurd/include/hurd/signal.h (_hurd_self_sigstate): Add hidden
prototype and definition.
* sysdeps/mach/hurd/i386/____longjmp_chk.S (____longjmp_chk): Use
hidden target for _hurd_self_sigstate.
|
|
|
|
| |
* sysdeps/hurd/include/hurd/port.h: New file.
|
|
|
|
|
|
|
| |
* sysdeps/hurd/include/hurd.h [!_ISOMAC]: Do not declare libc hidden
prototypes.
* sysdeps/hurd/include/hurd/fd.h [!_ISOMAC]: Likewise.
* sysdeps/hurd/include/hurd/signal.h [!_ISOMAC]: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysdeps/hurd/include/hurd/signal.h (_hurd_raise_signal): Add hidden
prototype.
* hurd/hurd-raise.c (_hurd_raise_signal): Add hidden def.
* hurd/Makefile ($(inlines:%=$(objpfx)%.c): Define
_HEADER_H_HIDDEN_DEF macro.
* sysdeps/hurd/include/hurd/fd.h (_hurd_fd_error,
_hurd_fd_error_signal): Add hidden prototype.
[_HURD_FD_H_HIDDEN_DEF] (_hurd_fd_error, _hurd_fd_error_signal): Add
hidden def.
|
|
* hurd/catch-signal.c (hurd_catch_signal): Rename to
__hurd_catch_signal.
(hurd_catch_signal): New strong alias.
(hurd_safe_memset, hurd_safe_copyout, hurd_safe_copyin): Call
__hurd_catch_signal instead of hurd_catch_signal.
* hurd/exc2signal.c (_hurd_exception2signal): Add hidden def.
* hurd/hurdexec.c (_hurd_init): Add hidden def.
* hurd/hurdinit.c (_hurd_init): Add hidden def.
* hurd/hurdsig.c: Include <mach/mig_support.h>.
(_hurd_thread_sigstate): Add hidden def.
(_hurd_internal_post_signal): Use __mutex_unlock instead of
mutex_unlock.
* hurd/intern-fd.c (_hurd_intern_fd): Add hidden def.
* hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Add hidden def.
* hurd/path-lookup.c (hurd_file_name_path_lookup): Rename to
__hurd_file_name_path_lookup.
(hurd_file_name_path_lookup): New strong alias.
(file_name_path_lookup): Call __hurd_file_name_path_lookup instead of
hurd_file_name_path_lookup.
* mach/errstring.c (mach_error_type): Add hidden def.
* mach/msg-destroy.c (__mach_msg_destroy): Add hidden def.
* mach/mutex-init.c (__mutex_init): Add hidden def.
* mach/spin-lock.c (__spin_lock_locked, __spin_lock, __spin_unlock,
__spin_try_lock, __mutex_lock, __mutex_trylock): Add hidden defs.
* mach/spin-solid.c (__spin_lock_solid): Add hidden def.
* sysdeps/mach/hurd/getcwd.c
(_hurd_canonicalize_directory_name_internal): Rename to
__hurd_canonicalize_directory_name_internal.
(_hurd_canonicalize_directory_name_internal): New strong alias.
(__canonicalize_directory_name_internal, __getcwd): Call
__hurd_canonicalize_directory_name_internal instead of
_hurd_canonicalize_directory_name_internal.
* sysdeps/mach/hurd/mig-reply.c: Include <mach/mig_support.h>.
(__mig_get_reply_port, __mig_dealloc_reply_port, __mig_init): Add
hidden defs.
* sysdeps/hurd/include/hurd.h: New file.
* sysdeps/hurd/include/hurd/fd.h: New file.
* sysdeps/hurd/include/hurd/signal.h: New file.
* sysdeps/mach/include/lock-intern.h: New file.
* sysdeps/mach/include/mach.h: New file.
* sysdeps/mach/include/mach/mig_support.h: New file.
* sysdeps/mach/include/mach_error.h: New file.
|