RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1322111 - RFC: ps can display misleading wchan data
Summary: RFC: ps can display misleading wchan data
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: procps
Version: 6.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Rybar
QA Contact: David Jež
Lenka Kimlickova
URL:
Whiteboard:
Depends On:
Blocks: 1269194 1356047 1359260 1373246
TreeView+ depends on / blocked
 
Reported: 2016-03-29 20:24 UTC by Paulo Andrade
Modified: 2020-09-10 09:34 UTC (History)
2 users (show)

Fixed In Version: procps-3.2.8-43.el6
Doc Type: Bug Fix
Doc Text:
"ps" no longer removes *do_* and *sys_* prefixes Prior to this update, the "ps" command removed *do_* and *sys_* prefixes from the wait channel name when the "wchan" format option was used. As a conseqence, this caused ambiguities in some kernel function names. The bug has been fixed, and as a result the "ps" command no longer removes *do_* and *sys_* prefixes.
Clone Of:
: 1373246 (view as bug list)
Environment:
Last Closed: 2017-03-21 11:40:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
wchan info stripping removed (1.04 KB, patch)
2016-11-23 13:12 UTC, Jan Rybar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0769 0 normal SHIPPED_LIVE procps bug fix update 2017-03-21 12:47:52 UTC

Description Paulo Andrade 2016-03-29 20:24:02 UTC
procps and procps-ng in rhel7 apparently try to output a
"prettier" output for the wchan data.

  The code basically does this:

proc/ksym.c:read_wchan() and lookup_wchan() (but the later
should not be used)
[...]
  if(*ret=='.') ret++;
  switch(*ret){
    case 's': if(!strncmp(ret, "sys_", 4)) ret += 4;   break;
    case 'd': if(!strncmp(ret, "do_",  3)) ret += 3;   break;
    case '_': while(*ret=='_') ret++;                  break;
  }
[...]

  The problem is that there are common cases where stripping
the "do_" or "sys_" may cause one to think that it is referring
to a completely different code.
  The /proc/$pid/wchan contents are still correct.

  This is a RFC because if outputting the /proc/$pid/wchan
contents, while "truly" correct, most likely would print
mostly "do_" and "sys_" strings in a 6 characters field,
unless using options to print in a larger column.

  Maybe there could be a flag to not remove the prefix if
"-o wchan" is passed in the command line.

Comment 2 Jan Rybar 2016-07-20 15:33:20 UTC
Hello Paulo,
I don't understand "completely different code" in "...may cause one to think that it is referring to a completely different code."

Can you please be more verbose what ambiguity this part of lookup_wchan() might cause?

I listed all occurrences of "sys_" and "do_" in all wchan files in /proc and I didn't encounter anything suspicious. Tried on RHEL6 and RHEL7.

Comment 3 Paulo Andrade 2016-07-20 16:28:01 UTC
  Hi Jan,

  The comment was due the reason the bug report was opened,
where ps was showing "get_write_access", that is a generic
function in the VFS layer, that locks an inode, while it
actually was in "do_get_write_access", that is a jbd2
function.
  Part of the problem is that there is no real rules about
function naming, that would say that "sys_" is a prefix for
syscalls, or "do_" is an actual implementation of a syscall.

Comment 4 Jan Rybar 2016-07-20 16:50:40 UTC
Thank you Paulo,

this looks like a good proposal to discuss with upstream.

Comment 12 Jan Rybar 2016-11-23 13:12:08 UTC
Created attachment 1223222 [details]
wchan info stripping removed

Introduced new better patch to fix the issue and stay aligned with upstream. Stripping prefixed from wchan data was removed, since it led to ambiguities and the purpose of the feature is untraceable.

Comment 15 Jan Rybar 2017-01-03 14:15:24 UTC
Doc note:
Since stripping of "do_" and "sys_" was removed completely, formerly proposed "wchanf" option was discarded (no longer needed). This is aligned with upstream.

Comment 17 errata-xmlrpc 2017-03-21 11:40:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0769.html


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