Thanks for the clear test case.

I've found the problem, which is a mix of poor documentation and poor
code. The zmq_sendmsg man page doesn't really explain what to do in
case of an error. However if the message can't be sent, then the
caller must free it. CZMQ doesn't do that.

It works for very small messages because these don't do a separate
allocation, they use the zmq_msg_t structure itself.

I'm patching CZMQ now and will make a pull request soon.

-Pieter

On Thu, Apr 3, 2014 at 9:59 AM, Procter,  Stephen
<[email protected]> wrote:
> Hi all,
>
> First, the obligatory note of thanks to Pieter and the 0MQ community for such 
> a beautiful artefact. I have finally managed to engineer an opportunity to 
> use 0MQ at work and am enjoying it immensely!
>
> On to business: I think I'm experiencing this issue (or at least a close 
> relation), first raised against v3.0.2:
>
>   http://lists.zeromq.org/pipermail/zeromq-dev/2011-October/014048.html
>
> I have reproduced it by connecting a PUSH and a PULL socket via inproc, 
> destroying the puller, and then trying to send a message via the pusher. The 
> leak only occurs if the message is at least 30 bytes in length; shorter 
> messages do not provoke a leak.
>
> Minimal test case (in CZMQ, as that's what I'm using, although it looks like 
> the issue is in 0MQ itself) and valgrind output here:
>
>   http://pastebin.com/nTcbQm3z
>
> Best regards,
>
> Steve
>
>
> This transmission is intended solely for the person or organization to whom 
> it is addressed. It may contain privileged and confidential information. If 
> you are not the intended recipient, you should not copy, distribute or take 
> any action in reliance on it. If you have received this transmission in 
> error, please notify us immediately by e-mail at [email protected]
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to