Subject: kern/36183: problem with ptrace and multithreaded processes
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <ad@netbsd.org>
List: netbsd-bugs
Date: 04/20/2007 21:40:00
>Number:         36183
>Category:       kern
>Synopsis:       problem with ptrace and multithreaded processes
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 20 21:40:00 +0000 2007
>Originator:     Andrew Doran
>Release:        NetBSD 4.99.17
>Organization:
The NetBSD Project
>Environment:
N/A
>Description:
Using ptrace, a process can be made to stop for various events. The debugger
can inject a signal to be handled by the process when resuming. There are two
problems with this currently:

1. Removal and handling of the injected signal is not atomic and this can
   cause a kernel panic if two threads try to handle it.

2. The thread elected to handle the signal may not be able to take it.

3. There is no documented policy around which thread should take the signal.
>How-To-Repeat:
Code inspection.
>Fix:
Address the 3 issues above.