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

cf-report and malformed data in histograms

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: cf-monitord
    • Labels:
      None

      Description

      With the latest stable tarball (3.4.1), I get the following error:

      [root@arborea ~]# /usr/sbin/cf-report -f reporter_html.cf ; echo $?
      Fatal CFEngine error: Malformed data found in /var/cfengine/state/historgrams, line 2
      1

      An older version (say, 3.3.3), does have not have this problem:

      [root@arborea ~]# cf-report --version
      @@@ cf-report
      [...]
      @ @@@ @ CFEngine Core 3.3.3
      [root@arborea ~]# /usr/sbin/cf-report -f reporter_html.cf ; echo $?

      The critical change appears to be from Sep 28th:

      commit ff40e061af67e18c3535390022c2b323d37c3efa
      Author: Mikhail Gusarov <mikhail.gusarov@cfengine.com>
      Date: Fri Sep 28 17:34:03 2012 +0200

      Protect against malformed data in histograms (Redmine #1080)

      diff --git a/src/cf-report.c b/src/cf-report.c
      index 8ffd88b..dc31440 100644
      — a/src/cf-report.c
      +++ b/src/cf-report.c
      @@ -2490,7 +2490,12 @@ static void WriteHistograms()

      for (position = 0; position < CF_GRAINS; position++)
      {

      • fscanf(fp, "%d ", &position);
        + int position_read;
        + fscanf(fp, "%d ", &position_read);
        + if (position != position_read)
        + { + FatalError("Malformed data found in %s/state/historgrams, line %d", CFWORKDIR, position + 1); + }

      for (i = 0; i < CF_OBSERVABLES; i++)
      {

      If the histogram generation changed in some fashion, I'm unable to find any documentation. So I'm not really sure if it's the histogram that changed (and is no malformed), or if has always been malformed and now it's caught.

      Also note typo in error string 'historgram'.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              leskomw@mail.nih.gov Matt Lesko
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel