Thanks for the fixes so far. I am still using the "embedded" version
in my C++ interpreter project and found a strange issue with the
kqueue_events[i].ident. In a heavily-adapted version of the
test-eof.cpp test program, if I run it with CINT using ev_kqueue.c
from CVS, I get a crash on line 121 with fd=a very large number.
However, if I do not use eventxx::dispatcher, the same test works OK.

I suspect there is a very strange error event if there is a small
delay between write()/shutdown() and event_add()/event_dispatch().

I tried adding a check of the fd, and this seems to work well. I must
admit that I am no kqueue expert, but I hope this information is
helpful. Possible patch below.

Thanks,
Chris

$ diff -u ev_kqueue.c ev_kqueue4.c
--- ev_kqueue.c 2007-11-11 16:41:43.000000000 +0100
+++ ev_kqueue4.c        2007-11-11 16:19:19.000000000 +0100
@@ -118,7 +118,7 @@
            */

           /* we are only interested in errors for fds that we are
interested in :) */
-          if (anfds [fd].events)
+          if (fd_valid (fd) && anfds [fd].events)
            {
               if (err == ENOENT) /* resubmit changes on ENOENT */
                 kqueue_modify (EV_A_ fd, 0, anfds [fd].events);
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to