History log of /freebsd/lib/libthr/thread/thr_fork.c (Results 26 – 50 of 75)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/9.3.0
# 6cec9cad 03-Jun-2014 Peter Grehan <grehan@FreeBSD.org>

MFC @ r266724

An SVM update will follow this.


# 1c70d007 24-May-2014 Konstantin Belousov <kib@FreeBSD.org>

Right now, the rtld prefork hook locks the rtld bind lock in the read
mode. This allows the binder to be functional in the child after the
fork (assuming no lazy loading of a filter is needed), but

Right now, the rtld prefork hook locks the rtld bind lock in the read
mode. This allows the binder to be functional in the child after the
fork (assuming no lazy loading of a filter is needed), but other rtld
services which require write lock on rtld_bind_lock cause deadlock, if
called by child.

Change the _rtld_atfork() to lock the bind lock in write mode, making
the rtld fully functional after the fork.

Pre-resolve the symbols which are called by the libthr' fork()
interposer, since dynamic resolution causes deadlock due to the
rtld_bind_lock already owned in the write mode.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

show more ...


Revision tags: release/10.0.0, release/9.2.0, release/8.4.0, release/9.1.0
# e477abf7 27-Nov-2012 Alexander Motin <mav@FreeBSD.org>

MFC @ r241285


# a10c6f55 11-Nov-2012 Neel Natu <neel@FreeBSD.org>

IFC @ r242684


# 23090366 04-Nov-2012 Simon J. Gerraty <sjg@FreeBSD.org>

Sync from head


# 24bf3585 04-Sep-2012 Gleb Smirnoff <glebius@FreeBSD.org>

Merge head r233826 through r240095.


# 0aa81bff 23-Aug-2012 David Xu <davidxu@FreeBSD.org>

Eliminate redundant code, _thr_spinlock_init() has already been called
in init_private(), don't call it again in fork() wrapper.


Revision tags: release/8.3.0_cvs, release/8.3.0, release/9.0.0, release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0
# 93ea4a71 24-Sep-2010 David Xu <davidxu@FreeBSD.org>

In most cases, cancel_point and cancel_async needn't be checked again,
because cancellation is almostly checked at cancellation points.


# 4173ebef 19-Sep-2010 David Xu <davidxu@FreeBSD.org>

Because atfork lock is held while forking, a thread cancellation triggered
by atfork handler is unsafe, use intenal flag no_cancel to disable it.


# a9b764e2 13-Sep-2010 David Xu <davidxu@FreeBSD.org>

Convert thread list lock from mutex to rwlock.


# 12c61c22 01-Sep-2010 David Xu <davidxu@FreeBSD.org>

In function __pthread_cxa_finalize(), also make code for removing
atfork handler be async-signal safe.


# a523216b 01-Sep-2010 David Xu <davidxu@FreeBSD.org>

pthread_atfork should acquire writer lock and protect the code
with critical region.


# ada33a6e 01-Sep-2010 David Xu <davidxu@FreeBSD.org>

Change atfork lock from mutex to rwlock, also make mutexes used by malloc()
module private type, when private type mutex is locked/unlocked, thread
critical region is entered or leaved. These changes

Change atfork lock from mutex to rwlock, also make mutexes used by malloc()
module private type, when private type mutex is locked/unlocked, thread
critical region is entered or leaved. These changes makes fork()
async-signal safe which required by POSIX. Note that user's atfork handler
still needs to be async-signal safe, but it is not problem of libthr, it
is user's responsiblity.

show more ...


# 02c3c858 01-Sep-2010 David Xu <davidxu@FreeBSD.org>

Add signal handler wrapper, the reason to add it becauses there are
some cases we want to improve:
1) if a thread signal got a signal while in cancellation point,
it is possible the TDP_WAKEUP

Add signal handler wrapper, the reason to add it becauses there are
some cases we want to improve:
1) if a thread signal got a signal while in cancellation point,
it is possible the TDP_WAKEUP may be eaten by signal handler
if the handler called some interruptibly system calls.
2) In signal handler, we want to disable cancellation.
3) When thread holding some low level locks, it is better to
disable signal, those code need not to worry reentrancy,
sigprocmask system call is avoided because it is a bit expensive.
The signal handler wrapper works in this way:
1) libthr installs its signal handler if user code invokes sigaction
to install its handler, the user handler is recorded in internal
array.
2) when a signal is delivered, libthr's signal handler is invoke,
libthr checks if thread holds some low level lock or is in critical
region, if it is true, the signal is buffered, and all signals are
masked, once the thread leaves critical region, correct signal
mask is restored and buffered signal is processed.
3) before user signal handler is invoked, cancellation is temporarily
disabled, after user signal handler is returned, cancellation state
is restored, and pending cancellation is rescheduled.

