[zeromq-dev] [BUG] zmq_assert causes BOOM if you breath on OSX Lion kqueue wrong.

Martin Sustrik sustrik at 250bpm.com
Tue Oct 4 09:19:37 CEST 2011


Hi,

Ok. You can do that. Install a SIGABRT handler which will get called in 
the case of assertion.

However, keep in mind that assertion basically indicates a byzantine 
failure, ie. you have no guarantees about the state of the process 
whatsoever.

For example, the process memory may be overwritten. If you try, say, to 
save the data to the database it may happen that you'll overwrite the 
current consistent, although a bit stale, data by utter junk.

Martin

On 10/03/2011 01:23 AM, Elliot Saba wrote:

> I second this notion, it allows for much more graceful error handling,
> even in the case of errors that "should never happen".  This makes the
> error checking the asserts do much more meaningful for users, and not
> just meaningful for zmq developers.
> -E
>
> On Sun, Oct 2, 2011 at 11:04 AM, Ian Barber <ian.barber at gmail.com
> <mailto:ian.barber at gmail.com>> wrote:
>
>     On Sat, Oct 1, 2011 at 9:58 AM, Martin Sustrik <sustrik at 250bpm.com
>     <mailto:sustrik at 250bpm.com>> wrote:
>
>      > What can be done is setting a global handler function that will be
>      > called if a bug is hit. It's not clear what the application should do
>      > then though. Maybe it can save its state and restart itself?
>      >
>
>     This would be a very good option I think. Like you say, I think the
>     main advantage would be to allow orderly shutdown of other parts of an
>     application.



More information about the zeromq-dev mailing list