Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Mar 2001 13:00:09 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        James FitzGibbon <jfitz@FreeBSD.ORG>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: PR bin/25110 - pthreads signal handling problem
Message-ID:  <Pine.SUN.3.91.1010309125521.19539A-100000@pcnet1.pcnet.com>
In-Reply-To: <20010309122047.A34827@targetnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 9 Mar 2001, James FitzGibbon wrote:
> I'm wondering if anyone has the time or inclination to take a look at a fix
> for PR bin/25110.  We're having problems using a freshly-built 4.2-stable
> box (technically 4.3 rc at this point), and the bug is still present.
> 
> I'm not sure how many people would see this problem (we see it because we
> have to compile Apache 1.x with the -pthread switch due to add-on modules
> that are threaded).  Under 4.1-stable, everything was fine.  At some point
> between 4.1-stable and 4.2-release, something changed, but my hunt through
> the CVS repository hasn't revealed anything obvious.
> 
> In any case, it's a repeatable bug (the PR includes a code sample) and
> unless looked at, it will be a bug in 4.3-release.
> 
> If there's any clarification needed, please let me know.

You can try the included patch.

-- 
Dan Eischen

Index: uthread_fork.c
===================================================================
RCS file: /opt/FreeBSD/cvs/src/lib/libc_r/uthread/uthread_fork.c,v
retrieving revision 1.21
diff -u -r1.21 uthread_fork.c
--- uthread_fork.c	2001/01/24 13:03:33	1.21
+++ uthread_fork.c	2001/03/09 17:53:37
@@ -32,6 +32,7 @@
  * $FreeBSD: src/lib/libc_r/uthread/uthread_fork.c,v 1.21 2001/01/24 
13:03:33 deischen Exp $
  */
 #include <errno.h>
+#include <signal.h>
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -110,7 +111,16 @@
 		else if (_pq_init(&_readyq) != 0) {
 			/* Abort this application: */
 			PANIC("Cannot initialize priority ready queue.");
-		} else {
+		} else if ((_thread_sigstack.ss_sp == NULL) &&
+		    ((_thread_sigstack.ss_sp = malloc(SIGSTKSZ)) == NULL))
+			PANIC("Unable to allocate alternate signal stack");
+		else {
+			/* Install the alternate signal stack: */
+			_thread_sigstack.ss_size = SIGSTKSZ;
+			_thread_sigstack.ss_flags = 0;
+			if (__sys_sigaltstack(&_thread_sigstack, NULL) != 0)
+				PANIC("Unable to install alternate signal stack");
+
 			/*
 			 * Enter a loop to remove all threads other than
 			 * the running thread from the thread list:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1010309125521.19539A-100000>