]> granicus.if.org Git - procps-ng/log
procps-ng
4 years agotop: address several 'mandoc -Tlint' errors & warnings
Jim Warner [Fri, 10 Jul 2020 05:00:00 +0000 (00:00 -0500)]
top: address several 'mandoc -Tlint' errors & warnings

This commit addresses the errors/warnings shown below.

Reference(s):
ERROR: skipping end of block that is not open: RE
WARNING: skipping paragraph macro: sp after PP
WARNING: skipping paragraph macro: PP empty

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: make that 'cpu_prt' function a tad more efficient
Jim Warner [Thu, 9 Jul 2020 05:00:00 +0000 (00:00 -0500)]
top: make that 'cpu_prt' function a tad more efficient

This commit only eliminates two 'nop' instructions and
one 'jmp' instruction. However, it makes that C source
code look a little bit prettier than it looked before.

[ and yes, some unnecessary parenthesis were used to ]
[ force an alignment of some related lines. it costs ]
[ us nothing in extra code yet helps in readability. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: make the 'cpu_tics' function a tad more efficient
Jim Warner [Wed, 8 Jul 2020 05:00:00 +0000 (00:00 -0500)]
top: make the 'cpu_tics' function a tad more efficient

This patch eliminates one variable which resulted in a
corresponding elimination of three 'mov' instructions.

[ that was 6 bytes per 'mov' for a total of 18 bytes ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agoMerge branch 'jrybar/procps-vmstat-watch-manpage-fix'
Craig Small [Tue, 30 Jun 2020 22:04:51 +0000 (08:04 +1000)]
Merge branch 'jrybar/procps-vmstat-watch-manpage-fix'

References:
 procps-ng/procps!103

4 years agovmstat and watch manpage slight fixes
Jan Rybar [Thu, 30 Apr 2020 15:06:18 +0000 (17:06 +0200)]
vmstat and watch manpage slight fixes

vmstat - align wording with proc manpage to clarify ambiguities  (rhbz#1796043)
watch - manpage presumes ntp tools are present by default (which they're not on rpm and deb distros, rhbz#1583669)

4 years agotop: raise the amount by which top's stat buffer grows
Jim Warner [Fri, 26 Jun 2020 05:00:00 +0000 (00:00 -0500)]
top: raise the amount by which top's stat buffer grows

We won't go as far as the merge request shown below in
increasing buffer size, but we'll reduce substantially
total iterations while growing it to achieve one read.

[ and this seems in line with what was recently done ]
[ to accommodate the massively parallel environments ]
[ thru 2 abreast ('4') and combined cpus ('!') modes ]

Reference(s:
https://gitlab.com/procps-ng/procps/-/merge_requests/105

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agoNEWS: updated for those recent utf-8 translation fixes
Jim Warner [Thu, 25 Jun 2020 05:00:00 +0000 (00:00 -0500)]
NEWS: updated for those recent utf-8 translation fixes

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: provide for zero length character in utf8 support
Jim Warner [Fri, 19 Jun 2020 05:00:00 +0000 (00:00 -0500)]
top: provide for zero length character in utf8 support

This commit is prompted by the preceding change to the
library's escape.c module which, in turn, was prompted
by that issue shown below (with thanks to Konstantin).

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/176

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agolibrary: correct that 'escape_str_utf8' guy's behavior
Jim Warner [Thu, 18 Jun 2020 05:00:00 +0000 (00:00 -0500)]
library: correct that 'escape_str_utf8' guy's behavior

Thanks to Konstantin for discovering 2 problems in the
issue referenced below. That 15+ year old logic went a
little too far overboard wrestling with a utf8 string.

Henceforth, we will not treat 'x9b' as special. And we
also will handle a 'combining acute accent' correctly.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/176

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: some miscellaneous accumulated tweaks and cleanup
Jim Warner [Tue, 16 Jun 2020 05:00:00 +0000 (00:00 -0500)]
top: some miscellaneous accumulated tweaks and cleanup

I've grown to hate that man document rendering when it
comes to hyphenation. So this patch will eliminate it.

And we'll also eliminate an unnecessary initialization
in that top program code concerned with combined cpus.

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agodocs: some manpage fixes
Craig Small [Thu, 4 Jun 2020 12:25:26 +0000 (22:25 +1000)]
docs: some manpage fixes

Some editorial changes so the man pages follow the standards.

References:
 procps#173

4 years agotop: fix a minor startup flaw for the '2 abreast' mode
Jim Warner [Sun, 31 May 2020 05:00:00 +0000 (00:00 -0500)]
top: fix a minor startup flaw for the '2 abreast' mode

This ensures that a single '4' keystroke will reliably
toggle the new 2 abreast mode ON. Depending on whether
an older configuration file existed or whether top was
configured with '--disable-modern-top', keying the '4'
for a second time might otherwise have been necessary.

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: help the '#define PRETEND48CPU' be more realistic
Jim Warner [Sat, 30 May 2020 05:00:00 +0000 (00:00 -0500)]
top: help the '#define PRETEND48CPU' be more realistic

The previous PRETEND8CPUS #define was recently changed
to PRETEND48CPU to better exercise the new '4' and '!'
toggles. But, the implementation simply duplicated the
/proc/stat summary line for each cpu. Therefore, every
cpu showed the same graph/detail (depending upon 't').

This patch shows the actual individual cpu information
(duplicated, of course, when total cpus are exceeded).

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: preserved those new '4' and '!' toggles in rcfile
Jim Warner [Fri, 29 May 2020 05:00:00 +0000 (00:00 -0500)]
top: preserved those new '4' and '!' toggles in rcfile

This patch will address Craig's feedback regarding the
original implementation of top's two new toggles. It's
likely other users would have questioned why they were
not saved also, once they discover these new features.

And, since the minimum terminal width was just lowered
to 80 columns, the default for window #1 is also being
changed to show the individual cpu graphs two abreast.

[ assuming no '--disable-modern-top' for ./configure ]

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
https://www.freelists.org/post/procps/two-major-changes-to-top,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: warn users if rcfile save prevents older top read
Jim Warner [Fri, 29 May 2020 05:00:00 +0000 (00:00 -0500)]
top: warn users if rcfile save prevents older top read

I'm about to break older top rcfile compatibility when
preserving those two new toggles. And, though this has
happened several times over the years, we never issued
any warnings that such thing was just about to happen.

So, this patch corrects the long standing shortcoming.

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: reduce minimum terminal width with 2 abreast mode
Jim Warner [Thu, 28 May 2020 05:00:00 +0000 (00:00 -0500)]
top: reduce minimum terminal width with 2 abreast mode

For the original implementation of the '4' toggle, the
minimum width was set at 165 columns. This was done to
avoid truncations when detailed cpu statistics (versus
graphs) were being displayed. Those can not be scaled.

Upon reflection, it seems more appropriate to give the
user the choice of whether or not to truncate. And, by
reducing that minimum width requirement to 80 columns,
we'll vastly expand potential use of two abreast mode.

[ we'll keep that original as '#define TOG4_NOTRUNC' ]

The patch also updates the man document appropriately.
Along the way, we will trade the potentially confusing
word 'adjacent' for the more natural 'additional' when
detailing the '!' toggle in 4b. Summary-Area-Commands.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
https://www.freelists.org/post/procps/two-major-changes-to-top

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: address each of the most recent coverity warnings
Jim Warner [Wed, 27 May 2020 05:00:00 +0000 (00:00 -0500)]
top: address each of the most recent coverity warnings

This patch attempts to supress the following warnings:

. MISSING_BREAK, TAINTED_SCALAR plus SIZEOF_MISMATCH .

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agoNEWS: acknowledge those two new top command provisions
Jim Warner [Mon, 25 May 2020 05:00:00 +0000 (00:00 -0500)]
NEWS: acknowledge those two new top command provisions

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: bump up that PRETEND8CPUS #define to PRETEND48CPU
Jim Warner [Sun, 24 May 2020 05:00:00 +0000 (00:00 -0500)]
top: bump up that PRETEND8CPUS #define to PRETEND48CPU

This patch simply allows for better testing of our two
new toggles: '4' (2 abreast) plus '!' (combined cpus).

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: add '!' toggle for combined cpus display, man doc
Jim Warner [Thu, 21 May 2020 05:00:00 +0000 (00:00 -0500)]
top: add '!' toggle for combined cpus display, man doc

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: add '!' toggle for combined cpus display, program
Jim Warner [Thu, 21 May 2020 05:00:00 +0000 (00:00 -0500)]
top: add '!' toggle for combined cpus display, program

When implementing that earlier '4' toggle, in response
to the issue referenced below, I got to thinking about
those environments with massively parallel processors.

Such environments may not benefit from the '4' toggle.

So, I decided to implement a feature that could enable
use of those '1' and/or '4' toggles no matter how many
active processors top may have ultimately encountered.

With the new '!' toggle, adjacent cpus can be combined
to any degree, represented as a single cpu group/line.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: add '4' toggle for 2 abreast cpu display, man doc
Jim Warner [Wed, 13 May 2020 12:02:43 +0000 (07:02 -0500)]
top: add '4' toggle for 2 abreast cpu display, man doc

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: add '4' toggle for 2 abreast cpu display, program
Jim Warner [Wed, 13 May 2020 05:00:00 +0000 (00:00 -0500)]
top: add '4' toggle for 2 abreast cpu display, program

In the back of my mind, I've always wanted to enable a
two abreast cpu display. Folks with massively parallel
machines must surely have been frustrated with the '1'
toggle when Off (individual cpus in the Summary Area).

So, I'll use that recently raised issue shown below as
a justification for finally implementing this feature.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agotop: eliminate a long standing extraneous comment line
Jim Warner [Tue, 5 May 2020 05:00:00 +0000 (00:00 -0500)]
top: eliminate a long standing extraneous comment line

Wow, hard to believe the extraneous comment line dates
all way back to an introduction of NLS support (2011).

Signed-off-by: Jim Warner <james.warner@comcast.net>
4 years agobuild-sys: Some version fixes
Craig Small [Fri, 22 May 2020 07:11:13 +0000 (17:11 +1000)]
build-sys: Some version fixes

tarball-version should be shipped in tarball
version is not.

4 years agoNEWS: add pgrep older than item
Craig Small [Sun, 17 May 2020 12:00:51 +0000 (22:00 +1000)]
NEWS: add pgrep older than item

4 years agoMerge branch 'edneville/procps-master'
Craig Small [Sun, 17 May 2020 11:54:55 +0000 (21:54 +1000)]
Merge branch 'edneville/procps-master'

References:
 procps-ng/procps!79

4 years agopgrep.c: simplifying uptime call
ed [Thu, 21 Mar 2019 21:32:22 +0000 (21:32 +0000)]
pgrep.c: simplifying uptime call

4 years agopgrep.c: Replacing seconds_since_boot with uptime as suggested by Craig Small
ed [Thu, 21 Mar 2019 20:21:09 +0000 (20:21 +0000)]
pgrep.c: Replacing seconds_since_boot with uptime as suggested by Craig Small

4 years agopgrep.c: change to allow 'older than' style selection
ed [Fri, 9 Nov 2018 22:03:17 +0000 (22:03 +0000)]
pgrep.c: change to allow 'older than' style selection
pgrep.1: man page addition for above selection
Makefile.am: addition of global.c to include sections since boot in pgrep.

4 years agoMerge branch 'awesomeclaw/procps-master'
Craig Small [Tue, 12 May 2020 09:22:48 +0000 (19:22 +1000)]
Merge branch 'awesomeclaw/procps-master'

References:
 procps-ng/procps!62

Signed-off-by: Craig Small <csmall@dropbear.xyz>
4 years agoAdd information on WATCH_INTERVAL env var to watch documentation
Harry Wagstaff [Mon, 23 Apr 2018 10:43:47 +0000 (11:43 +0100)]
Add information on WATCH_INTERVAL env var to watch documentation

4 years agoAdd ability to specify watch interval using environment variable WATCH_INTERVAL
Harry Wagstaff [Mon, 23 Apr 2018 10:34:08 +0000 (11:34 +0100)]
Add ability to specify watch interval using environment variable WATCH_INTERVAL

4 years agovmstat: Add NEWS and revert comment from prev
Craig Small [Tue, 12 May 2020 08:57:26 +0000 (18:57 +1000)]
vmstat: Add NEWS and revert comment from prev

Reverted the translation hint as the fields are used for both
normal and wide modes, so need to fit the smaller of the two.

Added NEWS item

References:
 commit 01c1b2345ee952c28a9995c5766839f43f8e5ac9

4 years agoMerge branch 'isj4/procps-mode_wide_columns'
Craig Small [Tue, 12 May 2020 08:52:03 +0000 (18:52 +1000)]
Merge branch 'isj4/procps-mode_wide_columns'

References:
 procps-ng/procps!48

4 years agoUse wide columns for r/b too in wide mode
Ivan Skytte Jørgensen [Thu, 8 Jun 2017 12:14:50 +0000 (14:14 +0200)]
Use wide columns for r/b too in wide mode

2 digits are not enough for number of runnable/blocked processes on modern
systems. Changed to 4 digits with given the -w option.

4 years agoMerge branch 'swiggett/procps-patch-1'
Craig Small [Mon, 11 May 2020 07:43:12 +0000 (17:43 +1000)]
Merge branch 'swiggett/procps-patch-1'

References:
 procps-ng/procps!34

Signed-off-by: Craig Small <csmall@dropbear.xyz>
4 years agoFixes small bug in struct proc_t documentation.
Dylan Swiggett [Tue, 29 Nov 2016 22:34:37 +0000 (22:34 +0000)]
Fixes small bug in struct proc_t documentation.

From http://man7.org/linux/man-pages/man5/proc.5.html:

(22) starttime  %llu
                        The time the process started after system boot.  In
                        kernels before Linux 2.6, this value was expressed
                        in jiffies.  Since Linux 2.6, the value is expressed
                        in clock ticks (divide by sysconf(_SC_CLK_TCK)).

5 years agobuild-sys: Enable testing of sigqueue
Craig Small [Tue, 28 Apr 2020 09:40:07 +0000 (19:40 +1000)]
build-sys: Enable testing of sigqueue

The referenced commits enavled both pkill and kill to send an integer to
the killed or signalled process. The test_process now will report on the
integer if sent and the testsuite changes take advantage of this
new feature.

Another process make/destroy set had to be made as using spawn
instead of exec changes both the SID and TTY for the underlying
process, making other tests fail.

References:
 commit 7d55409b82602dac540c011000c9c5abedb5158a
 commit 2b804a532a90a98bccc5255a728da9076a5e4f4f

5 years agopgrep: use sigqueue to pass value with the signal.
Arun Chandrasekaran [Sat, 25 Apr 2020 03:15:06 +0000 (13:15 +1000)]
pgrep: use sigqueue to pass value with the signal.

Based on the command line option, use 'sigqueue'
instead of 'kill' to pass the integer value with
the signal.

References:
 procps-ng/procps!32

Signed-off-by: Craig Small <csmall@dropbear.xyz>
5 years agokill: Adjust documentation for sigqueue
Craig Small [Fri, 24 Apr 2020 09:29:34 +0000 (19:29 +1000)]
kill: Adjust documentation for sigqueue

Added NEWS item
Changed the section for sigqueue as its 3 for me.

5 years agokill: use sigqueue to pass value with the signal.
Arun Chandrasekaran [Fri, 24 Apr 2020 09:22:47 +0000 (19:22 +1000)]
kill: use sigqueue to pass value with the signal.

New -q/--queue option for kill so it will send an integer to the
signalled process. See sigqueue(3) for details.

References:
 https://pubs.opengroup.org/onlinepubs/009695399/functions/sigqueue.html
 procps-ng/procps!32

Signed-off-by: Craig Small <csmall@dropbear.xyz>
5 years agoINSTALL.md: Replace blockquotes with code blocks
Wieland Hoffmann [Fri, 17 Apr 2020 09:50:46 +0000 (09:50 +0000)]
INSTALL.md: Replace blockquotes with code blocks

The previous syntax (`> `) is for blockquotes, which don't keep newlines when
rendered. Codeblocks (` ` at the beginning of the line) do.

5 years agofree: Adjust space to really use 9 chars
Craig Small [Fri, 24 Apr 2020 07:42:58 +0000 (17:42 +1000)]
free: Adjust space to really use 9 chars

@steffhip found that while the translation hint said use 9 characters in
the free headers, it really was only 7.

Currently each line is constructed with the following (in non wide format):
Header + 6 Columns.  The header takes 7 characters and each column is 11
characters wide and prefixed with one space. Thus we have
7 + (1 + 11) * 6 = 79 characters for each line

By dropping the leading space for the first column after the header -the
header is already terminated by a colon- one could indeed provide the needed
9 letters for the header and thus have 9 + 11 * 1 + (1 + 11) * 5 = 80 Chars
per line which would fit into one line.

5 years agoMerge branch 'utoddl/procps-master'
Craig Small [Fri, 24 Apr 2020 07:29:08 +0000 (17:29 +1000)]
Merge branch 'utoddl/procps-master'

References:
 procps-ng/procps!78

5 years agoFix user and group name to number conversion for uid/gid above 2^31.
Todd Lewis [Mon, 29 Oct 2018 18:33:48 +0000 (18:33 +0000)]
Fix user and group name to number conversion for uid/gid above 2^31.

5 years agotop: updated man page and copyright dates to year 2020
Jim Warner [Wed, 15 Apr 2020 05:00:00 +0000 (00:00 -0500)]
top: updated man page and copyright dates to year 2020

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agolibrary: adapted to the latest lxc conventions (again)
Jim Warner [Tue, 14 Apr 2020 05:00:00 +0000 (00:00 -0500)]
library: adapted to the latest lxc conventions (again)

Well, shit! With release 4.0 on March 25th the lxc/lxd
folks have stuck it to us once again. They changed the
cgroup lxc prefix used to identify the container name.

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agoNEWS: Add item for previous entry
Craig Small [Fri, 10 Apr 2020 04:47:32 +0000 (14:47 +1000)]
NEWS: Add item for previous entry

Added NEWS item for pidof show worker threads patch

References:
 commit 9c3296bae97a6862d716b2a74f0ef3b76b061d7c

5 years agoMerge branch 'jrybar/procps-pidof-show-worker-pids'
Craig Small [Fri, 10 Apr 2020 04:45:28 +0000 (14:45 +1000)]
Merge branch 'jrybar/procps-pidof-show-worker-pids'

References:
 procps-ng/procps!101

5 years agopidof: show worker threads
Jan Rybar [Tue, 7 Apr 2020 11:41:48 +0000 (13:41 +0200)]
pidof: show worker threads

Reimplementation of pidof for procps toolset contains sort of deactivated code and does not return results for processes without task.cmdline entry (usually kernel worker threads). Old pidof and pgrep do that in comparison. Despite all perks provided by using pgrep instead, pidof should show those workers again.

5 years agoNEWS: fix top alpha order, add 'e' command line switch
Jim Warner [Sun, 29 Mar 2020 05:00:00 +0000 (00:00 -0500)]
NEWS: fix top alpha order, add 'e' command line switch

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: for symmetry with 'E' add 'e' command line switch
Jim Warner [Sun, 29 Mar 2020 05:00:00 +0000 (00:00 -0500)]
top: for symmetry with 'E' add 'e' command line switch

Several years after the 'e' & 'E' interactive commands
were introduce to affect memory scaling, an 'E' switch
was added. This was after discovering a dropped Redhat
patch which provided a unique 'M' command line switch.

If only for symmetry it makes sense to offer a similar
command switch ('e') for the Task Area memory scaling.

As was true with 'E', top's help text will show 'e' as
if it were a switch without arguments in order to keep
help text displayed without wrap in an 80x24 terminal.
The man page, however, will show all of the arguments.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/165
. 03/2017, added 'E' command line switch
commit fb48b5d9fb7a8256ae6b99fd5f7ac9855aa2481d
. 12/2012, added 'e' interactive command
commit 21e550bc080eb30f503b2ca6fe4e9cb12b8a1616
. 12/2012, added 'E' interactive command
commit bc46f67f9a63c9f43c9a697b3bfa85abf721c5da

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agops: eliminated inadvertent trailing double semi-colons
Jim Warner [Tue, 10 Mar 2020 05:00:00 +0000 (00:00 -0500)]
ps: eliminated inadvertent trailing double semi-colons

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: eliminate inadvertent trailing double semi-colons
Jim Warner [Tue, 10 Mar 2020 05:00:00 +0000 (00:00 -0500)]
top: eliminate inadvertent trailing double semi-colons

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agodocs: Mention stime in ps.1
Craig Small [Tue, 7 Apr 2020 09:35:27 +0000 (19:35 +1000)]
docs: Mention stime in ps.1

References:
 procps-ng/procps#164

5 years agoNEWS: Fix location of sysctl update
Craig Small [Thu, 27 Feb 2020 11:03:12 +0000 (22:03 +1100)]
NEWS: Fix location of sysctl update

The previous commit put the sysctl directory order entries in
the wrong place.

5 years agosysctl: config directory order
Craig Small [Thu, 27 Feb 2020 10:56:13 +0000 (21:56 +1100)]
sysctl: config directory order

Matches the systemd directory order (/run is after /etc) and
document what directories are used better.

5 years agotop: restore configuration file backward compatibility
Jim Warner [Sat, 15 Feb 2020 06:00:00 +0000 (00:00 -0600)]
top: restore configuration file backward compatibility

The Debian bug referenced below has nothing to do with
locales. In fact, top was made locale independent back
in release 3.3.13 (April, 2018). However, that bug did
reveal some misplaced logic which this patch corrects.

Prompted by the Qualys audit, all rcfile field strings
were checked for potential duplicates which could only
have resulted from some user's manual/malicious edits.

Unfortunately, that code was executed before top had a
chance to enforce the proper/maximum string length (in
the event an extremely old rcfile had just been read).
This created some potential string overrun references.

In top's original 3.3.15 implementation, the potential
overrun extended for 15 characters. That is the number
of field characters added with 3.3.9 (December, 2013).
But, since strchr() was used, no error exit was taken.

In the revised 3.3.16 implementation, the strchr() was
replaced with '&w->rc.fieldscur[n]'. This held overrun
to a single position while producing an error message.

So, this commit just moves that logic to a point where
fieldscur is guaranteed to be longer than EU_MAXPFLGS.

Reference(s):
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=951335
. revised 3.3.16 validation logic
commit 291d98ee5036567f93d21bc11142b0a7e2ee70ae
. original 3.3.15 validation logic
commit fdb58974e24c025a1f866f324c62f1d8f96234f8

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: restore one line of code to sig_endpgm() function
Jim Warner [Wed, 22 Jan 2020 06:00:00 +0000 (00:00 -0600)]
top: restore one line of code to sig_endpgm() function

When that potential abend at program end was addressed
in the patch shown below, one line of code was removed
in error. That line served to suppress some end-of-job
reports should ATEOJ_RPTSTD or ATEOJ_RPTHSH be active.

So, this patch restores that previously deleted logic.

Reference(s):
. potential SEGV fix, master branch
commit d37f85c269fbb6e905802ffdbce0ba4173ba21a9

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agoNEWS: Add missing pgrep note
Craig Small [Thu, 6 Feb 2020 11:09:56 +0000 (22:09 +1100)]
NEWS: Add missing pgrep note

5 years agops: for abnormal end allow core dumps (fix qualys bug)
Jim Warner [Sat, 4 Jan 2020 06:00:00 +0000 (00:00 -0600)]
ps: for abnormal end allow core dumps (fix qualys bug)

A Qualys audit patch, represented in the commit below,
added the _exit() call to our abnormal signal handler.
Unfortunately, that disabled the associated core dump.

This patch restores expected behavior of those signals
whose default produces a core dump file + termination.

Reference(s):
commit 2e4a59422104ed7fa5502874f9076b8118edd6a8

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: at abnormal end allow core dumps (fix qualys bug)
Jim Warner [Fri, 3 Jan 2020 06:00:00 +0000 (00:00 -0600)]
top: at abnormal end allow core dumps (fix qualys bug)

A Qualys audit patch, represented in the commit below,
added the _exit() call to our abnormal signal handler.
Unfortunately, that disabled the associated core dump.

This patch restores expected behavior of those signals
whose default produces a core dump file + termination.

Reference(s):
commit 0847390b8335c1747a3ea0944123b2f594251bc0

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: reposition some data due to a translation comment
Jim Warner [Thu, 2 Jan 2020 05:00:00 +0000 (00:00 -0500)]
top: reposition some data due to a translation comment

In a translator hint, under a caution, a reference was
made to the "next three items". Unfortunately however,
there was one intervening 'item' to which that caution
did not apply. This commit just relocates that 'item'.

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: whack insidious bug surrounding auto-sized fields
Jim Warner [Wed, 1 Jan 2020 05:00:00 +0000 (00:00 -0500)]
top: whack insidious bug surrounding auto-sized fields

This commit duplicates a change to that newlib branch.
However, it should be noted that such a change was not
really necessary under this master branch since proc_t
data remains valid much longer. It is being duplicated
here as documentation only. Below is the original msg.

------------------------------------------------------
This patch will eliminate a bug which is unique to our
newlib branch. It's extremely rare and only happens if
a search ('L'/'&') is initiated during the period when
fields are currently being auto-sized (AUTOX_MODE on).

This bug surfaces as either all zero results for tasks
displayed or a segmentation fault, depending upon what
fields were activated. It is caused by the timing of a
call to the <pids> 'reset' function. When called after
a task refresh, but before do_key(), this bug appears.

So this patch just ensures that 'reset' will be called
after do_key() & before the tasks have been refreshed.
------------------------------------------------------

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agopgrep: check sanity of SC_ARG_MAX
Craig Small [Sun, 5 Jan 2020 04:05:55 +0000 (15:05 +1100)]
pgrep: check sanity of SC_ARG_MAX

A kernel change means we cannot trust what sysconf(SC_ARG_MAX)
returns. We clamp it so its more than 4096 and less than 128*1024
which is what findutils does.

References:
 procps-ng/procps#152
 https://git.savannah.gnu.org/cgit/findutils.git/tree/lib/buildcmd.c#n535
 https://lwn.net/Articles/727862/

5 years agov3.3.16 release v3.3.16
Craig Small [Sun, 8 Dec 2019 04:06:03 +0000 (15:06 +1100)]
v3.3.16 release

5 years agolibrary: Adjust version for release
Craig Small [Sun, 8 Dec 2019 03:56:53 +0000 (14:56 +1100)]
library: Adjust version for release

Previous release incremented the age instead of incrementing the
revision. The age can only increment if revision (internal changes
only) or current (API changes) also increments.

A C:R:A of 8.0.2 means its the latest revision of 8.0 library and
any binary linked against 8.0 will work. This is our third revision
of the 8.0 library.

References:
 https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html

5 years agonls: sync translations with make diatcheck
Craig Small [Sun, 8 Dec 2019 03:44:07 +0000 (14:44 +1100)]
nls: sync translations with make diatcheck

5 years agobuild-sys: update man translation makefile
Craig Small [Thu, 28 Nov 2019 10:53:43 +0000 (21:53 +1100)]
build-sys: update man translation makefile

This is based upon the Makefile.am for psmisc

5 years agodocs: more Makefile updates
Craig Small [Tue, 12 Nov 2019 10:15:33 +0000 (21:15 +1100)]
docs: more Makefile updates

The install target was using the wrong directory and would throw
some errors where a language couldn't translate man pages. This
one should be hopefully more robust.

5 years agodocs: Update translations
Craig Small [Mon, 11 Nov 2019 10:52:21 +0000 (21:52 +1100)]
docs: Update translations

Downloaded the updated translations of the binaries and the manpages
from translation project. Then fixed the typos that caused po4a to
fail, mainly errant spaces.

5 years agobuild-sys: Use po4a for manpage translations
Craig Small [Mon, 11 Nov 2019 10:41:00 +0000 (21:41 +1100)]
build-sys: Use po4a for manpage translations

Using the newer po4a tool for manpage translations. Also removing
the manpage po file update from dist target because it should be
something the is explicitly done.

The git repository will hold the original man pages and the
po translation files. The distribution tarball will hold those
and the translated manpages. This means most people won't need po4a
as the distribution fill will have these translated manpages.

5 years agobuild-sys: Install translated manpages
Craig Small [Thu, 31 Oct 2019 09:48:15 +0000 (20:48 +1100)]
build-sys: Install translated manpages

References:
 procps-ng/procps#146

5 years agodocs: skill.1 - Remove trailing ^Z
Craig Small [Thu, 31 Oct 2019 03:24:17 +0000 (14:24 +1100)]
docs: skill.1 - Remove trailing ^Z

skill.1 man page had trailing ^Z which cause the translation
engine all sorts of problems.

5 years agonls: minor reference updates
Craig Small [Mon, 28 Oct 2019 20:59:15 +0000 (07:59 +1100)]
nls: minor reference updates

5 years agonls: Add all man pages to pot file
Craig Small [Mon, 28 Oct 2019 20:48:50 +0000 (07:48 +1100)]
nls: Add all man pages to pot file

The previous Makefile rule would only put the first required file
into the pot file because it used $< Unfortunately, due to how
po4a tools work, its not just a simple matter of changing it to $^
and you're done, but needs a foreach loop to add -m to each manpage
file.

This is a temporary fix, after some more work looking into po4a the
unified tool (called po4a) will be used.

5 years agotop: update copyright notations & fix a man page error
Jim Warner [Sun, 13 Oct 2019 05:00:00 +0000 (00:00 -0500)]
top: update copyright notations & fix a man page error

Beyond the copyrights, the single oops in the man page
was introduced in the commit which is referenced below
dealing with some cleanup following that Qualys audit.

Reference(s):
. man page error introduced
commit e531c781401ab76ff0c1834c6e40d5c440bdb8e4

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agosnice: Fix matching on PID
Craig Small [Mon, 21 Oct 2019 21:14:35 +0000 (08:14 +1100)]
snice: Fix matching on PID

@MarsChan correctly pointed out that the read() always returns 128
bytes, so skipping on >= 128 will always mean we skip. Their suggestion
was to remove the equality, but read will never go past 128 bytes so
I just removed that part of the check.

References:
 procps-ng/procps!89

5 years agoMerge branch 'ylecuyer/procps-patch-1'
Craig Small [Sat, 21 Sep 2019 07:08:53 +0000 (17:08 +1000)]
Merge branch 'ylecuyer/procps-patch-1'

References:
  procps-ng/procps!86

5 years agotop: fix out-of-band read when using -p with exactly 20 pids
Yoann Lecuyer [Fri, 2 Aug 2019 22:19:57 +0000 (22:19 +0000)]
top: fix out-of-band read when using -p with exactly 20 pids

5 years agoMerge branch 'cbaenziger/procps-pgrep_more_than_4k'
Craig Small [Sat, 21 Sep 2019 06:43:50 +0000 (16:43 +1000)]
Merge branch 'cbaenziger/procps-pgrep_more_than_4k'

References:
 procps-ng/procps!85

5 years agotestsuite: pgrep: Provide test for matching a more than 4k command line; beware as...
Clay Baenziger [Sat, 3 Aug 2019 09:58:18 +0000 (05:58 -0400)]
testsuite: pgrep: Provide test for matching a more than 4k command line; beware as TCL does not seem to match on strings >4k

5 years agopgrep: Use POSIX _SC_ARG_MAX for maximum full command line length
Clay Baenziger [Sun, 28 Apr 2019 22:17:42 +0000 (18:17 -0400)]
pgrep: Use POSIX _SC_ARG_MAX for maximum full command line length

5 years agopidof: Fix separator option
Craig Small [Sat, 21 Sep 2019 06:17:05 +0000 (16:17 +1000)]
pidof: Fix separator option

Short separator option used 's' instead of 'S' which
meant it pidof would use the single-shot option when you
meant separator.

Added alias for -S using -d to give some sysvinit pidof
compatibility.

References:
    commit 73492b182dc60c1605d1b0d62de651fad97807af
    procps-ng/procps#141

5 years agowatch: fix unsetting of COLOR flag
Craig Small [Sat, 21 Sep 2019 06:03:28 +0000 (16:03 +1000)]
watch: fix unsetting of COLOR flag

watch used to check if COLOR was required, check if color was
possible then.. set the flag again.

It should have been cleared after failing to get colors out of
ncurses.

References:
 procps-ng/procps#143

5 years agosysctl: ignore errors from lines starting with -
Craig Small [Sat, 21 Sep 2019 05:50:53 +0000 (15:50 +1000)]
sysctl: ignore errors from lines starting with -

The systemd sysctl ignores errors from preload files that start
with a hyphen.  This change brings the procps sysctl into line with
their change.

References:
    procps-ng/procps#138
    https://github.com/systemd/systemd/pull/13191
    https://github.com/systemd/systemd/pull/13141

5 years agoNEWS: add a new item (top), fix one other item (pgrep)
Jim Warner [Fri, 16 Aug 2019 05:00:00 +0000 (00:00 -0500)]
NEWS: add a new item (top), fix one other item (pgrep)

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: avoid a potential SEGV during program termination
Jim Warner [Tue, 6 Aug 2019 05:00:00 +0000 (00:00 -0500)]
top: avoid a potential SEGV during program termination

The backtrace shown in the bug report referenced below
illustrates a 'normal' program termination interrupted
with some signal, ultimately then causing a top crash.

So this commit just rearranges a little code such that
all signals will be blocked during that rather lengthy
end of program processing regardless of how initiated.

[ in that report, ignore the assertion regarding the ]
[ '-n' option. it obviously was not '1' since do_key ]
[ had been called, which otherwise wouldn't be true. ]

[ and when it is '1' the -d option would be ignored. ]

Reference(s):
https://bugzilla.redhat.com/show_bug.cgi?id=1737552

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: tweak logic associated with keyboard translations
Jim Warner [Sat, 3 Aug 2019 05:00:00 +0000 (00:00 -0500)]
top: tweak logic associated with keyboard translations

This commit most significant change is the elimination
of the kbd_ENTER entry from that tinfo_tab in iokey().

That entry was a useless artifact left from the commit
which is shown below. It makes no sense to 'translate'
a keystroke into something it already was (i.e. '\n').

The remaining changes just reorder those table entries
for a progression consistent with vim keys: h,j,k & l.

Reference(s):
. fix 'iokey()' flaw preventing proper translations
commit 42f0a341ba5d3cbcd883bef538384ae705984bd9

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: standardize PgUp/PgDn management within task area
Jim Warner [Sat, 29 Jun 2019 05:00:00 +0000 (00:00 -0500)]
top: standardize PgUp/PgDn management within task area

This commit standardizes the behavior of the PgUp/PgDn
keys when on the main top display. With PgDn, the last
process will become the first process. With PgUp, that
first task will now appear as the last task displayed.

[ this also eliminates some quirks that were evident ]
[ when paging at or near the end of the process list ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
5 years agotop: attempt to provide missing xterm vim keys support
Jim Warner [Mon, 24 Jun 2019 05:00:00 +0000 (00:00 -0500)]
top: attempt to provide missing xterm vim keys support

A recent issue (and merge request) reminded me of gaps
in top's alternate 'vim' navigation keys support. Some
xterm emulators do not pass the customary strings when
keys were used with the <Ctrl> and/or <Alt> modifiers.

While it was a known problem, this issue/merge request
prompted research into the root cause. As it turns out
the problem is traceable to an X resource known by the
name 'eightBitInput'. When 'true' (the default), a key
pressed in combination with <Alt> will not be preceded
by the <Esc> character. Rather, a single character was
presented (modified via an 'eightBitMeta' X resource).

The following approaches would eliminate this problem:

. start xterm thus: xterm -xrm '*eightBitInput: false'

. use: ~/.Xresources with 'Xterm*eightBitInput: false'

. build xterm with 'configure --enable-meta-sends-esc'
( apparently used for CentOS, Fedora, openSUSE, etc. )

. enable xterm's menu via 'configure --enable-toolbar'
( so the user can set the 'Meta Sends Escape' option )

Of course, none of the above steps is desirable from a
user's perspective. So, this patch will add additional
entries to the iokey function's tinfo_tab to represent
strings passed when the <Alt> key does not send <Esc>.

[ hopefully they'll be the same across all platforms ]

Lastly, this patch will also eliminate those redundant
<Atl> + '\', '/', '<' & '>' provisions, which now seem
like overkill and suffer from that same 'eightBitMeta'
xterm problem. And we might as well say goodbye to the
4 '<Alt> + arrow key' table entries (which do not seem
to currently work with any emulator which I can find).

[ what in the world was I thinking way back in 2011? ]

Reference(s):
. issue
https://gitlab.com/procps-ng/procps/issues/135
. merge request
https://gitlab.com/procps-ng/procps/merge_requests/84

Signed-off-by: Jim Warner <james.warner@comcast.net>
6 years agolibrary: tweak that lxc container support a final time
Jim Warner [Wed, 13 Feb 2019 06:00:00 +0000 (00:00 -0600)]
library: tweak that lxc container support a final time

Since the patch referenced below traded a compile-time
'sizeof' directive for a run-time 'strlen' call, there
is no need to declare lxc patterns as explicit arrays.

We'll also use the actual lxc patterns by omitting the
beginning slashes ('/') for both of those definitions.

And, looking to the future when most/all lxc users are
using the most recent lxc release, we will make things
slightly more efficient by reversing those two pattern
literals so the most recent pattern was checked first.

Of course, such a change only benefits tasks which are
running in a container. For the majority of processes,
both literals will be compared in that 'if' statement,
assuming the 'LXC' field is currently being displayed.

[ plus, a leftover parenthesis pair has been removed ]

Reference(s):
commit f67127e7288879d54448ffbb63c7319835c02e91

Signed-off-by: Jim Warner <james.warner@comcast.net>
6 years agotop: just correct a couple of misspellings in comments
Jim Warner [Fri, 1 Feb 2019 06:00:00 +0000 (00:00 -0600)]
top: just correct a couple of misspellings in comments

Signed-off-by: Jim Warner <james.warner@comcast.net>
6 years agomisc: update for pgrep runstate
Craig Small [Mon, 4 Mar 2019 20:59:48 +0000 (07:59 +1100)]
misc: update for pgrep runstate

Added some minor fixes and notes

6 years agoMerge branch 'edneville/procps-issue_109_match_state'
Craig Small [Mon, 4 Mar 2019 20:55:01 +0000 (07:55 +1100)]
Merge branch 'edneville/procps-issue_109_match_state'

References:
 https://bugs.debian.org/919381
 procps-ng/procps!81

6 years agopgrep.c: Match based on process run state for issue 109
ed [Thu, 3 Jan 2019 22:34:14 +0000 (22:34 +0000)]
pgrep.c: Match based on process run state for issue 109

6 years agoMerge branch 'pks-t/procps-pks/sysctl-handle-close-errors'
Craig Small [Mon, 4 Mar 2019 10:46:18 +0000 (21:46 +1100)]
Merge branch 'pks-t/procps-pks/sysctl-handle-close-errors'

References:
 procps-ng/procps!65

6 years agosysctl: do not report set key in case `close_stream` fails
Patrick Steinhardt [Tue, 29 May 2018 11:29:03 +0000 (13:29 +0200)]
sysctl: do not report set key in case `close_stream` fails

As we're using buffered I/O when writing kernel parameters, write errors
may get delayed until we close the `FILE` stream. As we are currently
outputting the key that is to be set disregarding the return value of
`close_stream`, we may end up in a situation where we report error and
success:

    $ sysctl kernel.printk_ratelimit=100000000000000
    sysctl: setting key "kernel.printk_ratelimit": error code 22
    kernel.printk_ratelimit = 100000000000000

Fix the issue by only outputting the updated value in case
`close_stream` does not report an error.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
6 years agoprocio: fix potential out-of-bounds access when write fails
Patrick Steinhardt [Tue, 29 May 2018 11:20:00 +0000 (13:20 +0200)]
procio: fix potential out-of-bounds access when write fails

When writing to procfs via `proc_write` fails, we try to chunk the
buffer into smaller pieces to work around that issue. When searching for
the next location to split the buffer, though, we can underflow the
buffer in case the current offset is smaller than `LINELEN`. Fix the
issue by passing `cookie->offset` instead of `LINELEN` into `memrchr` in
case `cookie->offset` is smaller than `LINELEN`.

This bug can be triggered on musl-based systems, e.g. by executing

    $ sysctl kernel.printk_ratelimit=1000000000000000

As the value is out-of-range, `write` will return an error and set
`errno` to `EINVAL`. As we're only trying to write a smallish buffer
with a length smaller than `LINELEN` and as the buffer does not contain
any newlines, the call

    token = (char*)memrchr(cookie->buf+offset, '\n', LINELEN);

will underflow the buffer and crash the program.

Signed-off-by: Patrick Steinhardt <ps@pks.im>