failures with "libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w)
Marc Lehmann
schmorp at schmorp.de
Mon Dec 15 01:32:44 CET 2014
On Sun, Dec 14, 2014 at 04:11:08PM -0800, Kirill Timofeev <kirill.timofeev at hulu.com> wrote:
> Dec 14 03:55:48 els-abacus-prod-01 statsd-router: statsd-router:
> ev.c:3552: ev_io_start: Assertion `("libev: ev_io_start called with
> corrupted watcher", ((WL)w)->next != (WL)w)' failed.
This assert was added to catch some common usage bugs - most likely, you
overwrote or freed an I/O watcher without stopping it, and later tried to
start a new watcher at the same address, which got detected by libev.
> Should I do call connect() in else branch and check it for EISCONN?
I haven't checked your code (it was badly garbled by your mailer), but the
general rule is to stop watchers before you reuse the memory for something
else (a new watcher, in this case). Maybe you simply forgot to stop the
I/O watcher when you freed your connection data in an error case?
You could try to run with a libev compiled with -DEV_FREQUENT_VERIFY=3,
which will make very frequent (and slow) checks, in the hope of catching
this bug earlier, but this kind of corruption is usually hard to detect
timely for libev, as it usually happens far away from any libev call.
I would suggest going through your code and checking for cases where
you free memory, or reuse structures with I/O watchers inside, without
sotpping active ones.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
-=====/_/_//_/\_,_/ /_/\_\
More information about the libev
mailing list