[zeromq-dev] Memory Leak using 0MQ 3.0.2

Benoit Laplante benoit.laplante at scigilian.com
Mon Oct 31 16:21:40 CET 2011


Hi,

I detected a small memory leak (76 bytes) when a socket identity is greater
than 29 chars on a DEALER socket. I was unable to reproduce this leak on a
small test case. The leak only appears on my integration tests using my
implemented version of a async majordomo server ( DEALER <--> ROUTER ).
This is the stack trace using Visual Leak Detector Win64 with
 "19d773fe-5f0e-41b4-91c4-747a863d 6f92" as the socket identity :

WARNING: Visual Leak Detector detected memory leaks!
---------- Block 2988 at 0x0000000000497E60: 76 bytes ----------
  Call Stack:
    c:\users\benoit\git\analyze\zeromq-3.0.2\src\msg.cpp (62):
libzmq.dll!zmq::msg_t::init_size + 0x12 bytes
    c:\users\benoit\git\analyze\zeromq-3.0.2\src\decoder.cpp (76):
libzmq.dll!zmq::decoder_t::one_byte_size_ready + 0x24 bytes
    c:\users\benoit\git\analyze\zeromq-3.0.2\src\decoder.hpp (122):
libzmq.dll!zmq::decoder_base_t<zmq::decoder_t>::process_buffer + 0x28 bytes
    c:\users\benoit\git\analyze\zeromq-3.0.2\src\zmq_engine.cpp (126):
libzmq.dll!zmq::zmq_engine_t::in_event + 0x23 bytes
    c:\users\benoit\git\analyze\zeromq-3.0.2\src\select.cpp (191):
libzmq.dll!zmq::select_t::loop
    c:\users\benoit\git\analyze\zeromq-3.0.2\src\select.cpp (205):
libzmq.dll!zmq::select_t::worker_routine
    c:\users\benoit\git\analyze\zeromq-3.0.2\src\thread.cpp (33):
libzmq.dll!thread_routine
    f:\dd\vctools\crt_bld\self_64_amd64\crt\src\threadex.c (314):
MSVCR100D.dll!_callthreadstartex + 0x17 bytes
    f:\dd\vctools\crt_bld\self_64_amd64\crt\src\threadex.c (297):
MSVCR100D.dll!_threadstartex
    0x000000007711652D (File and line number not available):
kernel32.dll!BaseThreadInitThunk + 0xD bytes
    0x000000007734C521 (File and line number not available):
ntdll.dll!RtlUserThreadStart + 0x21 bytes
  Data:
    88 7E 49 00    00 00 00 00    24 00 00 00    00 00 00 00     .~I.....
$.......
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........
........
    00 00 00 00    CD CD CD CD    31 39 64 37    37 33 66 65     ........
19d773fe
    2D 35 66 30    65 2D 34 31    62 34 2D 39    31 63 34 2D     -5f0e-41
b4-91c4-
    37 34 37 61    38 36 33 64    36 66 39 32                    747a863d
6f92....
---------------------------------------------------------------------------------------------------------------------------------------------------------

We can see the socket identity in the memory printable string.  I repeat,
there is no memory leak if the identity is less than 30 chars.

Benoit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20111031/510c35c1/attachment.htm>


More information about the zeromq-dev mailing list