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

[Libevent-users] Assertion fails in insert_common_timeout_inorder



 

 

I am using libevent-2.0.18-stable running on Liux (CentOs 6.2).

Adding an event with a common timeout I get an assertion failure in insert_common_timeout_inorder (event.c:2532): “EVUTIL_ASSERT(is_same_common_timeout(&e->ev_timeout, &ev->ev_timeout));”

This happens once every few days on a libevent based HTTP proxy and I do not know how to consistently reproduce it.

 

Examining the core file

--------------------------------

*the stack*

#0  0x0000003c72c32885 in raise () from /lib64/libc.so.6

#1  0x0000003c72c34065 in abort () from /lib64/libc.so.6

#2  0x00007f35216c735e in event_exit (eval=-559030611, fmt=<value optimized out>) at log.c:79

#3  event_errx (eval=-559030611, fmt=<value optimized out>) at log.c:136

#4  0x00007f35216b5b65 in insert_common_timeout_inorder (base=0x7f34e8369860, ev=0x7f34e851c098, queue=1) at event.c:2532

#5  event_queue_insert (base=0x7f34e8369860, ev=0x7f34e851c098, queue=1) at event.c:2576

#6  0x00007f35216b72ca in event_add_internal (ev=0x7f34e851c098, tv=0x1f986248, tv_is_absolute=0) at event.c:2125

#7  0x00007f35216b783a in event_add (ev=0x7f34e851c098, tv=0x1f986248) at event.c:1941

#8  0x00007f35237a1fbb in AddEventsForPxcn (pxcn=..., handler_data=...) at tcpproxy.cpp:665

#9  0x00007f35237a483d in notify_conn_fn (fd=89, what=<value optimized out>, arg=0x1f986238) at tcpproxy.cpp:827

 

               *the added event and timeout*

(gdb) frame 7

#7  0x00007f35216b783a in event_add (ev=0x7f34e851c098, tv=0x1f986248) at event.c:1941

1941    event.c: No such file or directory.

        in event.c

(gdb) p *tv

$1 = {tv_sec = 5, tv_usec = 1342177280}

(gdb) p *ev

$4 = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x1b7489a0}, ev_next = {tqe_next = 0x0, tqe_prev = 0x7f34e851c130}, ev_timeout_pos = {

    ev_next_with_common_timeout = {tqe_next = 0x7f34ffffffff, tqe_prev = 0x7f34e87cd4e0}, min_heap_idx = -1}, ev_fd = 213, ev_base = 0x7f34e8369860, _ev = {

    ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7f34e8369f40}, ev_timeout = {tv_sec = 5, tv_usec = 1342177280}}, ev_signal = {ev_signal_next = {

        tqe_next = 0x0, tqe_prev = 0x7f34e8369f40}, ev_ncalls = 5, ev_pncalls = 0x50000000}}, ev_events = 50, ev_res = 0, ev_flags = 131, ev_pri = 0 '\000',

  ev_closure = 2 '\002', ev_timeout = {tv_sec = 266477, tv_usec = 1342841591}, ev_callback = 0x7f352379fab0 <receiver_cb(int, short, void*)>,

  ev_arg = 0x7f34e851c088}

 

*in the point of the assertion*

(gdb) frame 4

#4  0x00007f35216b5b65 in insert_common_timeout_inorder (base=0x7f34e8369860, ev=0x7f34e851c098, queue=1) at event.c:2532

2532    in event.c

(gdb) p ev->ev_timeout

value has been optimized out

(gdb) p e->ev_timeout

value has been optimized out

 

               *seeing ev that is optimized out at the point of assertion*

(gdb) frame 5

#5  event_queue_insert (base=0x7f34e8369860, ev=0x7f34e851c098, queue=1) at event.c:2576

2576    in event.c

(gdb) p ev->ev_timeout

$12 = {tv_sec = 266477, tv_usec = 1342841591}

 

               *seeing e that is optimized out at the point of assertion (hope I got it right)*

(gdb) p (*(((struct event_list *)((&base->common_timeout_queues->events)->tqh_last))->tqh_last))->ev_timeout

$18 = {tv_sec = 0, tv_usec = 0}

(gdb) p ((*(((struct event_list *)((&base->common_timeout_queues->events)->tqh_last))->tqh_last))->ev_timeout_pos.ev_next_with_common_timeout)

$19 = {tqe_next = 0x30000000000, tqe_prev = 0x0}

 

 

 

Any clue or advise can help.

Thanks,

Avi

 



This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.