[zeromq-dev] identity bug

Serge Aleynikov serge at aleynikov.org
Mon May 24 13:35:22 CEST 2010


I am working on completing Erlang 0MQ bindings I ran into this odd scenario:

1. 0MQ REP server opens a socket
2. The server sets ZMQ_IDENTIFY option to some value (e.g. "XYZ")
3. The server binds the socket to local TCP port
4. 0MQ REQ client opens a socket and connects to the server.
5. 0MQ REP server is terminated by ^C and restarted.
6. The server opens a socket
7. The server binds it to local TCP port (without setting ZMQ_IDENTITY)
8! The client core dumps with:

Assertion failed: peer_identity == peer_identity_ (session.cpp:215)
Aborted (core dumped)


Note that if the order of events is modified swapping 2 and 3, this 
causes no assertion issue in client code:

1. 0MQ REP server opens a socket
2. The server binds the socket to local TCP port
3. The server sets ZMQ_IDENTIFY option to some value (e.g. "XYZ")
4. 0MQ REQ client opens a socket and connects to the server.
5. 0MQ REP server is terminated by ^C and restarted.
6. The server opens a socket
7. The server binds it to local TCP port (without setting ZMQ_IDENTITY)
8. The client reconnects successfully.

Looks like a bug to me.

Serge



More information about the zeromq-dev mailing list