kdb
[Top] [All Lists]

Re: new patch for KDB command "kill"

To: "Zhang, Sonic" <sonic.zhang@xxxxxxxxx>
Subject: Re: new patch for KDB command "kill"
From: Keith Owens <kaos@xxxxxxx>
Date: Thu, 03 Apr 2003 18:16:20 +1000
Cc: "KDB (E-mail)" <kdb@xxxxxxxxxxx>
In-reply-to: Your message of "Thu, 03 Apr 2003 09:21:22 +0800." <37FBBA5F3A361C41AB7CE44558C3448E488BB7@pdsmsx403.ccr.corp.intel.com>
Sender: kdb-bounce@xxxxxxxxxxx
On Thu, 3 Apr 2003 09:21:22 +0800, 
"Zhang, Sonic" <sonic.zhang@xxxxxxxxx> wrote:
>       The attachment is the patch for KDB command "kill".
>       usage:
>       kill <-signal> <pid>

You need to check the argument count in kdb_kill, otherwise kill with
no arguments will kill kdb :).

The test for valid numbers is wrong, you do not test endp against the
argument, you test is *endp is NUL.  See simple_strtol in kdb_md().
kdbgetularg() uses a different test because it has to handle
expressions.

Instead of coding all the signal handling yourself, can you use
kernel/signal.c:send_sig_info()?  send_sig_info handles all the cases
for stopped processes, run queues etc., using that routine means that
kdb is not sensitive to changes in signal code.  Do trylock on
t->sigmask_lock in kdb to see if you can get the process mask lock
before calling send_sig_info(), to avoid deadlock.


<Prev in Thread] Current Thread [Next in Thread>