Age | Commit message (Collapse) | Author |
|
While it is not clear (to me) why that ports ends up with corrupted
shared libs, reverting those changes fixes the issue and should allow us
to close p2k17 more smoothly.
Discussed with a bunch, ok ajacoutot@ guenther@
|
|
ok jca@, deraadt@
|
|
on the stack instead of mallocing the list and move the APIs from libpthread
to libc so that they can be used inside libc.
Note: the standard was explicitly written to permit/support this
"macro with unmatched brace" style and it's what basically everyone
else already does. We xor the info with random cookies with a
random magic to detect/trip-up overwrites.
Major bump to both libc and libpthread due to the API move.
ok mpi@
|
|
pthread_exit from libpthread to libc, along with low-level bits to
support them. Major bump to both libc and libpthread.
Requested by libressl team. Ports testing by naddy@
ok kettenis@
|
|
then strays off the path to exec(). one common manifestation of this
problem occurs in pthread_join(), so we can add a little check there.
first person to hit this in real life gets to change the error message.
|
|
ok tedu@
|
|
ok tedu@ mpi@
|
|
tested by many (thanks!) ok tedu, guenther@
|
|
This stores errno, the cancelation flags, and related bits for each thread
and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable!
Make libpthread dlopen'able by moving the cancelation wrappers into libc
and doing locking and fork/errno handling via callbacks that libpthread
registers when it first initializes. 'errno' *must* be declared via
<errno.h> now!
Clean up libpthread's symbol exports like libc.
On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec.
Testing by various, particularly sthen@ and patrick@
ok kettenis@
|
|
references. Use _thread_pagesize for the semaphore mmap size instead of
calling getpagesize() each time.
ok beck@
|
|
aliases by using a macro REDIRECT_SYSCALL() to map the symbols. Apply
that to getthrid(), sysctl(), and issetugid() as well.
ok mpi@ beck@
|
|
that will be needed and make libpthread work when ld.so/libc.a provide an
initial TIB.
|
|
thrkill(2), rolling the kill(2) syscall number with the ABI change to
avoid breaking binaries during during the transition. thrkill(2) includes
a 'tcb' argument that eliminates the need for locking in pthread_kill()
and simplifies pthread_cancel(). Switch __stack_smash_handler() to use
thrkill(2) and explicitly unblock SIGABRT.
Minor bump to both libc and libpthread: make sure you install a new kernel!
ok semarie@
|
|
|
|
into libc, and move pthread_sigmask() as well (just a trivial wrapper).
This provides consistent handling of SIGTHR between single- and multi-threaded
programs and is a step in the merge of all the libpthread overloads, providing
some ASM and Makefile bits that the other wrappers will need.
ok deraadt@ millert@
|
|
eliminates a chunk of complexity from the libpthread init and the fork
wrapper, as it was the bind lock that needed prebinding before use.
|
|
with ld.so locking whenever building NOPIC
pointless use of __ELF__ noted by brad@
ok miod@
|
|
may have been grabbed by another thread in the parent before the fork
problem report from dcoppa@, ok kettenis@
|
|
pthread and instead use the values from the embedded struct pthread_attr.
For bonus points, pay attention to the sched_inherit attribute and possibly
set the values from the parent thread.
Problem noted by natano of bitrig.
|
|
unregistering callbacks if the DSO is unloaded. Move the callback
handling from libpthread to libc, though libpthread still overrides the
inner call to handle locking and thread-library reinitialization.
Major version bump for both libc and libpthread.
verification that this fixes various ports ajacoutot@
asm assistance miod@; ok millert@ deraadt@
|
|
unroll to the cancellation check
ok tedu@
|
|
allocated by the kernel's execve bits.
ok matthew@
|
|
(namespace pollution!) or talking about its opinion on code.
ok krw@
|
|
defined and we don't think ld.so has already done the TCB setup.
ok and much discussion miod@
|
|
thread's existing handle must continue to be valid and it didn't
fully 'change' the thread handle anyway. For pthread_main_np(),
use a new flag, THREAD_ORIGINAL, to indicate that the flagged thread
is the original thread for *this* process.
Fixes some ConsoleKit failures according to aja@
|
|
lock across the kill, so that it can't exit (and its tid be reused!)
before the kill()
discussed with tedu@ marc@
|
|
be concurrently updated by __threxit()
prompted by a report from Alf Schlichting (a.schlichting (at) lemarit.com)
ok kettenis@
|
|
|
|
and spinning in kernel. partially back out, but in a way that makes going
forward again easy.
seen by ajacoutot
|
|
it's now atomic_lock to better reflect its usage, and librthread now
features a new spinlock that's really a ticket lock.
thrlseep can handle both types of lock via a flag in the clock arg.
(temp back compat hack)
remove some old stuff that's accumulated along the way and no longer used.
some feedback from dlg, who is concerned with all things ticket lock.
(you need to boot a new kernel before installing librthread)
|
|
|
|
and vax doesn't support symbols that are both weak and undefined (yet?).
sparc issue diagnosed by kettenis@, vax problem found by todd@
|
|
if the initial thread already has a TCB then don't override it, and
if the _dl_allocate_tls() and _dl_free_tls() symbols exist then use
them instead of malloc/free
ok kettenis@
|
|
we should actually check for _DYNAMIC at run-time rather than checking
for __PIC__ at compile time, since the two are actually independent.
Problem and solution identified by guenther; minor tweaks by me.
ok guenther
|
|
from bsd.lib.mk for C source files.
ok deraadt, pascal
|
|
accordingly so vax can build again.
ok deraadt
|
|
overrides provided by libpthread.a. This ensures that statically
linked threaded programs use (e.g.) __cerror() from libpthread.a
instead of libc.a. (Same idea previously used by libuthread.)
Thanks to fgsch@ for pointing out libuthread's solution to the static
linking problem.
ok guenther@, tedu@;
|
|
so that it can't get a signal while still running on the parent thread's
stack. Also, pass in sizeof(struct __tfork) to provide forward compat
when more members are added. This is an ABI change, so switch syscall
numbers and bump lib majors this time.
ok deraadt@ matthew@
|
|
ok kurt@
|
|
rthreads major library bump from last night. okay kettenis@
|
|
may need to call dlclose().
problem observed by Antti Harri (iku at openbsd.fi), ok kurt@
|
|
a function that can call sched_yield(), to avoid recursion
ok kurt@ kettenis@
|
|
that it resumes waiting unless the thread was canceled. As part
of this, change the internal _sem_wait() function to return zero
on success and an errno value on failure instead of 1 on success
and zero on failure.
|
|
|
|
non-standard alias, so prefer the former
|
|
lint doesn't understand designated initializers, so hide them from it
|
|
Improve consistency of error naming
|
|
don't try to merge values, round the sizes separately, and don't try to
unmap application-supplied stacks.
Copy from uthread the caching of default-sized stacks.
Have pthread_attr_init() and pthread_create() get the default attributes
from staticly allocated pthread_attr_t.
Cache the pagesize in _rthread_init() and provide a macro for rounding to it
based on suggestions from kettenis@ and tedu@, ok kettenis@
|
|
properly represents whether a process is multi-threaded or not. This fixes
a bug where if a forked child would create a new thread we would not set
__isthreaded.
ok guenther@
|
|
particularly the "consume the signal you just sent" hang, and putting
the wait queues in userspace.
Do cancellation handling in pthread_cond_*wait(), pthread_join(),
and sem_wait().
Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add
'abort" argument to thrsleep to close cancellation race; make
thr{sleep,wakeup} return errno values via *retval to avoid touching
userspace errno.
|