-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

All,

Changing the above code (with the fprintf's) from 0.99L to 0.99f makes
squid reliable on my system.

I can't claim to understand this code, but it seems that was a typo.
0.99L translates to integer "1" on gcc-3.3.5-3.  It looks like the
intention was to say "fail assertion if the function's value for zero
deviates significantly from zero", the idea being to add the output of
f(0) to 0.99f and see if it was >= 1.  Using 0.99L, which equals 1, it
would fail whenever the value was not negative.  In practice on my
system the value was (sometimes?) 0, so the assertion failed after 8
hours or so.

People probably don't notice it because squid gets automatically
restarted somehow.  Perhaps my brother is not the only person who does
not trust squid's reliability.

I will strip this change down to

- --- squid_2.5.9.orig/src/StatHist.c     2001-10-24 21:19:08.000000000
+1300
+++ squid-2.5.9/src/StatHist.c  2005-06-07 08:46:26.000000000 +1200
@@ -90,7 +90,7 @@
     /* a max value should go into the last bin */
     assert(statHistBin(H, max) == H->capacity - 1);
     /* it is hard to test val_out, here is a crude test */
- -    assert(((int) floor(0.99L + statHistVal(H, 0) - min)) == 0);
+    assert(((int) floor(0.99f + statHistVal(H, 0) - min)) == 0);
 }

and verify that this fixes it.


Steve

- ------ Log: Squid being reliable on my system for three days:

tui:/var/log/squid# cat cache.log
2005/06/07 06:33:17| storeDirWriteCleanLogs: Starting...
2005/06/07 06:33:21|   Finished.  Wrote 1992 entries.
2005/06/07 06:33:21|   Took 2.1 seconds ( 930.6 entries/sec).
2005/06/07 06:33:21| logfileRotate: /var/log/squid/store.log
tui:/var/log/squid# cat cache.log.1
2005/06/06 06:30:00| storeDirWriteCleanLogs: Starting...
2005/06/06 06:30:07|   Finished.  Wrote 2178 entries.
2005/06/06 06:30:07|   Took 4.6 seconds ( 474.0 entries/sec).
2005/06/06 06:30:07| logfileRotate: /var/log/squid/store.log
tui:/var/log/squid# zcat cache.log.2.gz
2005/06/05 06:34:12| storeDirWriteCleanLogs: Starting...
2005/06/05 06:34:23|   Finished.  Wrote 3422 entries.
2005/06/05 06:34:23|   Took 9.1 seconds ( 376.9 entries/sec).
2005/06/05 06:34:23| logfileRotate: /var/log/squid/store.log
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCpLja4nWub/+PLZsRAuH5AKCbeSwtpxXLYqgqd6YAyEIVOMqy/gCghmt/
RrTb9IlgAULCQF3OBrA7WME=
=wpR7
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to