[collectd] Integer overflow in curl_json plugin
octo at verplant.org
Tue Jul 13 14:12:37 CEST 2010
On Tue, Jun 22, 2010 at 04:00:10PM -0700, Garret Heaton wrote:
> The error in the collectd log:
> curl_json plugin: yajl_parse failed: parse error: integer overflow
> #012 ct_running":false,"disk_size":2226049133,"instance_start_tim
> #012 (right here) ------^
> The plugin uses the yajl  library for parsing json and is currently
> making use of its integer and double callbacks. Apparently if the
> number callback is used it'll use that for all numeric data. Is there
> a way for collectd to capture the data in this way and use it in a
> meaningful way (convert to a different unit, use a "wrapped around"
> counter type, etc)? Or is the only option to use a 64-bit machine for
> the collectd server?
actually, using the "number" callback here is much nicer. By the time it
is called, the "type" of the data set has already been determined and we
can parse the number accordingly as double, int64_t or uint64_t.
I've implemented a patch which you can find in the "collectd-4.9" branch
of my Git repository . It'd be great if you could test it.
"disk_size" sounds a lot like a "gauge" value. If could append ".0" to
the value you might be able to trick libyajl into parsing the string as
a double value, which is large enough to hold this value (the integer is
later converted to a double anyway, if it's a gauge).
Florian octo Forster
Hacker in training
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100713/3143bc18/attachment.pgp
More information about the collectd