[zeromq-dev] zmq2 : bug in devpoll_t

Martin Sustrik sustrik at 250bpm.com
Thu Nov 19 08:09:12 CET 2009


Hi Jon,

Thanks for the patch! It have been merged into the trunk. Btw, the same 
problem occured in kqueue which should affect Mac OS X, FreeBSD & 
OpenBSD systems. The latter was fixed as well.

Martin

> There is a bug in the constructor of zmq::devpoll_t,
> the stopping data member is not initialised and in cases
> where the the random memory value is true, it leads to the 
> devpoll_t::loop() exiting immediately; because by this time the socket has 
> actually been created clients can actually connect but nothing happens as 
> there is no IO thread.
> 
> I submit this patch under the MIT license.
> 
> Thanks, 
> 
> Jon
> 
> diff --git a/src/devpoll.cpp b/src/devpoll.cpp
> index f28d55e..7a9ab90 100644
> --- a/src/devpoll.cpp
> +++ b/src/devpoll.cpp
> @@ -38,6 +38,7 @@
>  #include "i_poll_events.hpp"
> 
>  zmq::devpoll_t::devpoll_t ()
> +  : stopping(false)
>  {
>      //  Get limit on open files
>      struct rlimit rl;




More information about the zeromq-dev mailing list