[zeromq-dev] Send&Receive is broken in v2.1.5?
Artem Rodygin
artem.rodygin at gmail.com
Wed Apr 20 16:57:32 CEST 2011
Pieter, Martin,
Please find attached test program. The sending part is taken as is
from <http://api.zeromq.org/2-1:zmq-send>. As far as I can see, the
problem is that "msg.flags" is zero after "zmq_msg_init_size", because
the line 468 at the "socket_base.cpp" thinks this means the message is
invalid:
if (unlikely ((msg_->flags | ZMQ_MSG_MASK) != 0xff)) {
I tried to add "msg.flags = 0xFF;" right before "zmq_send" and the
error is gone. So, I think there is one of two possible issues here:
1. Just like Martin has wrote, in a valid message all bits that are
not flags are set. In this case "zmq_msg_init", zmq_msg_init_data",
and "zmq_msg_init_size" should set these bits, while they are remained
clear.
2. In a valid message all bits that are not flags must be cleared (I'm
sorry, but it makes more sense for mey). In this case lines 468 and
513 in the "socket_base.cpp" file should be updated as I proposed
before.
I beg your pardon, if I'm just missing something. In this case please
do not hesitate to point me where I'm wrong.
Linux 2.6.35, GCC 4.4.4, ZeroMQ 2.1.5 is built from sources.
Best regards,
Artem
2011/4/21 Pieter Hintjens <ph at imatix.com>:
> Any of the included test programs will work; you can get the branch
> from https://github.com/zeromq/zeromq2-1/commits/v2.1.5
>
> It fails at 'make check'.
>
> -Pieter
>
> On Wed, Apr 20, 2011 at 4:18 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
>> Pieter,
>>
>> Wait a sec. The patch is not correct. I need a test program to fix the thing
>> properly.
>>
>> Martin
>>
>> On 04/20/2011 04:14 PM, Pieter Hintjens wrote:
>>>
>>> Artem,
>>>
>>> Thanks for identifying this error. I'm assuming it's a bug in some new
>>> code that checks zmq_msg_t's for validity. The error is in libzmq
>>> master, and was pushed downstream to the 2.1 branch without sufficient
>>> checking. Mea maxima culpa.
>>>
>>> I'm making a new 2.1.5 release now with your patch, which indeed fixes
>>> the tests.
>>>
>>> -Pieter
>>>
>>> On Wed, Apr 20, 2011 at 3:35 PM, Artem Rodygin<artem.rodygin at gmail.com>
>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I have upgraded to v2.1.5 (was 2.1.4 before), rebuilt my application,
>>>> and my unit-test suite returned a lot of failures after that.
>>>> I took a look at the delta between 2.1.4 and 2.1.5 - maybe I don't
>>>> understand the idea, but probably you meant:
>>>>
>>>> if (unlikely ((msg_->flags | ZMQ_MSG_MASK) != ZMQ_MSG_MASK)) {
>>>>
>>>> instead of:
>>>>
>>>> if (unlikely ((msg_->flags | ZMQ_MSG_MASK) != 0xff)) {
>>>>
>>>> This appears twice (lines 468 and 513) in the "socket_base.cpp". When
>>>> I changed these two lines as I described above - everything started to
>>>> work fine.
>>>>
>>>> Please let me know, what do you tihink.
>>>>
>>>> Thank you,
>>>> Artem
>>>>
>>>> P.S. I have raised new issue #197 at github, and just informing about
>>>> it by this email as advised at the "Report an Issue" how-to on the
>>>> site.
>>>> _______________________________________________
>>>> zeromq-dev mailing list
>>>> zeromq-dev at lists.zeromq.org
>>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>>
>>>>
>>> _______________________________________________
>>> zeromq-dev mailing list
>>> zeromq-dev at lists.zeromq.org
>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 197.cc
Type: application/octet-stream
Size: 1123 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110421/33a98129/attachment.obj>
More information about the zeromq-dev
mailing list