[Libevent-users] [PATCH] signal.c,
evsignal.h: properly save/restore previous signal handlers and fix
memory stomp
Christopher Layne
clayne at anodized.com
Fri Nov 9 20:10:27 EST 2007
On Fri, Nov 09, 2007 at 04:38:43PM -0800, Scott Lamb wrote:
> >Fix in same, or sweep up in a later patch? How many other places are
> >there where we're not currently checking the return value of
> >event_add()? If there are more than this, we might as well just do it
> >separately.
> >
> >-cl
>
> Looks like there are a number of others:
>
> * evsignal_cb <- evsignal_add() should probably be using EV_PERSIST so
> this call is unnecessary
Yep.
> * bufferevent_read_cb
> * bufferevent_read_pressure_cb
> * bufferevent_write_cb
> * bufferevent_write
> * evdns_add_server_port
> * evdns_server_request_respond
> * evhttp_add_event
> * evhttp_connection_start_detectclose
> * evhttp_bind_socket
>
> Most look straightforward to fix, but I'm not sure how the callbacks
> should indicate error.
>
> There are also several unchecked event_del() calls, but I think it's
> safe to assume those will fail only on logic error.
I've had a couple of ideas running around in my head of a -DSTRICT type
setup for libevent in general. But then again, maybe these should be just
checked for error as normal - I'm sure more than one person has spent a few
hours tracking down a bunk fd they accidentally reused.
-cl
More information about the Libevent-users
mailing list