[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] [2.0.19-stable] Infinite loop
- To: libevent-users@xxxxxxxxxxxxx
- Subject: Re: [Libevent-users] [2.0.19-stable] Infinite loop
- From: sahil aggarwal <sahil.agg15@xxxxxxxxx>
- Date: Thu, 15 Sep 2016 23:29:21 +0530
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Thu, 15 Sep 2016 13:59:25 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=laGIHV2ov/9r/hHNfXdWKnvBLVg0q91ZumeFxphMY04=; b=VQpyTiwgT4U0K2MBFFDRw8anpV7gFGDsNjnIPLZ6GrOqm+cgXrD/E5YimgSoGuHvLf E+y5xToJGEH3zzJNZIJw4RWO1zlYtuNRgN6qh8JkUT1iK2PcQqpd6B2lPvW7TOdPAgV5 y+IcfL712xePBXSFpaVosvVx7FVXSw8sJhnx2ZJfFpD2Pc3Kuvdfrq4fM+skaz36HSpG M9C/P48lIDgtN680vi//mwoNUkatonW/aaxiV/tFIDRVtoTkNuLjZYdrPsSKDtS6eb96 raQfk/yisphR5FMGvYirKogfc4VVC/cw80P7MBRxUq92lyL57mucgugsU4R4sngEkI41 uNEg==
- In-reply-to: <CAGAANTWH1ZZSYuZRudo0X8B4ss3j9zy=oRMoMgP2Ef82J=ahAQ@mail.gmail.com>
- References: <CAGAANTWkHp9g2wF9wjveYPBi6FDA=ityjxb05GfKz-Wt+fPcZA@mail.gmail.com> <20160914110702.GS8985@azat> <CAGAANTVVT8E+Ox+3r2mQ0RBQka79zZq=TCutqgvGbwG7X=F1uA@mail.gmail.com> <CAGAANTWH1ZZSYuZRudo0X8B4ss3j9zy=oRMoMgP2Ef82J=ahAQ@mail.gmail.com>
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Azat,
Could this patch
https://github.com/libevent/libevent/commit/bc79cc5c80ee374dec0e968bc6fdf301d479e133
be related ?
On 15 September 2016 at 23:28, sahil aggarwal <sahil.agg15@xxxxxxxxx> wrote:
> Azat,
>
> Could this patch
>
>
> On 14 September 2016 at 18:48, sahil aggarwal <sahil.agg15@xxxxxxxxx> wrote:
>> Azat,
>>
>> Yes this happens every time server close the connection. To reproduce i :
>> * start my client (multiple threads but event_base being exclusive to
>> 1 thread handling the events)
>> * start server
>> * generate some requests from client which succeed
>> * stop server
>> * generate some requests where now it loops forever.
>>
>> I can write reproducer and try it with latest libevent too. In the
>> mean time i have live GDB attached, if you need any info let me know.
>>
>> Thanks
>>
>> On 14 September 2016 at 16:37, Azat Khuzhin <a3at.mail@xxxxxxxxx> wrote:
>>> On Wed, Sep 14, 2016 at 04:33:41PM +0530, sahil aggarwal wrote:
>>>> Hi,
>>>>
>>>> Getting stuck in infinite loop after retry on evhttp_connection. After
>>>> attaching GDB this is what i found:
>>>>
>>>> ----------
>>>>
>>>> #0 0x00007f9a8f5efdb9 in event_queue_remove (base=base@entry=0x24bf830,
>>>> ev=ev@entry=0x7f9a84006da0, queue=queue@entry=8)
>>>> at event.c:2495
>>>> #1 0x00007f9a8f5f4040 in event_del_internal (ev=0x7f9a84006da0) at
>>>> event.c:2234
>>>> #2 timeout_process (base=0x24bf830) at event.c:2481
>>>> #3 event_base_loop (base=base@entry=0x24bf830, flags=flags@entry=0) at
>>>> event.c:1614
>>>>
>>>>
>>>> ---------
>>>>
>>>> #0 event_active_nolock (ev=<optimized out>, res=<optimized out>,
>>>> ncalls=<optimized out>) at event.c:2315
>>>> #1 0x00007f9a8f5f3f76 in timeout_process (base=0x24bf830) at event.c:2485
>>>> #2 event_base_loop (base=base@entry=0x24bf830, flags=flags@entry=0) at
>>>> event.c:1614
>>>>
>>>>
>>>> So the event is getting removed and queued in active queue. And event given
>>>> by
>>>>
>>>> ev = min_heap_top(&base->timeheap)
>>>>
>>>> doesn't have EV_TIMEOUT flag set due which it won't remove from the
>>>> min_heap and it always get the same event on the top hence the infinite
>>>> loop.
>>>>
>>>> * event_base not being shared across multiple threads.
>>>>
>>>> * How 1 have event in min_heap without EV_TIMEOUT flag set and
>>>> e->ev_timeout_pos.min_heap_idx = -1 as on adding we always set the flag ?
>>>
>>> Hi,
>>>
>>> Does it triggers every time? If so can you please try libevent from
>>> sources (https://github.com/libevent/libevent)? And does you program
>>> single-threaded or multi?
>>>
>>> Also if you have a reproducer (~100 lines) it will be useful to see it.
>>>
>>> Thanks,
>>> Azat.
>>> ***********************************************************************
>>> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
>>> unsubscribe libevent-users in the body.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.