[zeromq-dev] Application gets hung at zmq::ctx_t::create_socket at ctx.cpp:228 call

pankaj modi pankaj.modi at live.com
Thu Jan 28 05:37:58 CET 2016


Hi,


I am using ZMQ version 3.2.2 on linux in Pub/Sub pattern, and it was working wonderfully till now.


I am using single context for around 130 subscriber threads, and if a subscriber thread doesn't receives any data for some duration (10  min) because of any environmental issue (n/w, pub down..),i am closing the socket and reinitializing the connection using the same shared context (As it's thread safe)

                 zmq_close(subscriber);

                 subscriber = zmq_socket (context_, ZMQ_SUB);


Recently I found that the application got hung, and all but one thread was waiting for the mutex.

This one thread was stuck while creating the zmq socket following is the backtrace:


Thread 121 (Thread 0x7f427a7fc700 (LWP 29844)):

#0  0x00007f439288661b in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#1  0x00007f4392809591 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#2  0x00007f43928072b7 in malloc () from /lib/x86_64-linux-gnu/libc.so.6

#3  0x00007f439398c900 in ?? () from /lib64/ld-linux-x86-64.so.2

#4  0x00007f43939928a9 in ?? () from /lib64/ld-linux-x86-64.so.2

#5  0x00007f439398e176 in ?? () from /lib64/ld-linux-x86-64.so.2

#6  0x00007f439399231a in ?? () from /lib64/ld-linux-x86-64.so.2

#7  0x00007f43928b5292 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#8  0x00007f439398e176 in ?? () from /lib64/ld-linux-x86-64.so.2

#9  0x00007f43928b5354 in __libc_dlopen_mode () from /lib/x86_64-linux-gnu/libc.so.6

#10 0x00007f439288f4d5 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#11 0x00007f439376f400 in pthread_once () from /lib/x86_64-linux-gnu/libpthread.so.0

#12 0x00007f439288f5f4 in backtrace () from /lib/x86_64-linux-gnu/libc.so.6

#13 0x00007f43927f862f in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#14 0x00007f4392802e16 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#15 0x00007f4392803180 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#16 0x00007f4392804716 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

#17 0x00007f43928072c5 in malloc () from /lib/x86_64-linux-gnu/libc.so.6

#18 0x00007f439310bead in operator new(unsigned long, std::nothrow_t const&) () from /usr/lib/libstdc++.so.6

#19 0x0000000000c29c32 in zmq::socket_base_t::create (type_=<optimized out>, parent_=0x50d0f80, tid_=85, sid_=427) at socket_base.cpp:93

#20 0x0000000000c23739 in zmq::ctx_t::create_socket (this=0x50d0f80, type_=2) at ctx.cpp:228


Am i missing something in using context properly or creating socket?



Thanks & Regards,
~pankaj.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160128/9cb8967c/attachment.htm>


More information about the zeromq-dev mailing list