[zeromq-dev] Assert questions

Pieter Hintjens ph at imatix.com
Tue Apr 17 15:11:29 CEST 2012


On Tue, Apr 17, 2012 at 7:58 AM, Pasi Mankinen
<mailing.list at manageapp.com> wrote:

> * In zmq source I see some calls to assert instead of zmq_assert. Is it ok?

That is probably wrong.

> * Is it possible to change zmq_assert so that it does not abort but returns some error number to calling method?

Not really; the valid asserts really need to kill the process. They
are meant to hit when there is an irrecoverable internal error. This
means there's no way to handle an error code. The problem is those
invalid asserts that the original authors put in the code due to not
really understanding what asserts are for.

> Nobody can guarantee that all the zmq asserts are correct one. Mikko fixed one ETIMEDOUT a week ago.

True. But these are rare instances nowadays. I'd recommend heavy
testing and aggressive futzing (sending corrupt data) of your apps to
try to crash them.

-Pieter



More information about the zeromq-dev mailing list