[collectd] possible bug in disk.c module - value overflow

Florian Forster octo at verplant.org
Wed Jun 14 11:51:36 CEST 2006

Hi James,

On Tue, Jun 13, 2006 at 11:41:34AM -0700, James Valente wrote:
> I want to report a possible bug in the disk.c module.  I am not
> exactly sure what is causing it.

thanks for reporting this bug and providing so much information, it
really helped debugging this :)

The problem was that the counter-values were red using `atoi' which
returns `LONG_MAX' when the value being read is too big for an integer.
On a 32bit system that's `2,147,483,647'. So when your `write sectors'
counter went from `2,146,843,980' to `2,152,430,156' collectd started
logging `LONG_MAX' again and again. For a counter the same value means
`no change', i.e. zeroes all the way.

The bug is fixed with revision 823 in the `disk-linux' branch. To test
it checkout [1] or simply copy [2] to `src/' and recompile. After that
you should be able to transfer more than 2TByte (that's when the 32 bit
boundary bites).
[1] https://subversion.verplant.org/collectd/branches/disk-linux
[2] http://subversion.verplant.org/collectd/branches/disk-linux/src/disk.c

Please let me know if this fix worked for you or if my debugger lied to
me ;)


> antispam signature key:  a0b7b92f29276f726b2741205caf799c
No idea what this is, but I guess I'm supposed to include it in my
reply..  ;)
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20060614/cc67c4a1/attachment.pgp

More information about the collectd mailing list