Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Nov 2017 09:38:09 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kdrakehp@zoho.com
Subject:   Re: svn commit: r324619 - in head/usr.bin/procstat: . tests
Message-ID:  <65f847b0-b730-ee35-ca74-2a77cecde9a3@FreeBSD.org>
In-Reply-To: <20171113020016.GF76223@spindle.one-eyed-alien.net>
References:  <201710141838.v9EIcaOQ047300@repo.freebsd.org> <81c30f82-268e-ce59-4326-5a2f14ca62e5@FreeBSD.org> <20171113020016.GF76223@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 13/11/2017 04:00, Brooks Davis wrote:
> On Sun, Nov 12, 2017 at 12:15:35PM +0200, Andriy Gapon wrote:
>> On 14/10/2017 21:38, Brooks Davis wrote:
>>> Author: brooks
>>> Date: Sat Oct 14 18:38:36 2017
>>> New Revision: 324619
>>> URL: https://svnweb.freebsd.org/changeset/base/324619
>>>
>>> Log:
>>>   Switch procstat from subcommand flags to verbs
>>>   
>>>   - Use an enumerated value instead of separate flags for commands
>>>   - Look for a verb if no command flag is set
>>>   - Lookup the "xocontainer" value based on the command
>>>   - Document the new command verbs in the man-page
>>>   
>>>   Submitted by:	kdrakehp@zoho.com
>>>   Differential Revision:	https://reviews.freebsd.org/D10916
>>
>> What's the new way of doing procstat -kk -a ?
>>
>> procstat -kk -a now crashes because cmd is NULL when 'k' option is processed.
>> procstat kstack and procstat kstack -v just produce the usage message without
>> telling any specific usage error.
>> procstat kstack -a says that 'a' is an illegal option.
> 
> From the reading the manpage it should be: procstat -a kstack -v

This works, thank you.

> The crash is a regression.  Please file a bugreport.

This one line patch seems to fix the crash and procstat -kk -a is usable again.
Does it look okay to you?

--- a/usr.bin/procstat/procstat.c
+++ b/usr.bin/procstat/procstat.c
@@ -296,7 +296,7 @@ main(int argc, char *argv[])
 			cmd = getcmd("tsignals");
 			break;
 		case 'k':
-			if (cmd->cmd == procstat_kstack) {
+			if (cmd != NULL && cmd->cmd == procstat_kstack) {
 				if ((procstat_opts & PS_OPT_VERBOSE) != 0)
 					usage();
 				procstat_opts |= PS_OPT_VERBOSE;


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65f847b0-b730-ee35-ca74-2a77cecde9a3>