From 0b9957ff21dc2a9c577ff23b99d36d1787633701 Mon Sep 17 00:00:00 2001 From: jasone Date: Wed, 19 Jan 2000 07:04:50 +0000 Subject: Implement continuations to correctly handle [sig|_]longjmp() inside of a signal handler. Explicitly check for jumps to anywhere other than the current stack, since such jumps are undefined according to POSIX. While we're at it, convert thread cancellation to use continuations, since it's cleaner than the original cancellation code. Avoid delivering a signal to a thread twice. This was a pre-existing bug, but was likely unexposed until these other changes were made. Defer signals generated by pthread_kill() so that they can be delivered on the appropriate stack. deischen claims that this is unnecessary, which is likely true, but without this change, pthread_kill() can cause undefined priority queue states and/or PANICs in [sig|_]longjmp(), so I'm leaving this in for now. To compile this code out and exercise the bug, define the _NO_UNDISPATCH cpp macro. Defining _PTHREADS_INVARIANTS as well will cause earlier crashes. PR: kern/14685 Collaboration with: deischen --- lib/libpthread/thread/Makefile.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libpthread/thread/Makefile.inc') diff --git a/lib/libpthread/thread/Makefile.inc b/lib/libpthread/thread/Makefile.inc index 4697305..f46f007 100644 --- a/lib/libpthread/thread/Makefile.inc +++ b/lib/libpthread/thread/Makefile.inc @@ -60,6 +60,7 @@ SRCS+= \ uthread_info.c \ uthread_init.c \ uthread_ioctl.c \ + uthread_jmp.c \ uthread_join.c \ uthread_kern.c \ uthread_kill.c \ -- cgit v1.1