I'm using zeromq in a long running windows service and experience
crash every few days.
Analyzing memory dump shows that the problem is in zeromq.

Service is simple publisher, and has few subscribers 2-5. Messages are
sent every second or so.
Messages are multipart, subject and body style.
.Net code is pretty simple:

                _context = new Context(1);
                _socket = _context.Socket(SocketType.PUB);
                _socket.Bind(string.Format("tcp://{0}", _address));
....
                _socket.SendMore(subject, Encoding.Unicode);
                _socket.Send(message, Encoding.Unicode);


System:
Windows Server 2008
64 bit
zeromq-2.1.9

Analyzing memory dumps leads to the line:
  wsa_assert (nbytes != SOCKET_ERROR);
in the
  int zmq::tcp_socket_t::write (const void *data, int size)
function.

Value for the
  WSAGetLastError ()
is:
  WSAEFAULT ("Bad address")

00000000`03d5c320  "Assertion failed: Bad address (."
00000000`03d5c340  ".\..\..\src\tcp_socket.cpp:93)."

And is not one that is handled:
    if (nbytes == -1 && (
          WSAGetLastError () == WSAENETDOWN ||
          WSAGetLastError () == WSAENETRESET ||
          WSAGetLastError () == WSAEHOSTUNREACH ||
          WSAGetLastError () == WSAECONNABORTED ||
          WSAGetLastError () == WSAETIMEDOUT ||
          WSAGetLastError () == WSAECONNRESET))
        return -1;

    wsa_assert (nbytes != SOCKET_ERROR);

so the wsa_assert get called, which aborts application.

Seams that zeromq tries to send data from address 0x00000000:
    libzmq!zmq::tcp_socket_t::write(void * data = 0x00000000`00000000,
int size = 0n64261888)+0xdc [c:\work\zeromq-2.1.9\src\tcp_socket.cpp @
93]
Which is usually a bad decision.


When I limit number of subscribers to 2 I got less frequent crashes.
Upgrading to 2.1.10 didn't help.


Could you please help with this,
Igor.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to