[Opendnssec-develop] About assert()...

Jerry Lundström jerry at opendnssec.org
Mon Feb 10 11:47:09 UTC 2014


On 10 Feb 2014, at 11:33 , Matthijs Mekking <matthijs at nlnetlabs.nl> wrote:

> In some cases they also may be useful in releases, because if the
> assertion did not kill the program, a segfault probably will. If not,
> something terribly wrong may happen. So sometimes dying is just the
> lesser of two evils...

... and even better would be if it reported the error, handled the problem and continued to operate so that states are kept non-corrupt.

You might argue that an assert is really needed since a (for example) function should never be called with NULL.

But what if something did call it with NULL, there might be a situation where the system is temporarily out of memory or that is was called from an untested code path or some other strange situation. Is it then our praxis, our coding standard to have the program just die? I’d really hope not.

I can not really see how asserts are useful in stable releases of a daemon which has multiple states (zones) like we do. For testing?

My point for bringing this all up is to hopefully improved the quality of our code base in the future.

--
Jerry Lundström - OpenDNSSEC Developer
http://www.opendnssec.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 625 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.opendnssec.org/pipermail/opendnssec-develop/attachments/20140210/fc41b63b/attachment.bin>


More information about the Opendnssec-develop mailing list