zeromq / zeromq4-x

ØMQ 4.x stable release branch - bug fixes only
GNU General Public License v3.0
458 stars 196 forks source link

crash happened in zeromq-4.1.4 #163

Closed tianchao-haohan closed 7 years ago

tianchao-haohan commented 7 years ago

OS: Centos 7.1.1503 zeromq-4.1.4-5.el7.x86_64

0 0x00007fb0976271d7 in raise () from /lib64/libc.so.6

1 0x00007fb0976288c8 in abort () from /lib64/libc.so.6

2 0x00007fb097666f07 in __libc_message () from /lib64/libc.so.6

3 0x00007fb09766e503 in _int_free () from /lib64/libc.so.6

4 0x00007fb0973a69f5 in zmq::msg_t::close() () from /lib64/libzmq.so.5

5 0x00007fb0973d3d51 in zmq::encoder_base_t::encode(unsigned char**, unsigned long) () from /lib64/libzmq.so.5

6 0x00007fb0973c83d6 in zmq::stream_engine_t::out_event() () from /lib64/libzmq.so.5

7 0x00007fb0973bdc33 in zmq::session_base_t::read_activated(zmq::pipe_t*) () from /lib64/libzmq.so.5

8 0x00007fb0973a0a5c in zmq::io_thread_t::in_event() () from /lib64/libzmq.so.5

9 0x00007fb09739d39e in zmq::epoll_t::loop() () from /lib64/libzmq.so.5

10 0x00007fb0973d13a6 in thread_routine () from /lib64/libzmq.so.5

11 0x00007fb098876dc5 in start_thread () from /lib64/libpthread.so.0

12 0x00007fb0976e976d in clone () from /lib64/libc.so.6

Error in `/usr/sbin/ntrace': free(): invalid next size (normal): 0x00007fb00c017900 ======= Backtrace: ========= /lib64/libc.so.6(+0x7c503)[0x7fb09766e503] /lib64/libzmq.so.5(+0x299f5)[0x7fb0973a69f5] /lib64/libzmq.so.5(+0x56d51)[0x7fb0973d3d51] /lib64/libzmq.so.5(+0x4b3d6)[0x7fb0973c83d6] /lib64/libzmq.so.5(+0x40c33)[0x7fb0973bdc33] /lib64/libzmq.so.5(+0x23a5c)[0x7fb0973a0a5c] /lib64/libzmq.so.5(+0x2039e)[0x7fb09739d39e] /lib64/libzmq.so.5(+0x543a6)[0x7fb0973d13a6] /lib64/libpthread.so.0(+0x7dc5)[0x7fb098876dc5] /lib64/libc.so.6(clone+0x6d)[0x7fb0976e976d] ======= Memory map: ======== 00400000-00445000 r-xp 00000000 fd:00 34374393 /usr/sbin/ntrace 00644000-00645000 r--p 00044000 fd:00 34374393 /usr/sbin/ntrace 00645000-00646000 rw-p 00045000 fd:00 34374393 /usr/sbin/ntrace 00646000-0064f000 rw-p 00000000 00:00 0 0142f000-015ee000 rw-p 00000000 00:00 0 [heap]

bluca commented 7 years ago

1) Wrong Github repository: https://github.com/zeromq/zeromq4-1/issues 2) Are you using the same socket from multiple threads? 3) Are you closing a message after sending it, without checking if the send failed first? 4) Can you provide a minimal example that reproduces your problem?

tianchao-haohan commented 7 years ago

@bluca Thanks Bluca. The issue can't reproducible until now. It was used under multiple threads scenario. So, maybe it was cuased by 2 or 3 you mentioned above. I will try to dig out more if it happened again. Thanks!

bluca commented 7 years ago

Note that as the documentation says, individual sockets are not thread safe and cannot be used from multiple threads, you must create, use and close them from the same thread