Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] many versions of procps-ng fail to support "thcount" field (alias) #32

Closed
barsnick opened this issue Apr 26, 2020 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@barsnick
Copy link

barsnick commented Apr 26, 2020

Describe the bug
Processes are not listed when using procps-ng 3.3.10.

To Reproduce
Run bashtop.

Expected behavior
Process list is filled.

Screenshots

Info (please complete the following information):

  • Linux distribution and version:
    Fedora 27
  • System locale (output of "echo $LANG")
    en_US.UTF-8
  • Bash version
    $ echo $BASH_VERSION
    4.4.23(1)-release
    $ rpm -q bash
    bash-4.4.23-1.fc27.x86_64

Additional context

02:09:10 AM ERROR: On line 1529 
error: improper AIX field descriptor

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).

As described in #12:

Looking at the error.log there are indications of errors from output of "ps". Could be a version incompatibility there too, but if so, it will be fixed in the next big update where python psutil will be used instead.

As I just encountered this, I had a closer look. Debugging the ps command line, it turned out that my version of ps choked on the "thcount" format specifier.

This specifier is an alias for "nlwp". It seems it got lost in version 3.3.0 of procps-ng, and re-appeared in 3.3.12:
https://bugzilla.redhat.com/show_bug.cgi?id=1174313
https://gitlab.com/procps-ng/procps/-/blob/master/NEWS#L112
Commit breaking:
https://gitlab.com/procps-ng/procps/-/commit/0e6ac0db3e35fbf0eca0c02d09540ca6fb0ba77c
Commit fixing:
https://gitlab.com/procps-ng/procps/-/commit/3a52dfa340276a7f8f55af1b8267392ee48988b9
(That's five years, 12 versions "broken". Wow.)

"thcount" has always been an alias for "nlwp", since they were introduced in 3.1.15, so using "nlwp" instead is always guaranteed to work, and would fix the issue for procps-ng from 3.3.0 to 3.3.11. It works for me with patched bashtop + procps-ng 3.3.10.

@barsnick barsnick added the bug Something isn't working label Apr 26, 2020
@barsnick barsnick changed the title [BUG] some versions of procps-ng fail to support "thcount" field (alias) [BUG] many versions of procps-ng fail to support "thcount" field (alias) Apr 26, 2020
@aristocratos
Copy link
Owner

aristocratos commented Apr 26, 2020

(That's five years, 12 versions "broken". Wow.)

Yes, wow. Great find!
Will fix in next update and add 3.1.15 as required lowest version in dependencies.

@aristocratos
Copy link
Owner

fixed in v0.8.11

@barsnick
Copy link
Author

Nice, what a reaction!

There were actually three occurrences of "thcount" in bashtop code, now there are still two. ;-) I don't know what the other two do though, because at first glance, the one which was fixed seems sufficient for the launch of the program.

@aristocratos
Copy link
Owner

aristocratos commented Apr 26, 2020

You're right, missed that.
The other two occurrences are for sorting by threads and for getting info to detailed window. So would still have crashed in certain cases.
Fixed in v0.8.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants