[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Deadlock driving me nuts
On Sat, Apr 9, 2011 at 4:16 AM, Sherif Fanous <sherif.fanous@xxxxxxxxx> wrote:
> As a matter of fact, the thread in question is usually stuck in
> event_active_nolock.
> The funny thing is that it shows that it's stuck in line 2212 in event.c
> which is the opening brace of the function.
> How would I walk through ctx->events?
So, having a look at the TAILQ_FOREACH definition, it's going to unpack to:
for (ev = TAILQ_FIRST(&ctx->events);
ev != TALQ_END(&ctx->events);
ev = TAILQ_NEXT(ev, ev_io_next) {
and that's going to turn into:
for (ev = ctx->events.tqh_first;
ev != NULL;
ev = ev->ev_io_next.tqe_next) {
So, given those stack traces, I assume you're using gdb. Start with
ctx->events.tqh_first, then look at the ev_io_next.tqe_next field of
that, then the ev_io_next.tqe_next field of that, etc, until you get a
repeat or a NULL or something that looks crazy.
hth,
--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.