Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2161

Solaris: Processes with large memory usage triggers ps misparsing due to missing spaces between numbers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.9.0
    • Labels:
      None
    • Story Points:
      13

      Description

      The currently used ps command on Solaris is:

      ps auxww
      

      This command has the problem that when the size numbers overflow, they bleed into the next column, and it becomes difficult to separate them because of missing whitespace.

      It is possible to replace this command with:

      ps -eo user,pid,pcpu,pmem,osz,rss,tty,s,stime,time,args

      which doesn't have the mentioned problem. However, it triggers a different problem, that the fields may no longer be directly under their heading, and the ps parser is unable to cope with that. AFAICS, the output is always consistent, iow the space between fields will always be present in this mode, so my suggestion is to make the parser count the fields instead of measuring where they are relative to the heading. This needs changes to the parser itself though, and has to be configurable per platform, since other platforms may not obey this.

      Here is an example of the problem described above:

      USER       PID %CPU %MEM   SZ  RSS TT       S    START  TIME COMMAND
      root      5821  0.2  2.0231488160360 ?        S   Sep 28 326:05 java
      

      On our own Solaris server it can usually be seen by looking for the Jenkins java process, which often causes the overflow.

      An additional caveat to look out for is that Solaris must not revert to using /bin/ps due to Redmine #3974. Currently it's using /usr/ucb/ps where available.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10040 Kristian Amlie
                Reporter:
                a10040 Kristian Amlie
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel