[zeromq-dev] problem running two 0mq applications on one host side-by-side
Chris Dinn
cdinn at mdialog.com
Wed Apr 18 16:06:48 CEST 2012
This issue is now fixed on master. Using this fix, our tests are showing no longer showing message corruption.
https://github.com/kro/zeromq-scala-binding/commit/ed6c30199953ed6fc82ed779706fb88fb977c3cf
Thanks again for your help.
On 2012-04-16, at 12:17 PM, Pieter Hintjens wrote:
> Awesome...I'll add some explanation about this to the Guide.
>
> On Apr 16, 2012 9:07 AM, "Chris Dinn" <cdinn at mdialog.com> wrote:
>
> > The main cause (actually the only one I know) for corrupted messages
> > is when you send from a buffer (using zmq_msg_init_data) and then free
> > or reuse the buffer. Since data isn't copied, if the original buffer
> > isn't valid when the message actually gets sent (at some later point
> > by the I/O thread), it'll send garbage.
>
> Thanks for the tip Pieter, looks like you were exactly right. It appears that the Scala binding is using JNA to allocate a buffer for zmq_msg_init_data, but doing nothing to ensure that the buffer is still valid at the time the message is actually sent.
>
> https://github.com/kro/zeromq-scala-binding/blob/master/src/main/java/org/zeromq/ZMQ.java#L434
>
> I'm working on a fix now. Thanks again.
>
> --Chris
> _______________________________________________
> 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 --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120418/91f62b21/attachment.htm>
More information about the zeromq-dev
mailing list