News for hackers. Stuff that matters.
Re:Robdns – A fast DNS server based on C10M principles by tptacek on Monday December 29, 2014 @05:50PM (#8812261)
Then you've misunderstood me, or I've miscommunicated. My argument is that the default handling strategy should be to abort. I'm not saying that special case handling is evil. I'm saying that defaulting to manually checking malloc's return value is evil.

Also, your chunked encoding decoder seems to be using a signed strtol() routine to read an unsigned length variable. I could be misreading; I didn't look carefully.

Re:Robdns – A fast DNS server based on C10M principles by halayli on Monday December 29, 2014 @06:59PM (#8812549)
I see. The strategy should depend on the goal, of course.

memcached is a good example of a daemon that shouldn't abort imho, many other daemons could happily abort. https://github.com/memcached/memcached/blob/master/memcached... . In other parts of the code, aborting was a better decision. https://github.com/memcached/memcached/blob/master/memcached... . If you cannot preallocate conn structures why bother running?

It depends on the goal in the end. As long as it's an explicit decision and not relying on environment the behavior is expected to be defined.

For instance, I worked on an enterprise proxy where aborting on asserts wasn't acceptable. Why? Because the customer didn't want to interrupt his users even though in our opinion the proxy state was out of whack. This created a nightmare for us because it was hard to debug. We ended up fork()-ing and aborting on the side to debug the cores.