Bug 1174313 - tgid addition to format_array disables thcount option
Summary: tgid addition to format_array disables thcount option
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: procps-ng
Version: 22
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Jaromír Cápík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-15 15:48 UTC by Filip Krska
Modified: 2016-07-19 20:29 UTC (History)
3 users (show)

Fixed In Version:
Clone Of: 1174311
Environment:
Last Closed: 2016-07-19 20:29:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Fix format array alphabetical order (6.80 MB, patch)
2016-03-03 12:12 UTC, Shivkrishna A
no flags Details | Diff

Description Filip Krska 2014-12-15 15:48:38 UTC
procps-ng-3.3.10-4.fc21.x86_64 reproduces as well (not fixed upstream)

+++ This bug was initially created as a clone of Bug #1174311 +++

Description of problem:

When `tgid` option was introduced and added to format_array[] wrongly after `thcount` record the latter option no longer can be specified as a parameter. The broken alphabetical order confuses the bsearch() function.

Version-Release number of selected component (if applicable):

procps-ng-3.3.10-3.el7.x86_64


How reproducible:

Always


Steps to Reproduce:
1. $ ps -o thcount


Actual results:

error: unknown user-defined format specifier "thcount"

Usage:
...

Expected results:

THCNT
    1
    1


Additional info:

Patch with fix proposal attached.
Please propagate to upstream as usual.

--- Additional comment from Filip Krska on 2014-12-15 10:46:45 EST ---

Comment 1 Jaroslav Reznik 2015-03-03 16:37:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 2 Shivkrishna A 2016-02-27 15:04:05 UTC
(In reply to Filip Krska from comment #0)
> procps-ng-3.3.10-4.fc21.x86_64 reproduces as well (not fixed upstream)
> 
> +++ This bug was initially created as a clone of Bug #1174311 +++
> 
> Description of problem:
> 
> When `tgid` option was introduced and added to format_array[] wrongly after
> `thcount` record the latter option no longer can be specified as a
> parameter. The broken alphabetical order confuses the bsearch() function.
> 
> Version-Release number of selected component (if applicable):
> 
> procps-ng-3.3.10-3.el7.x86_64
> 
> 
> How reproducible:
> 
> Always
> 
> 
> Steps to Reproduce:
> 1. $ ps -o thcount
> 
> 
> Actual results:
> 
> error: unknown user-defined format specifier "thcount"
> 
> Usage:
> ...
> 
> Expected results:
> 
> THCNT
>     1
>     1
> 
> 
> Additional info:
> 
> Patch with fix proposal attached.
> Please propagate to upstream as usual.
> 
> --- Additional comment from Filip Krska on 2014-12-15 10:46:45 EST ---

Hi, I would like to work on this bug, If you could guide me it would be of great help as this is the first bug .

Comment 3 Filip Krska 2016-02-28 10:09:00 UTC
Hi Shiva,

the fix for this bug is identified (in the original Bug #1174311 for RHEL 7) and patch is here:

https://bugzilla.redhat.com/attachment.cgi?id=969096

diff -up procps-ng-3.3.9/ps/output.c.format_array_sort procps-ng-3.3.9/ps/output.c
--- procps-ng-3.3.9/ps/output.c.format_array_sort	2014-12-15 13:15:05.603753166 +0100
+++ procps-ng-3.3.9/ps/output.c	2014-12-15 13:15:46.025714308 +0100
@@ -1717,8 +1717,8 @@ static const format_struct format_array[
 {"sz",        "SZ",      pr_sz,       sr_nop,     5,   0,    HPU, PO|RIGHT},
 {"taskid",    "TASKID",  pr_nop,      sr_nop,     5,   0,    SUN, TO|PIDMAX|RIGHT}, // is this a thread ID?
 {"tdev",      "TDEV",    pr_nop,      sr_nop,     4,   0,    XXX, AN|RIGHT},
-{"thcount",   "THCNT",   pr_nlwp,     sr_nlwp,    5,   0,    AIX, PO|RIGHT},
 {"tgid",      "TGID",    pr_procs,    sr_procs,   5,   0,    LNX, PO|PIDMAX|RIGHT},
+{"thcount",   "THCNT",   pr_nlwp,     sr_nlwp,    5,   0,    AIX, PO|RIGHT},
 {"tid",       "TID",     pr_tasks,    sr_tasks,   5,   0,    AIX, TO|PIDMAX|RIGHT},
 {"time",      "TIME",    pr_time,     sr_time,    8,   0,    U98, ET|RIGHT}, /*cputime*/ /* was 6 wide */
 {"timeout",   "TMOUT",   pr_nop,      sr_nop,     5,   0,    LNX, AN|RIGHT}, // 2.0.xx era

the remaining task is to process the fix release. If you want to help with the package maintaining part, perhaps this guide can help you:

https://fedoraproject.org/wiki/Join_the_package_collection_maintainers?rd=PackageMaintainers/Join

Comment 4 Shivkrishna A 2016-03-03 12:12:58 UTC
Created attachment 1132741 [details]
Fix format array alphabetical order

Comment 5 Fedora End Of Life 2016-07-19 20:29:42 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.