[zeromq-dev] pure virtual function call in select.cpp

Martin Sustrik sustrik at 250bpm.com
Fri Oct 28 08:26:46 CEST 2011


Hi Hamster!

> If any of you ever met "pure virtual function call" in zmq::select_t::loop() ?
> The disposition is like following: W2008/x64, zmq 2.1.7 and 2.1.10 (both do the
> same thing), server application implementing ZMQ_XREP socket at certain
> conditions ends up with the above mentioned error. (sh)it happens time to time
> while clients do multiple zmq_connect, zmq_send, zmq_poll/zmq_recv, zmq_close
> sequences (unsuccessful logon scenario). Server (in the main thread) do
> zmq_bind, zmq_poll/zmq_recv on two sockets, one is networked ZMQ_XREP where
> clients are connected and another is ZMQ_UPSTREAM where threads put their
> responses after processing network requests (then main thread do zmq_send).
>
> The stack is quite short: thread_routine() and then zmq::select_t::loop(), the
> line is:
>
>                  fds [i].events->in_event ();
>
> I suppose that this is kind of race condition, but can not isolate it well right
> now. Do you have any thoughts?

The error means that the object fd [i].events is pointing to is either:

1. being in process of construction
2. being in process of destruction
3. deallocated

What would help is reproducible test case. If not possible, try at least 
to find out which object is fd [i].events pointing to.

Martin



More information about the zeromq-dev mailing list