[rrd-developers] "rrdtool restore" error handling and implementation

Tobias Oetiker tobi at oetiker.ch
Fri Feb 22 08:00:03 CET 2008


Hi Terje,

rrdtool restore should not crash ... it should complain ... could
you please send me that crasher example ? The shorter the better!

cheers
tobi

Yesterday Terje Bless wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi, cf. the thread on rrdtool-users at
> <https://lists.oetiker.ch/pipermail/rrd-users/2008-February/013728.html>
> («Segfault on rrdtool restore...»).
>
> The summary is: while attempting to add a DS to a RRD I'd
> flubbed my editing of the XML dump file and "rrdtool restore"
> segfaulted as a result.
>
>
> Now segfaulting on bad input ? particularly on input that is
> well formed but logically wrong ? is not an optimal failure
> mode. It suggests to me that the code there needs more
> sanitizing of input and saner error handling (so it'll bail with
> a descriptive error message).
>
>
> But rooting around in the code I notice that rrdtool seems to
> have implemented its own XML parser[0]. I'm quite surprised at
> this given the ubiquity of XML parsing libraries (expat and
> libxml, to name two), the usefulness of enabling processing with
> general XML tools, and the pitfalls inherent in ?rolling one's
> own? when dealing with XML.
>
> At first I speculated that this was a kind of optimization, but
> the ?restore? code doesn't seem particularly performance
> critical. And in terms of dependencies, real XML parsers are
> much more widely available than some of rrdtool's other
> dependencies (and expat is even quite embedable, if that's a concern).
>
> Perhaps it would be prudent to reevaluate how the dump/restore
> functions implement their parsing and serialization?
>
>
>
>
> [0] ? ?Faux XML Parser? I should probably say; it doesn't
> seem to try to
>        be an ?XML Processor? as defined in the spec, just
> generically parse
>        simple XML-like syntax.
> - --
> >Did you notice the three words "hurricane relief work" in there?
> I think we've just discovered a new corollary to Godwin's Law.
>
>                                - Rich Siegel <siegel at barebones.com>
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP SDK 3.10
>
> wj8DBQFHvbgBo/I+siR19ewRAobrAKCegamKS6L8PR4rRUHipzqR+XczkQCfdI2G
> dDKhwBl39MGAcRzZUDE0AM4=l7ft
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> rrd-developers mailing list
> rrd-developers at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902


More information about the rrd-developers mailing list