Hi all,

It seems there's a small bug in libevent-trunk (1.5?, 2.0?) when
passing a 'wrong' event_config to event_base_new_with_config.
By 'wrong' I mean a configuration that doesn't make sense, like
avoiding epoll and requiring edge-triggered behavior on linux.


I triggered it with the following sequence (pseudo-code):

config = event_config_new();
event_config_avoid_method(config, "epoll");
event_config_require_features(config, EV_FEATURE_ET);
base = event_base_new_with_config(config); --> Segmentation fault


The following one liner seems to fix it (tested on linux only):

--- event.c     2008-09-26 14:41:13.000000000 +0200
+++ event.c.new 2008-09-26 14:41:21.000000000 +0200
@@ -343,7 +343,7 @@
                event_debug(("%s: %d events were still set in base",
                        __func__, n_deleted));
 
-       if (base->evsel->dealloc != NULL)
+       if (base->evsel && base->evsel->dealloc != NULL)
                base->evsel->dealloc(base, base->evbase);
 
        for (i = 0; i < base->nactivequeues; ++i)


hope it helps

malek
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to