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

James Valente dev at zupercomputer.net
Sat Jun 17 00:55:18 CEST 2006


I'm glad the detailed information was helpful.

I want to report back the results of the change.  I replaced the 
original disk.c file in version 3.9.2 with the version taken from 
subversion repository, and then recompiled.  No problems.

I then ran the load test utility, watching the read_sectors and 
write_sectors values progress from 0 to 2G, and eventually to 4G.  Once 
it reached 4G sectors, the kernel then rolls the counter back to 0. 
Collectd correctly logged the read and write sectors values throughout 
the entire cycle, and had no problem with the rollover of the counter 
back to 0.  Again, no problems here.

So, everything worked fine.  Thanks again.


Florian Forster wrote:

> 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 ;)
> Regards,
> -octo
>>antispam signature key:  a0b7b92f29276f726b2741205caf799c
> No idea what this is, but I guess I'm supposed to include it in my
> reply..  ;)

antispam signature key:  a0b7b92f29276f726b2741205caf799c

More information about the collectd mailing list