[collectd] Integer overflow in curl_json plugin
Florian Forster
octo at verplant.org
Tue Jul 13 14:12:37 CEST 2010
Hi Garret,
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 [3] 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 [0]. 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).
Regards,
—octo
[0] <http://github.com/octo/collectd/commit/b16fd65efea0f4073c967f9c93237585fcc7b88c>
--
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- 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/20100713/3143bc18/attachment.pgp
More information about the collectd
mailing list