NetBSD Problem Report #40341

From www@NetBSD.org  Wed Jan  7 21:29:47 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 8F44663BA1C
	for <gnats-bugs@gnats.netbsd.org>; Wed,  7 Jan 2009 21:29:47 +0000 (UTC)
Message-Id: <20090107212947.5930E63B938@narn.NetBSD.org>
Date: Wed,  7 Jan 2009 21:29:47 +0000 (UTC)
From: ad@netbsd.org
Reply-To: ad@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: raise() is not thread-aware
X-Send-Pr-Version: www-1.0

>Number:         40341
>Category:       kern
>Synopsis:       raise() is not thread-aware
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 07 21:30:00 +0000 2009
>Closed-Date:    Fri Jan 30 00:00:37 +0000 2009
>Last-Modified:  Mon Feb 02 20:35:01 +0000 2009
>Originator:     Andrew Doran
>Release:        5.0_BETA
>Organization:
The NetBSD Project
>Environment:
n/a
>Description:
The OpenGroup web site says that raise() should direct the signal to the 
current thread if possible. This is important for some uses, e.g. abort(),
which need to kill the calling thread. Right now, the signal is not 
directed on NetBSD and so could be taken by another thread:

     44 int
     45 raise(s)
     46 	int s;
     47 {
     48 	return(kill(getpid(), s));
     49 }

>How-To-Repeat:
Code inspection.
>Fix:
Change the above to:

    return _lwp_kill(_lwp_self(), s);

It's a simple fix but I don't have time right now.

>Release-Note:

>Audit-Trail:
From: Mindaugas Rasiukevicius <rmind@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40341 CVS commit: src/lib/libc/gen
Date: Thu, 29 Jan 2009 23:52:21 +0000 (UTC)

 Module Name:	src
 Committed By:	rmind
 Date:		Thu Jan 29 23:52:21 UTC 2009

 Modified Files:
 	src/lib/libc/gen: raise.c

 Log Message:
 Change raise(3) to be thread-aware - send the signal to current LWP.
 From <ad> via PR/40341.


 To generate a diff of this commit:
 cvs rdiff -r1.7 -r1.8 src/lib/libc/gen/raise.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: rmind@NetBSD.org
State-Changed-When: Fri, 30 Jan 2009 00:00:37 +0000
State-Changed-Why:
Committed, pull-up requested.


From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40341 CVS commit: [netbsd-5] src/lib/libc/gen
Date: Mon,  2 Feb 2009 20:34:18 +0000 (UTC)

 Module Name:	src
 Committed By:	snj
 Date:		Mon Feb  2 20:34:18 UTC 2009

 Modified Files:
 	src/lib/libc/gen [netbsd-5]: raise.c

 Log Message:
 Pull up following revision(s) (requested by rmind in ticket #380):
 	lib/libc/gen/raise.c: revision 1.8
 Change raise(3) to be thread-aware - send the signal to current LWP.
 From <ad> via PR/40341.


 To generate a diff of this commit:
 cvs rdiff -r1.7 -r1.7.38.1 src/lib/libc/gen/raise.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.