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

"ps output line ... is shorter than its associated header"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: 3.10.3
    • Fix Version/s: None
    • Component/s: cf-agent
    • Labels:
      None
    • Platform:
      RHEL or CentOS

      Description

       RHEL 7.6

      cfengine-community 3.10.3

      CFEngine log files and emails for a small number of our clients have:

      ps output line '...' is shorter than its associated header
      

      Correspondingly the "-v" output from "cf-agent" has:

      -----------

      verbose: C: BEGIN classes / conditions (pass 1)
      verbose: Observe process table with /bin/ps -eo user,pid,ppid,pgid,pcpu,pmem,vsz,ni,rss:9,nlwp,stime,etime,time,args
      error: ps output line 'user-id  35911      1   8597  0.0  0.0 123668   0      2504    2 Mar11  2-22:28:49 00:00:00' is shorter than its associated header
      

      -----------

      (I've gently obfuscated the user-id.)

      Running that quoted 'ps' command manually and scanning the output, I see:

      -----------

      user-id  35772      1   8597  0.0  0.3 1022928  0     54292    5 Mar11  2-22:32:59 00:00:48 kleopatra
      user-id  35905      1   8597  0.0  0.0 782440   0      6144    5 Mar11  2-22:32:04 00:00:28  /etc/speech-dispatcher/modules//espeak.conf
      user-id  35911      1   8597  0.0  0.0 123668   0      2504    2 Mar11  2-22:32:04 00:00:00
      user-id  35913      1  35913  0.0  0.0  94272   0       952    2 Mar11  2-22:32:04 00:00:00 /usr/bin/speech-dispatcher
      

      -----------
      Note that pid 35911 lacks any command-line information ("args").
      As an associated observation (clearer in a monospaced font) pid 35905 has two spaces, rather than a single space, separating the end of the time, 00:00:28, from the args, "/etc/speech...".  This is probably irrelevant.

      Our calling bundle is doing a 'processexists("...")'.

      It would seem that when "cf-agent" is internally invoking a 'ps' command, the processing of the output is not cleanly allowing for an empty "args" result (our pid 35911).

      This seems to be a bug.  (A quick Google search indicates that something similar has been seen a few years ago in AIX and Solaris: CFE-2446 and CFE-2161.)  But we are RHEL7.6  Any thoughts?

      Of course, this prompts again the thought about whether all this could be much more cleanly handled on OSes that support "/proc", relegating the "ps" mechanism to those few OSes that lack "/proc": CFE-1655.  But that is probably another story for another time...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                davidlee David Lee
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel