Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 May 2002 12:20:02 -0700 (PDT)
From:      Archie Cobbs <archie@packetdesign.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/37614: libc_r aborts when exiting thread is canceled
Message-ID:  <200205021920.g42JK2v90600@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/37614; it has been noted by GNATS.

From: Archie Cobbs <archie@packetdesign.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/37614: libc_r aborts when exiting thread is canceled
Date: Thu, 2 May 2002 12:18:02 -0700 (PDT)

 Oops, my patch is incomplete as pointed out by Daniel Eischen.
 The combined patchfile (both patches are required) is below.
 
 NOTE: these patches are for -stable; -current is very similar.
 
 -Archie
 
 __________________________________________________________________________
 Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com
 
 Index: uthread_cancel.c
 ===================================================================
 RCS file: /home/cvs/freebsd/src/lib/libc_r/uthread/uthread_cancel.c,v
 retrieving revision 1.3.2.4
 diff -u -r1.3.2.4 uthread_cancel.c
 --- uthread_cancel.c	19 Aug 2001 11:45:58 -0000	1.3.2.4
 +++ uthread_cancel.c	2 May 2002 19:18:37 -0000
 @@ -15,7 +15,8 @@
  
  	if ((ret = _find_thread(pthread)) != 0) {
  		/* NOTHING */
 -	} else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK) {
 +	} else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK
 +	    || (pthread->flags & PTHREAD_EXITING) != 0) {
  		ret = 0;
  	} else {
  		/* Protect the scheduling queues: */
 @@ -186,7 +187,8 @@
  pthread_testcancel(void)
  {
  	if (((_thread_run->cancelflags & PTHREAD_CANCEL_DISABLE) == 0) &&
 -	    ((_thread_run->cancelflags & PTHREAD_CANCELLING) != 0)) {
 +	    ((_thread_run->cancelflags & PTHREAD_CANCELLING) != 0) &&
 +	    ((_thread_run->flags & PTHREAD_EXITING) == 0)) {
  		/*
  		 * It is possible for this thread to be swapped out
  		 * while performing cancellation; do not allow it

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205021920.g42JK2v90600>