On 12/02/2012, at 3:53 AM, John D. Mitchell wrote:

> Good morning,
> 
> On Feb 11, 2012, at 01:51 , john skaller wrote:
>> On 11/02/2012, at 8:27 PM, niXman wrote:
> [...]
>>> Continuing review of the libzmq code, I have found a few situations
>>> when the program will be crushed on segmentation fault.
>> 
>> It's impossible to avoid this in C.
> 
> That's bollocks.

Let me rephrase: it is impossible for the library writer
to avoid it.

Actually, that is bollocks as you say. It really can be done close to 100%
but you may not like the cost.

> There's certainly a realm of things way out beyond the boundaries that are 
> beyond the reasonable control of a library like 0mq. Taking care to deal with 
> basic, fundamental errors of parameters to functions is NOT one of them.  
> This is a huge, lazy, cop out

Sorry: some people favour robust programming. 
I'm not one of them. You just have to accept that fragile programming
advocates have a point too. You may not understand it, but that's
no reason to accuse those with a differing view point of being lazy
or coping out.

It's possible for the library to robustly check the pointers.
It doesn't. Why? Because it's expensive. It's a performance
hit. The library makes a cursory check .. and it's really stupid
because it uses a really bad type for sockets (void* is the worst
possible choice). A type based check is free.

--
john skaller
skal...@users.sourceforge.net




_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to