| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
multi-threaded processes when they receive a signal:
1. Make the parent of the process (the tracer) wait for all threads to be
stopped (in wait4(2)) instead of the thread that received the signal.
This prevents us from calling tsleep(9) recursively.
2. Assume that we already hold the kernel lock if the P_SINTR flag is set
(just like we already assumed we were holding the scheduler lock) and
don't try to grab it again.
This should fix the panic that many people reported when debugging
multi-threaded programs with gdb(1).
ok & lots of help from guenther@
|
| | |
|
| |
|
|
|
|
|
|
| |
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread
flags to process flags. Add allprocess list for the code that just wants
to see processes.
ok tedu@
|
| |
|
|
|
|
|
|
| |
hardclock() set a flag on the running thread and force AST processing,
and then have the thread signal itself from userret().
idea and flag names from FreeBSD
ok jsing@
|
| |
|
|
|
|
| |
take the signal by preference if it's eligible (unblocked or sigwaiting).
ok jsing@
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sigmask even if there are no pending signals under the temporary
sigmask.
Refactor existing select() and poll() system calls to introduce the
pselect() and ppoll() system calls.
Add rthread wrappers for pselect() and ppoll(). While there, update
cancellation point comments to reflect recent fdatasync() addition.
Minor bumps for libc and librthread due to new symbols.
ok guenther, millert, deraadt, jmc
|
| | |
|
| |
|
|
|
| |
.h files to pull it in, if needed
ok tedu
|
| |
|
|
|
|
| |
up the VFS calls in the error paths in coredump()
Pointed out by armani@, ok beck@
|
| |
|
|
|
| |
with kettenis guenther and beck.
ok guenther
|
| |
|
|
|
|
| |
yield between operations. Re-grab the vnode every operation,
so that multiple coredumps can be saved at the same time.
ok guenther beck etc
|
| |
|
|
|
|
|
|
|
| |
dynamically, by comparing the stack pointer against the altstack
base and size, so that you get the correct answer if you longjmp
out of the signal handler, as tested by regress/sys/kern/stackjmp/.
Also, fix alt stack handling on vax, where it was completely broken.
Testing and corrections by miod@, krw@, tobiasu@, pirofti@
|
| |
|
|
|
|
|
|
| |
thread coredumps, the former thread needs to be released by the
later single_thread_set(SINGLE_EXIT) call, even though its P_WEXIT
flag is set.
ok kettenis@
|
| |
|
|
|
|
|
|
| |
can be suspended and/or decrement pr->ps_singlecount if necessary.
With that added, the call the other direction needs to use its own
flag (EXIT_THREAD_NOCHECK) to avoid looping.
problem diagnosed from a hang naddy@ hit; ok kettenis@
|
| |
|
|
|
|
| |
attached to and not just the thread, which can go away.
Problem observed by jsg@; ok jsg@ matthew@
|
| |
|
|
|
|
|
|
|
|
| |
It implements a full-stop model where all threads are stopped before handing
over control to the debugger. Events are reported as before through wait(2);
you will have to call ptrace(PT_GET_PROCESS_STATE, ...) to find out which
thread hit the event. Since this changes the size of struct ptrace_state,
you will have to recompile gdb.
ok guenther@
|
| | |
|
| |
|
|
| |
ok guenther@
|
| |
|
|
|
|
|
| |
of per-rthread. Handling of per-thread tick and runtime counters
inspired by how FreeBSD does it.
ok kettenis@
|
| |
|
|
|
|
| |
structs timespec, timeval, sigaction, and rlimit.
ok otto@ jsing@
|
| | |
|
| |
|
|
| |
the main thread exiting. c.f. regress/sys/kern/main-thread-exited/
|
| |
|
|
|
|
|
|
|
|
| |
- move the P_TRACED and P_INEXEC flags, and p_oppid, p_ptmask, and
p_ptstat member from struct proc to struct process
- sort the PT_* requests into those that take a PID vs those that
can also take a TID
- stub in PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT
ok kettenis@
|
| |
|
|
|
|
|
|
| |
for the thread handling it. Otherwise (i.e., no sig divert), prefer
to deliver a process-aimed signal to some thread which doesn't have
the signal blocked.
ok tedu@
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
when exec succeeds.
ok jsing@
|
| |
|
|
|
|
|
|
|
| |
copied area, and initialize it properly in the FORK_THREAD case.
This restores the behavior of a forked process inheriting its parent's
signal stack.
ok guenther@
|
| |
|
|
|
| |
past, pull that code out seperately.
ok guenther miod
|
| |
|
|
|
|
|
|
| |
and use curp vs p instead of p1 vs p2. Add curpr and pr variables
for the respective struct processes. Make sigactsshare() return
the shared sigacts intead of taking the struct proc to update.
ok deraadt@
|
| |
|
|
|
|
|
|
|
|
| |
layers. Then things get terribly confusing because the various MI layers
swap variable names for parameters, local variables, and structure fields
numerous times. Unconfuse all this mess.
Note that exec_elf.c coredump cpi_sigcode used to contain the MD traptype
but will now contain the MI siginfo-style "code" value.
ok miod kettenis pirofti
|
| |
|
|
|
|
| |
as it causes hangs in some ports, including libsigsegv's configure script
confirmed by krw@, landry@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
sys_osigaltstack() is 7 years old and no longer needed; all glory to
the sys_sigaltstack()!
sys_ogetdirentries() is about 9 months old, but still acceptable
within our release cycle; move from STD to COMPAT_48 to make this
clearer for tedu@ next year.
sys_sbrk() and sys_sstk() are completely obsolete: all they do is
return ENOSYS.
ok guenther@
|
| |
|
|
|
|
|
|
|
|
|
| |
hold the kernel lock, but still need call one function that needs it.
Instead of grabbing the lock all over the place, move the locks into
the affected functions: trapsignal, scdebug*, ktrsyscall, ktrsysret,
systrace_redirect and ADDUPROF. In the cases we already hold the biglock
we'll just recurse.
kettenis@, beck@ ok
|
| |
|
|
|
|
|
| |
KERNEL_PROC_LOCK -> KERNEL_LOCK
KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK
oga@ ok
|
| |
|
|
|
|
|
|
| |
problem has been tracked down. This fixes the sharing of the signal
handling state: shared bits go in sigacts, per-rthread bits goes in
struct proc.
ok deraadt@
|
| |
|
|
|
|
| |
until they're zombies and then send them signals (for intr mounts). Until
that is untangled, the sigacts change is unsafe. sthen@ was the victim
for this one
|
| |
|
|
|
|
|
|
|
|
|
|
| |
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves
to struct sigacts, wihle stuff that should be per rthread (ps_oldmask,
SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping
state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread
until our locking around coredumping is better.
Oh, and remove the old SunOS-compat ps_usertramp member.
"I like the sound of this" tedu@
|
| |
|
|
|
|
|
|
|
| |
a vforked child behave correctly. Have the parent in a vfork()
wait on a (different) flag in *its* process instead of the child
to prevent a possible use-after-free. When ktracing the child
return from a fork, call it rfork if an rthread was created.
ok blambert@
|
| |
|
|
|
|
| |
that you can't evade the checks by doing the dirty work in an rthread
ok blambert@, deraadt@
|
| |
|
|
|
|
| |
into struct process.
ok tedu@ deraadt@
|
| |
|
|
|
|
|
|
|
| |
so that the process-level stuff is to/from struct process and not
struct proc. This fixes a bunch of problem cases in rthreads.
Based on earlier work by blambert and myself, but mostly written
at c2k10.
Tested by many: deraadt, sthen, krw, ray, and in snapshots
|
| | |
|
| |
|
|
|
|
| |
way a kill() intended for a thread can result in a separate process
getting the signal.
ok tedu@ art@
|
| | |
|
| |
|
|
|
| |
the now-removed HPUX compat code.
ok and build testing deraadt@
|
| | |
|
| |
|
|
|
| |
(not done) hasn't changed, but now it's less work to test things.
ok art deraadt
|
| |
|
|
|
| |
so stop including it in kernel .c files.
"sure" deraadt@
|