{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/2674","repository_url":"https://api.github.com/repos/zeromq/libzmq","labels_url":"https://api.github.com/repos/zeromq/libzmq/issues/2674/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/libzmq/issues/2674/comments","events_url":"https://api.github.com/repos/zeromq/libzmq/issues/2674/events","html_url":"https://github.com/zeromq/libzmq/issues/2674","id":249634403,"number":2674,"title":"zmq::encoder_base_t segmentation fault","user":{"login":"jnadelman","id":30929219,"avatar_url":"https://avatars2.githubusercontent.com/u/30929219?v=4","gravatar_id":"","url":"https://api.github.com/users/jnadelman","html_url":"https://github.com/jnadelman","followers_url":"https://api.github.com/users/jnadelman/followers","following_url":"https://api.github.com/users/jnadelman/following{/other_user}","gists_url":"https://api.github.com/users/jnadelman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnadelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnadelman/subscriptions","organizations_url":"https://api.github.com/users/jnadelman/orgs","repos_url":"https://api.github.com/users/jnadelman/repos","events_url":"https://api.github.com/users/jnadelman/events{/privacy}","received_events_url":"https://api.github.com/users/jnadelman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-08-11T13:23:34Z","updated_at":"2017-08-15T21:48:51Z","closed_at":null,"body":"Got a segmentation fault in zmq::encoder_base_t at encoder.hpp:127 after 25.9 hours of operation and 11,393,496 messages. I probably will not be able to provide a minimal reproducible example. Is there a debug or logging mode I can run zmq in to provide more information? Has anything been fixed in the code base between libzmq 4.2.1 and 4.2.2 that might address this? I didn't see anything that looked related in the [release notes](https://github.com/zeromq/libzmq/releases).\r\n\r\nEnvironment\r\n\r\n- libzmq 4.2.1\r\n- OS: CentOS Linux 7 (Core)\r\n- Kernel: Linux 3.18.4\r\n- Architecture: x86-64\r\n\r\nCoredump backtrace:\r\n\r\n```\r\n118\t\tmovdqu\t-16(%rsi, %rdx), %xmm0\r\n#0  __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:118\r\n#1  0x00007f35c64f2c90 in zmq::encoder_base_t<zmq::v2_encoder_t>::encode (this=0x7f35b008dd90, data_=0x7f35be7fb128, \r\n    size_=<optimized out>) at src/encoder.hpp:127\r\n#2  0x00007f35c64e404f in zmq::stream_engine_t::out_event (this=0x7f35b0085250) at src/stream_engine.cpp:395\r\n#3  0x00007f35c64d7d66 in zmq::session_base_t::read_activated (this=0x7f35b00856e0, pipe_=0x7f35b008dbb0)\r\n    at src/session_base.cpp:286\r\n#4  0x00007f35c64bd704 in zmq::io_thread_t::in_event (this=0x1344aa0) at src/io_thread.cpp:85\r\n#5  0x00007f35c64bc18e in zmq::epoll_t::loop (this=0x13454e0) at src/epoll.cpp:188\r\n#6  0x00007f35c64ed945 in thread_routine (arg_=0x1345560) at src/thread.cpp:100\r\n#7  0x00007f35c6283dc5 in start_thread (arg=0x7f35be7fc700) at pthread_create.c:308\r\n#8  0x00007f35c527873d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/comments/322599480","html_url":"https://github.com/zeromq/libzmq/issues/2674#issuecomment-322599480","issue_url":"https://api.github.com/repos/zeromq/libzmq/issues/2674","id":322599480,"user":{"login":"jnadelman","id":30929219,"avatar_url":"https://avatars2.githubusercontent.com/u/30929219?v=4","gravatar_id":"","url":"https://api.github.com/users/jnadelman","html_url":"https://github.com/jnadelman","followers_url":"https://api.github.com/users/jnadelman/followers","following_url":"https://api.github.com/users/jnadelman/following{/other_user}","gists_url":"https://api.github.com/users/jnadelman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnadelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnadelman/subscriptions","organizations_url":"https://api.github.com/users/jnadelman/orgs","repos_url":"https://api.github.com/users/jnadelman/repos","events_url":"https://api.github.com/users/jnadelman/events{/privacy}","received_events_url":"https://api.github.com/users/jnadelman/received_events","type":"User","site_admin":false},"created_at":"2017-08-15T21:48:51Z","updated_at":"2017-08-15T21:48:51Z","body":"Still crashing. Built with no optimizations and extra debug but still see `size = <optimized out>` in #4  zmq::v2_encoder_t::message_ready. As a big picture, the system is XPUB/XSUB with one (1) client and four (4) servers. One thread is exchanging about 124 small (< 1k) messages per second between the client and one of the servers. Another thread periodically exchanges a heartbeat with all (4) servers. I was able to decrease the time to fail by decreasing the heartbeat period from 10s to 100ms. \r\n\r\n```\r\nProgram received signal SIGABRT, Aborted.\r\n[Switching to Thread 0x7fffeffff700 (LWP 22526)]\r\n0x00007ffff68791d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56\r\n56\t  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);\r\n(gdb) bt full\r\n#0  0x00007ffff68791d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56\r\n        resultvar = 0\r\n        pid = 22513\r\n        selftid = 22526\r\n#1  0x00007ffff687a8c8 in __GI_abort () at abort.c:90\r\n        save_stage = 2\r\n        act = {__sigaction_handler = {sa_handler = 0x7fffe80276e0, sa_sigaction = 0x7fffe80276e0}, sa_mask = {__val = {7285744, 140737219911976, 140737351983296, 140737219911976, 140737351983296, 511101108348, 140737085702176, \r\n              140736884388224, 140737349486946, 140737086310824, 140737086191264, 0, 140737330203773, 0, 140737333168624, 140737349679919}}, sa_flags = -268437760, sa_restorer = 0x2b}\r\n        sigs = {__val = {32, 0 <repeats 15 times>}}\r\n#2  0x00007ffff7b7f619 in zmq::zmq_abort (errmsg_=errmsg_@entry=0x7ffff7bbfb2f \"check ()\") at src/err.cpp:87\r\nNo locals.\r\n#3  0x00007ffff7b878db in zmq::msg_t::size (this=0x7fffe80276e0) at src/msg.cpp:361\r\nNo locals.\r\n#4  0x00007ffff7bb5952 in zmq::v2_encoder_t::message_ready (this=0x7fffe80275e0) at src/v2_encoder.cpp:54\r\n        protocol_flags = @0x7fffe8027628: 0 '\\000'\r\n        size = <optimized out>\r\n#5  0x00007ffff7ba7021 in zmq::stream_engine_t::out_event (this=0x7fffe80276c0) at src/stream_engine.cpp:393\r\n        bufptr = 0x7fffe8030200 \"\"\r\n        n = <optimized out>\r\n        nbytes = <optimized out>\r\n#6  0x00007ffff7b9ad66 in zmq::session_base_t::read_activated (this=0x7fffe8027b50, pipe_=0x7fffe8030060) at src/session_base.cpp:286\r\nNo locals.\r\n#7  0x00007ffff7b80704 in zmq::io_thread_t::in_event (this=0x6f8aa0) at src/io_thread.cpp:85\r\n        cmd = {destination = 0x7fffe8030060, type = zmq::command_t::activate_read, args = {stop = {<No data fields>}, plug = {<No data fields>}, own = {object = 0x7ffff00048d0}, attach = {engine = 0x7ffff00048d0}, bind = {\r\n              pipe = 0x7ffff00048d0}, activate_read = {<No data fields>}, activate_write = {msgs_read = 140737219938512}, hiccup = {pipe = 0x7ffff00048d0}, pipe_term = {<No data fields>}, pipe_term_ack = {<No data fields>}, term_req = {\r\n              object = 0x7ffff00048d0}, term = {linger = -268416816}, term_ack = {<No data fields>}, reap = {socket = 0x7ffff00048d0}, reaped = {<No data fields>}, done = {<No data fields>}}}\r\n        rc = 0\r\n#8  0x00007ffff7b7f18e in zmq::epoll_t::loop (this=0x6f94e0) at src/epoll.cpp:188\r\n        pe = 0x6f7e00\r\n        i = <optimized out>\r\n        timeout = <optimized out>\r\n        n = <optimized out>\r\n        ev_buf = {{events = 1, data = {ptr = 0x6f7e00, fd = 7306752, u32 = 7306752, u64 = 7306752}}, {events = 1, data = {ptr = 0x7fffe8000dd0, fd = -402649648, u32 = 3892317648, u64 = 140737085705680}}, {events = 4, data = {\r\n              ptr = 0x7fffe8000c20, fd = -402650080, u32 = 3892317216, u64 = 140737085705248}}, {events = 4, data = {ptr = 0x7fffe8027450, fd = -402492336, u32 = 3892474960, u64 = 140737085862992}}, {events = 4, data = {\r\n              ptr = 0x7fffe8005ca0, fd = -402629472, u32 = 3892337824, u64 = 140737085725856}}, {events = 1, data = {ptr = 0x7fffe8000dd0, fd = -402649648, u32 = 3892317648, u64 = 140737085705680}}, {events = 0, data = {ptr = 0x0, \r\n              fd = 0, u32 = 0, u64 = 0}} <repeats 250 times>}\r\n```"}}
{"actor":{"display_login":"jnadelman"}}