[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Buffer event race condition
On Mon, Dec 20, 2010 at 01:32:50AM -0500, Kevin Bowling wrote:
> I'm at wit's end with a libevent threading bug. As part of a disconnect
> client routine, I manually call the errorcb with EVENT_ERROR_EOF. The idea
> was to keep all the cleanup code in one callback but I'm beginning to think
> this was ill-conceived. Somehow, libevent is entering a condition wait and
> it looks like the event base is never releasing the cv mutex.
>
> For the worker threads, the workers are passed a *bev and *ctx pointer
> through a singly linked list that is mutex protected. When a client
> disconnects, a reaper is run in the errorcb to remove any pending work
> entries that match that *bev pointer. This happens mutually exclusive to
> the workers so a worker should not consume a null *bev. I'm guessing the
> errorcb is being called twice.
>
> It may be a longshot asking such a broad question but any advice is
> appreciated.
>
> Here is the backtrace of the worker thread(6), and the event base(1):
If you can give me a method of reproducing the issue with your code, I
can give it a quick lookover.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.