Perfect, it works now w/ checking the EV_ERROR bit, thx Marc!

On 29-May-08, at 12:09 AM, Marc Lehmann wrote:

On Wed, May 28, 2008 at 01:41:58PM -0400, Marc-André Cournoyer <[EMAIL PROTECTED] > wrote:
I'm playing w/ libev to make (yet another) Ruby web server and I got
some random issues. Sometimes the server hangs and when I attach to
the process w/ gdb to get the backtrace here's what I get:

fd_ebadf is called when you give libev an invalid file descriptor - this is likely an applciation bug (fd_ebadf is very slow, but select and poll
do not report *which* file descriptor is wrong, so libev has to check
every single one).

you likely see it repeatedly because you ignore the EV_ERROR bit in your watcher and just add the file descriptor again (ignoring that bit is fine
if your code is perfect :).

Both of these are application bugs - you have to make sure that the file descriptors you give to libev are valid, open, poll'able file descriptors,
and you should check for EV_ERROR conditions and not start the watcher
again.

--
The choice of a Deliantra, the free code +content MORPG
     -----==-     _GNU_              http://www.deliantra.net
     ----==-- _       generation
     ---==---(_)__  __ ____  __      Marc Lehmann
     --==---/ / _ \/ // /\ \/ /      [EMAIL PROTECTED]
     -=====/_/_//_/\_,_/ /_/\_\


_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to