Subject: Re: top kvm_getlwps
To: Zafer Aydogan <zafer@aydogan.de>
From: Andrew Doran <ad@netbsd.org>
List: current-users
Date: 07/04/2007 15:22:54
Hi Zafer,

On Wed, Jul 04, 2007 at 01:37:06AM +0200, Zafer Aydogan wrote:

> If run top and select p and a pid (for example audacious mp3 player)
> and then t to show threads and then exit the application (audacious),
> then top dumps core.
> It looks like, top tries to get the pid/lwps, after it exited.
> 
> load averages:  0.50,  0.23,  0.11                  up 0 days,  0:08   
> 20:39:44
> 6 threads:     6 sleeping
> CPU states: 10.9% user,  0.0% nice,  5.0% system,  0.0% interrupt, 84.2% 
> idle
> Memory: 146M Act, 4K Inact, 4180K Wired, 17M Exec, 79M File, 330M Free
> Swap:
> kvm_open: kvm_getlwps: No such process
> Memory fault (core dumped) ATE      TIME   WCPU    CPU COMMAND      NAME
> $ 019     1 zafer     -13 lwpwai/0   0:03  0.94%  0.93% audacious   -
> 1019     7 zafer     -14 nanosl/0   0:01  0.94%  0.83% audacious   -
> 1019     8 zafer     -13 nanosl/0   0:00  0.06%  0.05% audacious   -
> 1019     6 zafer       2 poll/0     0:00  0.00%  0.00% audacious   -
> 1019     2 zafer     -13 sigwai/0   0:00  0.00%  0.00% audacious   -
> 1019     4 zafer     -14 parked/0   0:00  0.00%  0.00% audacious   -
> 
> without t, the process just disappears.

IIRC it's a bug in kvm_getlwps(). Are you able to file a PR?

Andrew