zeromq/zeromq3-x — pull request #116 by daveab (2014-04-25 15:19:42+00:00)
Title: Fix race to crash: when a message is sent as the last connection is lost

Active is reduced in the zmq internal thread in terminated(), potentially to zero.
If the user thread is in send() between lines 109 and 116, then the old code "(current+1) % active" is a divide by 0 - and crashes the program.