#
331722 |
|
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re)
|
#
330897 |
|
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg
|
#
302408 |
|
07-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
297706 |
|
08-Apr-2016 |
kib |
Use __FBSDID() for .c files from lib/libthr/thread.
Sponsored by: The FreeBSD Foundation
|
#
297139 |
|
21-Mar-2016 |
kib |
From libthr, remove special and strange code to set up session and control terminal, activated when running with pid 1. It is application duty to handle this, and unsuspecting init replacements which are linked with libthr would be broken by this.
The pre-resolving of getpid() is restored, just in case.
Reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
|
#
286582 |
|
10-Aug-2015 |
kib |
Pre-resolve symbols required for the deferred signal processing. This avoids recursion into rtld when leaving libthr critical section for the deferred signal delivery.
For the same reason, use syscall(2) instead of referencing __sys_sigreturn(2). Syscall() is already pre-resolved for fork() interceptor.
Tested by: Andre Meiser <ortadur@web.de> Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
#
266609 |
|
24-May-2014 |
kib |
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
|
#
249425 |
|
12-Apr-2013 |
jilles |
libthr: Remove _thr_rtld_fini(), unused since r245630.
|
#
217191 |
|
09-Jan-2011 |
kib |
Implement the __pthread_map_stacks_exec() for libthr.
Stack creation code is changed to call _rtld_get_stack_prot() to get the stack protection right. There is a race where thread is created during dlopen() of dso that requires executable stacks. Then, _rtld_get_stack_prot() may return PROT_READ | PROT_WRITE, but thread is still not linked into the thread list. In this case, the callback misses the thread stack, and rechecks the required protection afterward.
Reviewed by: davidxu
|
#
212076 |
|
01-Sep-2010 |
davidxu |
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.
|
#
211859 |
|
27-Aug-2010 |
davidxu |
clear lock to zero state if it is destroyed.
|
#
211833 |
|
26-Aug-2010 |
davidxu |
Decrease rdlock count only when thread unlocked a reader lock.
MFC after: 3 days
|
#
195403 |
|
06-Jul-2009 |
attilio |
In the current code, rdlock_count is not correctly handled for some cases. The most notable is that it is not bumped in rwlock_rdlock_common() when the hard path (__thr_rwlock_rdlock()) returns successfully. This can lead to deadlocks in libthr when rwlocks recursion in read mode happens. Fix the interested parts by correctly handling rdlock_count.
PR: threads/136345 Reported by: rink Tested by: rink Reviewed by: jeff Approved by: re (kib) MFC: 2 weeks
|
#
191291 |
|
19-Apr-2009 |
rwatson |
Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use that definition in the custom locking code for the run-time linker rather than local definitions.
Pointed out by: tinderbox MFC after: 2 weeks
|
#
185728 |
|
07-Dec-2008 |
peter |
When libthr and rtld start up, there are a number of magic spells cast in order to get the symbol binding state "just so". This is to allow locking to be activated and not run into recursion problems later.
However, one of the magic bits involves an explicit call to _umtx_op() to force symbol resolution. It does a wakeup operation on a fake, uninitialized (ie: random contents) umtx. Since libthr isn't active, this is harmless. Nothing can match the random wakeup.
However, valgrind finds this and is not amused. Normally I'd just write a suppression record for it, but the idea of passing random args to syscalls (on purpose) just doesn't feel right.
|
#
185558 |
|
02-Dec-2008 |
kib |
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
|
#
178413 |
|
22-Apr-2008 |
davidxu |
Use native rwlock.
|
#
177853 |
|
02-Apr-2008 |
davidxu |
Replace function _umtx_op with _umtx_op_err, the later function directly returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library.
|
#
177470 |
|
21-Mar-2008 |
davidxu |
Resolve __error()'s PLT early so that it needs not to be resolved again, otherwise rwlock is recursivly called when signal happens and the __error was never resolved before.
|
#
177445 |
|
20-Mar-2008 |
davidxu |
Preserve application code's errno in rtld locking code, it attemps to keep any case safe.
|
#
173801 |
|
21-Nov-2007 |
davidxu |
Remove umtx_t definition, use type long directly, add wrapper function _thr_umtx_wait_uint() for umtx operation UMTX_OP_WAIT_UINT, use the function in semaphore operations, this fixed compiler warnings.
|
#
157457 |
|
04-Apr-2006 |
davidxu |
WARNS level 4 cleanup.
|
#
157113 |
|
25-Mar-2006 |
davidxu |
Only wake up writer if the lock is free.
|
#
157111 |
|
25-Mar-2006 |
davidxu |
Add locking support for rtld.
|