Re: [Libevent-users] Deadlock when calling bufferevent_free from an other thread

2012-08-08 Thread Dave Hart
One solution that comes to mind is to add a (for example) event_del_nowait(), or event_del_nonblocking() which requires the event in question be allocated dynamically via libevent, and therefore can safely use the dead list approach of queuing the deallocation to be done by the thread running the e

Re: [Libevent-users] Deadlock when calling bufferevent_free from an other thread

2012-08-08 Thread Nick Mathewson
On Wed, Aug 8, 2012 at 6:44 PM, Adrian Chadd wrote: > On 8 August 2012 15:30, Nick Mathewson wrote: > >> Specifically, let me follow up with what I need: I need people with >> good programming taste to read and understand that message, and let me >> know whether you've got any good ideas for fixi

Re: [Libevent-users] Debugging bufferevent_openssl (filtered)

2012-08-08 Thread Diwaker Gupta
On Wed, Aug 8, 2012 at 3:22 PM, Nick Mathewson wrote: >> Reviving this thread as I'm still running into spurious SSL failures >> when using a filtered bufferevent. I have stack traces but I found it >> a lot more useful to just modify the libevent code to add more debug >> logs and use those to fi

Re: [Libevent-users] Deadlock when calling bufferevent_free from an other thread

2012-08-08 Thread Adrian Chadd
On 8 August 2012 15:30, Nick Mathewson wrote: > Specifically, let me follow up with what I need: I need people with > good programming taste to read and understand that message, and let me > know whether you've got any good ideas for fixing it, or whether you > think my ideas are reasonable. Any

Re: [Libevent-users] my app crashed, maybe a bug in libevent

2012-08-08 Thread Nick Mathewson
On Wed, Aug 1, 2012 at 3:41 AM, huyinyx wrote: > in buffer.c : > > for (chain = buf->first; >remaining >= chain->off; >chain = next) { >next = chain->next; >remaining -= chain->off; >if (chain == *buf->last_with_datap) { > buf->last_with_datap = &buf->first; >}

Re: [Libevent-users] Setting timeout to NULL on bufferevents doesn't work as expected

2012-08-08 Thread Diwaker Gupta
On Wed, Aug 8, 2012 at 3:24 PM, Nick Mathewson wrote: > On Mon, Aug 6, 2012 at 5:31 PM, Diwaker Gupta wrote: > I don't believe that we defined whether setting the timeout to NULL > will cancel any currently pending timeouts. That is, if the timeout > has already fired, and the corresponding even

Re: [Libevent-users] Deadlock when calling bufferevent_free from an other thread

2012-08-08 Thread Nick Mathewson
On Wed, Aug 8, 2012 at 2:52 PM, Nick Mathewson wrote: > On Mon, Aug 6, 2012 at 2:42 PM, Matthieu Nottale > wrote: >> Hi. >> >> I'm experiencing a deadlock on 2.0.19 while calling bufferevent_free frome >> thread A, while thread B is in event_base_dispatch. >> > > Ouch. This is a known bug. This

Re: [Libevent-users] Setting timeout to NULL on bufferevents doesn't work as expected

2012-08-08 Thread Nick Mathewson
On Mon, Aug 6, 2012 at 5:31 PM, Diwaker Gupta wrote: > I've filed a bug with all details and sample code that demonstrates > the problem on Github: > https://github.com/libevent/libevent/issues/16 > > Nick: can you verify if my understand of the expected behavior is > correct. That is, if I set ti

Re: [Libevent-users] Debugging bufferevent_openssl (filtered)

2012-08-08 Thread Nick Mathewson
On Wed, Aug 8, 2012 at 3:24 PM, Diwaker Gupta wrote: > On Thu, Mar 29, 2012 at 11:45 AM, Nick Mathewson wrote: >> On Thu, Mar 29, 2012 at 2:31 PM, Diwaker Gupta >> wrote: >> The most useful thing here would probably be a stack trace with as >> much debugging information as possible. Additional

Re: [Libevent-users] Which github repo for filing issues?

2012-08-08 Thread Nick Mathewson
On Wed, Aug 8, 2012 at 3:26 PM, Diwaker Gupta wrote: > There are a few libevent issues filed at > https://github.com/libevent/libevent/ > > And several more at > https://github.com/nmathewson/Libevent And more at sourceforge. Technically, I think that the one at sourceforge is "official", since

Re: [Libevent-users] Deadlock when calling bufferevent_free from an other thread

2012-08-08 Thread Diwaker Gupta
On Wed, Aug 8, 2012 at 11:52 AM, Nick Mathewson wrote: > On Mon, Aug 6, 2012 at 2:42 PM, Matthieu Nottale > wrote: >> Hi. >> >> I'm experiencing a deadlock on 2.0.19 while calling bufferevent_free frome >> thread A, while thread B is in event_base_dispatch. >> > > Ouch. This is a known bug. Thi

[Libevent-users] Which github repo for filing issues?

2012-08-08 Thread Diwaker Gupta
There are a few libevent issues filed at https://github.com/libevent/libevent/ And several more at https://github.com/nmathewson/Libevent This is very confusing for libevent users and the community at large. It would be great if there was an unambiguous location for reporting bugs and filing feat

Re: [Libevent-users] Debugging bufferevent_openssl (filtered)

2012-08-08 Thread Diwaker Gupta
On Thu, Mar 29, 2012 at 11:45 AM, Nick Mathewson wrote: > On Thu, Mar 29, 2012 at 2:31 PM, Diwaker Gupta wrote: > The most useful thing here would probably be a stack trace with as > much debugging information as possible. Additionally, running under a > debugging tool like valgrind (or the loca

Re: [Libevent-users] Deadlock when calling bufferevent_free from an other thread

2012-08-08 Thread Diwaker Gupta
On Wed, Aug 8, 2012 at 11:52 AM, Nick Mathewson wrote: > Ouch. This is a known bug. This fix is going to be hard. I wrote > about it here: > http://archives.seul.org/libevent/users/Feb-2012/msg00053.html Does it make sense to move this to an actual bug on github so it is easier for others to d

Re: [Libevent-users] Deadlock when calling bufferevent_free from an other thread

2012-08-08 Thread Nick Mathewson
On Mon, Aug 6, 2012 at 2:42 PM, Matthieu Nottale wrote: > Hi. > > I'm experiencing a deadlock on 2.0.19 while calling bufferevent_free frome > thread A, while thread B is in event_base_dispatch. > Ouch. This is a known bug. This fix is going to be hard. I wrote about it here: http://archives.s