Subject: gdb can crash my system (lwp related)
To: None <>
From: Matthias Drochner <>
List: tech-kern
Date: 02/05/2003 22:29:57
This is a multipart MIME message.

Content-Type: text/plain; charset=us-ascii

Hi -
I'l append a program which panics the system if executed in the
Just run it, and type 'c' or 'q' after the signal is reported:

(gdb) r
Starting program: /home/drochner/ccbug/./a.out
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGUSR1, User defined signal 1.
0x4807709f in _sys___sigsuspend14 () from /usr/lib/
(gdb) c

The reason is obvious: sys_ptrace() calls proc_unstop() and passes
the result to setrunnable(). And with the process waiting in
sigsuspend() (ie wchan != 0) a NULL gets passed.
The obvious fix, checking proc_unstop()'s result, avoids the panic,
but is not really satisfying because the signal doesn't get
delivered either.
The semantics behind proc_unstop() is not easy to understand...

best regards

Content-Type: text/plain ; name="sigtest.c"; charset=us-ascii
Content-Description: sigtest.c
Content-Disposition: attachment; filename="sigtest.c"

#include <signal.h>

	sigset_t ss, ss2;


	sigaddset(&ss, SIGUSR1);
	sigprocmask(SIG_SETMASK, &ss, 0);

	kill(getpid(), SIGUSR1);