bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

possible bug in cfenvd


From: Elizabeth Cassell
Subject: possible bug in cfenvd
Date: Mon, 30 Aug 2004 15:09:08 -0700 (PDT)

In cfenvd.c, at line 1508, in the function GetCurrentAverages(), I
noticed a strange thing happening:
The value of the field "expect_number_of_users" in the Averages struct
pointed to by value.data sometimes changes when dbp->close() is called.
To test this, I changed the code as follows (output from diff -Naur):
-----------------------------------------------------
@@ -1469,6 +1469,7 @@
   DBT key,value;
   DB *dbp;
   static struct Averages entry;
+  struct Averages temp;

 if ((errno = db_create(&dbp,NULL,0)) != 0)
    {
@@ -1504,6 +1505,11 @@
       return NULL;
       }
    }
+else
+{
+  memcpy(&temp, value.data, sizeof(temp));
+  fprintf(stderr, "%lf = ", temp.expect_number_of_users);
+}

 dbp->close(dbp,0);

@@ -1513,6 +1519,13 @@
 if (value.data != NULL)
    {
    memcpy(&entry,value.data,sizeof(entry));
+   fprintf(stderr, "%lf?\n", entry.expect_number_of_users);
+   if(temp.expect_number_of_users != entry.expect_number_of_users ||
+      temp.expect_rootprocs != entry.expect_rootprocs ||
+      temp.expect_otherprocs != entry.expect_otherprocs)
+     fprintf(stderr, "*** (%lf,%lf,%lf) CHANGED TO (%lf,%lf,%lf) ***\n",
+             temp.expect_number_of_users, temp.expect_rootprocs,
temp.expect_otherprocs,
+             entry.expect_number_of_users, entry.expect_rootprocs,
entry.expect_otherprocs);
    Debug("Previous values (%lf,..) for time index
%s\n\n",entry.expect_number_of_users,timekey);
    return &entry;
    }
-----------------------------------------------------

The output I got while running cfenvd -F with my changes was this:

5.600000 = 5.600000?
5.600000 = 5.600000?
5.600000 = 5.600000?
5.600000 = 5.600000?
5.600000 = 0.000000?
*** (5.600000,40.600000,21.700000) CHANGED TO
(0.000000,40.600000,21.700000) ***
5.600000 = 0.000000?
*** (5.600000,40.600000,21.000000) CHANGED TO
(0.000000,40.600000,21.000000) ***
5.600000 = 5.600000?
5.600000 = 5.600000?
5.600000 = 5.600000?
5.600000 = 5.600000?
5.600000 = 5.600000?
5.600000 = 6.397187?
*** (5.600000,40.600000,20.300000) CHANGED TO
(6.397187,40.600000,20.300000) ***
5.600000 = 6.397187?
*** (5.600000,40.600000,21.700000) CHANGED TO
(6.397187,40.600000,21.700000) ***
5.600000 = 0.000000?
*** (5.600000,40.600000,21.700000) CHANGED TO
(0.000000,40.600000,21.700000) ***
5.600000 = 0.000000?
*** (5.600000,40.600000,21.700000) CHANGED TO
(0.000000,40.600000,21.700000) ***

And it goes on, in clusters of about an hour of continuously working
correctly followed by an hour of consistantly changing just the
expect_number_of_users field.

I'm running this on Red Hat Enterprise Linux WS release 3 (Taroon Update
2), with gcc version 3.2.3, and Berkeley DB version 4.2.52.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]