Hi,

I faced a problem of integer overflow with a 32 bits version of gmond.
In the libmetrics/linux/metrics.c file, the total_jiffies_func function
works with unsigned long variables (4 bytes).
The problem is I got some values greater than 2^32 in my /proc/stat file
which lead to integer overflows and wrong values reported.
The other functions cpu_*_func work with double variables (8 bytes). So I
provide a patch that change the total_jiffies_func to work with double
variables.
Actually, if the program is build in 64 bits mode there is no problem as an
unsigned long is 8 bytes.

This simple trick should work for the cygwin version too.

Yannick

Attachment: total_jiffies_func.patch
Description: Binary data

Reply via email to