Subject: kern/22494: pthread__find_interrupted called with wrong nsas argument
To: None <gnats-bugs@gnats.netbsd.org>
From: None <chris@pin.lu>
List: netbsd-bugs
Date: 08/15/2003 15:47:22
>Number:         22494
>Category:       kern
>Synopsis:       pthread__find_interrupted called with wrong nsas argument
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 15 13:48:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christian Limpach <chris@pin.lu>
>Release:        current as of 03/08/15
>Organization:
	
>Environment:
>Description:
	The nsas argument for pthread__find_interrupted is calculated
	incorrectly for an SA_UPCALL_BLOCKED upcall where the variable
	``first'' is incremented.  This code path is not used at the
	moment since the kernels SA_UPCALL_BLOCKED upcalls only have
	an event lwp argument and no interrupted lwp argument.

>How-To-Repeat:
	code inspection
>Fix:
	
Index: pthread_sa.c
===================================================================
RCS file: /cvs/netbsd/src/lib/libpthread/pthread_sa.c,v
retrieving revision 1.13
diff -u -r1.13 pthread_sa.c
--- pthread_sa.c	21 Jul 2003 22:24:09 -0000	1.13
+++ pthread_sa.c	14 Aug 2003 21:21:49 -0000
@@ -114,7 +114,7 @@
 	 * they can do their own version of this dance.
 	 */
 	if ((ev + intr) >= first) {
-		pthread__find_interrupted(sas + first, ev + intr,
+		pthread__find_interrupted(sas + first, ev + intr + 1 - first,
 		    &intqueue, &schedqueue, self);
 		if (intqueue != self)
 			pthread__resolve_locks(self, &intqueue);

-- 
Christian Limpach <chris@pin.lu>
>Release-Note:
>Audit-Trail:
>Unformatted: