[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Re: libevent-2.0.8-rc/evdns.c:2672: Assertion (req)->handle && (req)->handle->current_req == (req) failed in evdns_cancel_request



On Wed, Nov 3, 2010 at 2:35 PM, Denis Bilenko <denis.bilenko@xxxxxxxxx> wrote:
> On Wed, Nov 3, 2010 at 10:38 PM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:
>>> Probably the right answer here is to add a reference count to the
>>> request, and not actually free it until the reference count hits zero.
>>
>> Actually, we can go even simpler.  Here's the patch I've got in mind.
>>
>> There may be better ways to do this, and simplify the code even more,
>> but I'd rather keep changes to this rats'-nest nice and minimal while
>> we're trying to stabilize it.
>>
>> Denis, does this fix stuff for you?
>
> No, it's still crashes. The crash is now more certain though.
>
> This seems wrong:
>
> +                       if (! req->handle->pending_cb) {
> +                               /* If we're planning to run the callback,
> +                                * don't free the handle until later. */
> +                               mm_free(req->handle);
> +                       }
> +                       req->handle->current_req = NULL;
>
> You free req->handle and then access it.

Ugh.  What if we move "req->handle->current_req =NULL" to *above* that "if" ?
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.