[zeromq-dev] Valgrind and ZMQ 4.0.4
Carlos Tangerino
carlos.tangerino at gmail.com
Thu Sep 25 09:45:38 CEST 2014
Not sure if someone has noticed that but I for this message when I create a SUB/PUB broker
==6536== Invalid write of size 4
==6536== at 0x4135C6B: zmq::pipe_t::set_hwms(int, int) (pipe.cpp:483)
==6536== by 0x411FED4: zmq::ctx_t::connect_inproc_sockets(zmq::socket_base_t*, zmq::options_t&, zmq::pending_connection_t&, zmq::ctx_t::side) (ctx.cpp:476)
==6536== by 0x412445C: zmq::ctx_t::connect_pending(char const*, zmq::socket_base_t*) (ctx.cpp:435)
==6536== by 0x413214D: zmq::object_t::connect_pending(char const*, zmq::socket_base_t*) (object.cpp:162)
==6536== by 0x4141D6B: zmq::socket_base_t::bind(char const*) (socket_base.cpp:347)
==6536== by 0x415431F: zmq_bind (zmq.cpp:309)
==6536== by 0x8053A3D: zmqBroker (broker.c:225)
==6536== by 0x8054114: broker (broker.c:592)
==6536== by 0x80587DE: main (ce50.c:468)
==6536== Address 0xa610b94 is 52 bytes inside a block of size 104 free'd
==6536== at 0x402B838: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6536== by 0x41351C3: zmq::pipe_t::~pipe_t() (pipe.cpp:87)
==6536== by 0x4134E72: zmq::pipe_t::process_pipe_term_ack() (pipe.cpp:334)
==6536== by 0x4131F7F: zmq::object_t::process_command(zmq::command_t&) (object.cpp:107)
==6536== by 0x413E65F: zmq::socket_base_t::process_commands(int, bool) (socket_base.cpp:904)
==6536== by 0x4142B4F: zmq::socket_base_t::in_event() (socket_base.cpp:1005)
==6536== by 0x4128A48: zmq::epoll_t::loop() (epoll.cpp:165)
==6536== by 0x414C2BF: thread_routine (thread.cpp:81)
==6536== by 0x409BF6F: start_thread (pthread_create.c:312)
==6536== by 0x426788D: clone (clone.S:129)
==6536==
==6536== Invalid write of size 4
==6536== at 0x4135C72: zmq::pipe_t::set_hwms(int, int) (pipe.cpp:484)
==6536== by 0x411FED4: zmq::ctx_t::connect_inproc_sockets(zmq::socket_base_t*, zmq::options_t&, zmq::pending_connection_t&, zmq::ctx_t::side) (ctx.cpp:476)
==6536== by 0x412445C: zmq::ctx_t::connect_pending(char const*, zmq::socket_base_t*) (ctx.cpp:435)
==6536== by 0x413214D: zmq::object_t::connect_pending(char const*, zmq::socket_base_t*) (object.cpp:162)
==6536== by 0x4141D6B: zmq::socket_base_t::bind(char const*) (socket_base.cpp:347)
==6536== by 0x415431F: zmq_bind (zmq.cpp:309)
==6536== by 0x8053A3D: zmqBroker (broker.c:225)
==6536== by 0x8054114: broker (broker.c:592)
==6536== by 0x80587DE: main (ce50.c:468)
==6536== Address 0xa610b90 is 48 bytes inside a block of size 104 free'd
==6536== at 0x402B838: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6536== by 0x41351C3: zmq::pipe_t::~pipe_t() (pipe.cpp:87)
==6536== by 0x4134E72: zmq::pipe_t::process_pipe_term_ack() (pipe.cpp:334)
==6536== by 0x4131F7F: zmq::object_t::process_command(zmq::command_t&) (object.cpp:107)
==6536== by 0x413E65F: zmq::socket_base_t::process_commands(int, bool) (socket_base.cpp:904)
==6536== by 0x4142B4F: zmq::socket_base_t::in_event() (socket_base.cpp:1005)
==6536== by 0x4128A48: zmq::epoll_t::loop() (epoll.cpp:165)
==6536== by 0x414C2BF: thread_routine (thread.cpp:81)
==6536== by 0x409BF6F: start_thread (pthread_create.c:312)
==6536== by 0x426788D: clone (clone.S:129)
static void zmqBroker(void) {
int rc;
int linger = 1000;
if (gDebug & DEB_ZMQ) log_info("ZMQ thread running");
void *frontend = zmq_socket(zmq_ctx, ZMQ_XSUB);
if (frontend == NULL) {
log_info ("Bad socket %s", zmq_strerror(errno));
}
assert(frontend);
zmq_setsockopt(frontend, ZMQ_LINGER, &linger, sizeof (linger));
rc = zmq_bind(frontend, "inproc://localhost:10000");
if (rc) {
log_err("Bind error");
assert(rc == 0);
}
void *backend = zmq_socket(zmq_ctx, ZMQ_XPUB);
assert(backend);
zmq_setsockopt(backend, ZMQ_LINGER, &linger, sizeof (linger));
rc = zmq_bind(backend, "inproc://localhost:10001”); // this is the line 225!
assert(rc == 0);
zmq_proxy(frontend, backend, NULL);
zmq_close(frontend);
zmq_close(backend);
log_info("ZMQ thread ended");
}
Carlos Tangerino
carlos.tangerino at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140925/26c4dd68/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2568 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140925/26c4dd68/attachment.bin>
More information about the zeromq-dev
mailing list