show more ...


# ed0ee6af 27-Aug-2010 David Xu <davidxu@FreeBSD.org>

Unregister thread specific data destructor when a corresponding dso
is unloaded.


# ea246b63 23-Aug-2010 Konstantin Belousov <kib@FreeBSD.org>

On shared object unload, in __cxa_finalize, call and clear all installed
atexit and __cxa_atexit handlers that are either installed by unloaded
dso, or points to the functions provided by the dso.

U

On shared object unload, in __cxa_finalize, call and clear all installed
atexit and __cxa_atexit handlers that are either installed by unloaded
dso, or points to the functions provided by the dso.

Use _rtld_addr_phdr to locate segment information from the address of
private variable belonging to the dso, supplied by crtstuff.c. Provide
utility function __elf_phdr_match_addr to do the match of address against
dso executable segment.

Call back into libthr from __cxa_finalize using weak
__pthread_cxa_finalize symbol to remove any atfork handler which
function points into unloaded object.

The rtld needs private __pthread_cxa_finalize symbol to not require
resolution of the weak undefined symbol at initialization time. This
cannot work, since rtld is relocated before sym_zero is set up.

Idea by: kan
Reviewed by: kan (previous version)
MFC after: 3 weeks

show more ...


Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0
# 10b3b545 17-Sep-2009 Dag-Erling Smørgrav <des@FreeBSD.org>

Merge from head


# 2e370a5c 26-May-2009 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Merge from HEAD


# 43af51a2 11-May-2009 Brian Feldman <green@FreeBSD.org>

These are some cosmetic changes to improve the clarity of libthr's fork implementation.


Revision tags: release/7.2.0_cvs, release/7.2.0
# 9c797940 13-Apr-2009 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

- Merge from HEAD


# 29986e1b 19-Mar-2009 Konstantin Belousov <kib@FreeBSD.org>

Forcibly unlock the malloc() locks in the child process after fork(),
by temporary pretending that the process is still multithreaded.
Current malloc lock primitives do nothing for singlethreaded pro

Forcibly unlock the malloc() locks in the child process after fork(),
by temporary pretending that the process is still multithreaded.
Current malloc lock primitives do nothing for singlethreaded process.

Reviewed by: davidxu, deischen

show more ...


Revision tags: release/7.1.0_cvs, release/7.1.0
# e57c2b13 04-Dec-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

integrate from head@185615


# 10b40346 02-Dec-2008 Konstantin Belousov <kib@FreeBSD.org>

Provide custom simple allocator for rtld locks in libthr. The allocator
does not use any external symbols, thus avoiding possible recursion into
rtld to resolve symbols, when called.

Reviewed by: ka

Provide custom simple allocator for rtld locks in libthr. The allocator
does not use any external symbols, thus avoiding possible recursion into
rtld to resolve symbols, when called.

Reviewed by: kan, davidxu
Tested by: rink
MFC after: 1 month

show more ...


# 97df3834 01-Dec-2008 Alexander Kabaev <kan@FreeBSD.org>

Invoke _rtld_atfork_post earlier, before we reinitialize rtld locks
by switching into single-thread mode.

libthr ignores broken use of lock bitmaps used by default rtld locking
implementation, this

Invoke _rtld_atfork_post earlier, before we reinitialize rtld locks
by switching into single-thread mode.

libthr ignores broken use of lock bitmaps used by default rtld locking
implementation, this in turn turns lock handoff in _rtld_thread_init
into NOP. This in turn makes child processes of forked multi-threaded
programs to run with _thr_signal_block still in effect, with most
signals blocked.

Reported by: phk, kib

show more ...


# e711c6f0 29-Nov-2008 Konstantin Belousov <kib@FreeBSD.org>

Unlock the malloc() locks in the child process after fork(). This gives
us working malloc in the fork child of the multithreaded process.

Although POSIX requires that only async-signal safe function

Unlock the malloc() locks in the child process after fork(). This gives
us working malloc in the fork child of the multithreaded process.

Although POSIX requires that only async-signal safe functions shall be
operable after fork in multithreaded process, not having malloc lower
the quality of our implementation.

Tested by: rink
Discussed with: kan, davidxu
Reviewed by: kan
MFC after: 1 month

show more ...


123