[zeromq-dev] zeromq 3.2 tests fails
Sebastian Lauwers
sebastian.lauwers at gmail.com
Tue Jul 31 09:00:25 CEST 2012
On 30 July 2012 08:44, Sebastian Lauwers <sebastian.lauwers at gmail.com> wrote:
> I'm not familiar enough with ZMQ to understand what's going on, so
> I'll leave the rest to someone more experienced.
Looking at this a bit further, this is what I found.
Please note that I haven't become an expert since yesterday, so I'm
mainly just going at this by intuition. Feel free to correct any
mistakes I may have made or point out any wrong assumptions.
In stream::engine::plug(), a call to session_base_t::get_address(),
which rightfully checks whether its addr property is null before
calling a method on it (session_base.cpp:269):
if (addr)
return addr->to_string (addr_);
return -1;
If addr is correctly initialised, everything is fine and dandy: we
simply return the address in string format.
However, addr isn't always set: In some cases, the session_base_t
object is instantiated with addr = NULL (tcp_listener.cpp:105):
session_base_t *session = session_base_t::create (io_thread, false, socket,
options, NULL);
The same line is also usedin ipc_listerner.cpp. However, in
socket_base.cpp (line 492 and 529), the session is created with a
non-NULL parameter:
address_t *paddr = new (std::nothrow) address_t (protocol, address);
alloc_assert (paddr);
<snip>
session_base_t *session = session_base_t::create (io_thread, true, this,
options, paddr);
Now, passing the paddr to the ::create() call was added in February by
Staffan Gimåker in commit b9fb48f47b8b6f211625e0897c5f52ba5cfe6593,
which added the ability to propagate resolution errors on connect
rather than exclusively from the IO thread.
If this research is correct, then I guess two things could be done
(again, feel free to add other possibilities if you see them, I'm
shooting in the dark here):
- Find a way to properly create the addr object before creating the
session object, or,
- Not use the session to get the address in string format.
Thoughts?
-S.
More information about the zeromq-dev
mailing list