[Libevent-users] Infinite loop in event_process_active()

2009-09-17 Thread nicolas dumont
Hi, I'm using events in 1.4.12-stable. Sometimes, my daemon, which uses event_base_loop() goes in an infinite loop ( verbose traces below ). This infinite loop is inside function event_process_active() which calls event_del() with ev_flags=0x80 ( =EVLIST_INIT) This flags is not managed by

Re: [Libevent-users] Infinite loop in event_process_active()

2009-09-17 Thread Nick Mathewson
On Thu, Sep 17, 2009 at 02:56:59PM +0200, nicolas dumont wrote: Hi, I'm using events in 1.4.12-stable. [...] Finnaly, to prevent to go in the infinite loop , do I have to run event_del(ev) each time before using event_set(ev) ? This is exactly so. You can't call event_set or event_assign

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Gilad Benjamini
I just resolved a similar issue today, where I needed to close a file descriptor AFTER deleting an event. My symptoms, though, were different. What underlying mechanism is your libevent using ? In my case it is epoll. With select or poll my scenario had no problems, in spite of the wrong order.

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Adrian Chadd
Well, the order of which you can do this depends on what the underlying OS will do for you. I'd suggest sticking to delete event, close socket usage. Anything else isn't portable. Nick, is this actually documented anywhere? Adrian On Thu, Sep 17, 2009, Gilad Benjamini wrote: I just resolved

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Nick Mathewson
On Fri, Sep 18, 2009 at 10:57:25AM +0800, Adrian Chadd wrote: Well, the order of which you can do this depends on what the underlying OS will do for you. I'd suggest sticking to delete event, close socket usage. Anything else isn't portable. Nick, is this actually documented anywhere?

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Adrian Chadd
On Thu, Sep 17, 2009, Nick Mathewson wrote: Nick, is this actually documented anywhere? Not that I recall, and it really ought to be. Anybody want to write the documentation patch? I've been threatening to do this for ages. I may as well start now. Is there a project wiki or something

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Clint Webb
I forgot to mention that I am using libevent-2.02alpha. I think it definately makes sence to free the event before closing the handle, but it just didn't occur to me before. On Fri, Sep 18, 2009 at 10:57 AM, Adrian Chadd adr...@creative.net.auwrote: Well, the order of which you can do this

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread William Ahern
On Thu, Sep 17, 2009 at 07:51:58PM -0700, Gilad Benjamini wrote: I just resolved a similar issue today, where I needed to close a file descriptor AFTER deleting an event. My symptoms, though, were different. What underlying mechanism is your libevent using ? In my case it is epoll. With

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Nick Mathewson
On Fri, Sep 18, 2009 at 11:09:52AM +0800, Adrian Chadd wrote: On Thu, Sep 17, 2009, Nick Mathewson wrote: Nick, is this actually documented anywhere? Not that I recall, and it really ought to be. Anybody want to write the documentation patch? I've been threatening to do this for