History log of /freebsd/lib/libthr/tests/atfork_test.c (Results 1 – 2 of 2)
Revision Date Author Comments
# 4b202f4f 14-Nov-2024 Kyle Evans <kevans@FreeBSD.org>

libthr: allow very early atfork registration

LSan wants to be able to register atfork handlers at __lsan_init time,
which can happen either at the first intercepted function call or in a
.preinit_ar

libthr: allow very early atfork registration

LSan wants to be able to register atfork handlers at __lsan_init time,
which can happen either at the first intercepted function call or in a
.preinit_array function. Both of these end up being very early in rtld
and executed with the bind lock held, which ends up causing problems
when we go to _libpthread_init().

Instead of requiring libpthread to be initialized, just insert the new
atfork handler straight into the list if it's not ready yet. The
critical section and locking should not be necessary if we're really
executing this early, as there won't be any threads to contend with.

Reviewed by: kib (earlier version), markj
Differential Revision: https://reviews.freebsd.org/D47349

show more ...


# 7e6ac503 14-Nov-2024 Kyle Evans <kevans@FreeBSD.org>

libthr: add some tests for pthread_atfork() handling

Test that it generally functions, and also that registering multiple
times calls each handler in the order that it's documented to call them
in.

libthr: add some tests for pthread_atfork() handling

Test that it generally functions, and also that registering multiple
times calls each handler in the order that it's documented to call them
in.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D47348

show more ...