{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/3169","repository_url":"https://api.github.com/repos/zeromq/libzmq","labels_url":"https://api.github.com/repos/zeromq/libzmq/issues/3169/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/libzmq/issues/3169/comments","events_url":"https://api.github.com/repos/zeromq/libzmq/issues/3169/events","html_url":"https://github.com/zeromq/libzmq/issues/3169","id":333787747,"node_id":"MDU6SXNzdWUzMzM3ODc3NDc=","number":3169,"title":"signaler.send aborts intermittently","user":{"login":"neel-parikh","id":13759827,"node_id":"MDQ6VXNlcjEzNzU5ODI3","avatar_url":"https://avatars3.githubusercontent.com/u/13759827?v=4","gravatar_id":"","url":"https://api.github.com/users/neel-parikh","html_url":"https://github.com/neel-parikh","followers_url":"https://api.github.com/users/neel-parikh/followers","following_url":"https://api.github.com/users/neel-parikh/following{/other_user}","gists_url":"https://api.github.com/users/neel-parikh/gists{/gist_id}","starred_url":"https://api.github.com/users/neel-parikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neel-parikh/subscriptions","organizations_url":"https://api.github.com/users/neel-parikh/orgs","repos_url":"https://api.github.com/users/neel-parikh/repos","events_url":"https://api.github.com/users/neel-parikh/events{/privacy}","received_events_url":"https://api.github.com/users/neel-parikh/received_events","type":"User","site_admin":false},"labels":[{"id":361093800,"node_id":"MDU6TGFiZWwzNjEwOTM4MDA=","url":"https://api.github.com/repos/zeromq/libzmq/labels/Area%20(Runtime%20/%20Usage)","name":"Area (Runtime / Usage)","color":"d4c5f9","default":false},{"id":361105095,"node_id":"MDU6TGFiZWwzNjExMDUwOTU=","url":"https://api.github.com/repos/zeromq/libzmq/labels/Platform%20(linux/generic)","name":"Platform (linux/generic)","color":"bfd4f2","default":false},{"id":675552804,"node_id":"MDU6TGFiZWw2NzU1NTI4MDQ=","url":"https://api.github.com/repos/zeromq/libzmq/labels/Symptom%20(Assertion%20failure)","name":"Symptom (Assertion failure)","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-06-19T18:28:33Z","updated_at":"2018-06-20T17:04:53Z","closed_at":"2018-06-20T16:36:56Z","author_association":"NONE","body":"# Issue description\r\nWe are seeing intermittently process crashing with EBADF error code on signaler.send() call. The core file backtrace shows that the value of file descriptor \"w\" is -1 which means it's already closed and the thread is trying to write on the already closed FD.\r\n\r\nThere is no context sharing between the threads, everything happens in the same thread.\r\nOnly thing I observed is reaper thread is aborted due to invalid \"w\" value as the io thread closed the file descriptor.\r\n\r\n# Environment\r\nUsing libzmq v4.2.0\r\nLinux OS\r\n\r\n# Minimal test code / Steps to reproduce the issue\r\nThis issue is intermittent and hard to reproduce all the time.\r\n\r\n# What's the actual result? (include assertion message & call stack if applicable)\r\nBelow is the stack trace:\r\n\r\n```\r\nThread 2: IO Thread\r\n(gdb) t 2\r\n[Switching to thread 2 (LWP 29017)]\r\n#0  0x43a11598 in write () from ./105197/1418/lib/libpthread.so.0\r\n(gdb) bt\r\nPython Exception <type 'exceptions.ImportError'> No module named gdb.frames: \r\n#0  0x43a11598 in write () from ./105197/1418/lib/libpthread.so.0\r\n#1  0x43eb7094 in zmq::signaler_t::send (this=this@entry=0x2cfbc) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/signaler.cpp:180\r\n#2  0x43e9e808 in zmq::mailbox_t::send (this=0x2cf88, cmd_=...) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/mailbox.cpp:66\r\n#3  0x43ea6854 in send_command (cmd_=..., this=<optimized out>) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/object.cpp:436\r\n#4  zmq::object_t::send_term_ack (this=this@entry=0x33910, destination_=<optimized out>) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/object.cpp:318\r\n#5  0x43ea8be4 in zmq::own_t::check_term_acks (this=0x33910) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/own.cpp:205\r\n#6  0x43eb6cd8 in zmq::session_base_t::pipe_terminated (this=0x33910, pipe_=<optimized out>) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/session_base.cpp:268\r\n#7  0x43eaa280 in zmq::pipe_t::process_pipe_term_ack (this=0x33da8) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/pipe.cpp:347\r\n#8  0x43e9b494 in zmq::io_thread_t::in_event (this=0x2c938) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/io_thread.cpp:85\r\n#9  0x43e99f68 in zmq::epoll_t::loop (this=0x2ce58) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/epoll.cpp:179\r\n#10 0x43ecaedc in thread_routine (arg_=0x2cea4) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/thread.cpp:100\r\n#11 0x43a06068 in ?? () from ./105197/1418/lib/libpthread.so.0\r\nBacktrace stopped: previous frame identical to this frame (corrupt stack?)\r\n(gdb) frame 1\r\n#1  0x43eb7094 in zmq::signaler_t::send (this=this@entry=0x2cfbc) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/signaler.cpp:180\r\n180\tin /usr/src/debug/libzmq/4.2.0-r0.0/git/src/signaler.cpp\r\n_(gdb) p w\r\n$5 = 21_\r\n(gdb) \r\n\r\nThread 1: Reaper Thread\r\n(gdb) t 1\r\n[Switching to thread 1 (LWP 29016)]\r\n#0  0x438bc6d4 in raise () from ./105197/1418/lib/libc.so.6\r\n(gdb) bt\r\nPython Exception <type 'exceptions.ImportError'> No module named gdb.frames: \r\n#0  0x438bc6d4 in raise () from ./105197/1418/lib/libc.so.6\r\n#1  0x438bda30 in abort () from ./105197/1418/lib/libc.so.6\r\n#2  0x43e9a2ac in zmq::zmq_abort (errmsg_=errmsg_@entry=0x439aeeb8 \"Bad file descriptor\") at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/err.cpp:91\r\n#3  0x43eb70f0 in zmq::signaler_t::send (this=this@entry=0x2bdc0) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/signaler.cpp:181\r\n#4  0x43e9e808 in zmq::mailbox_t::send (this=0x2bd8c, cmd_=...) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/mailbox.cpp:66\r\n#5  0x43ea6958 in zmq::object_t::send_done (this=this@entry=0x2c308) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/object.cpp:351\r\n#6  0x43eb1100 in zmq::reaper_t::process_reaped (this=0x2c308) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/reaper.cpp:138\r\n#7  0x43eb1400 in zmq::reaper_t::in_event (this=0x2c308) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/reaper.cpp:97\r\n#8  0x43e99f68 in zmq::epoll_t::loop (this=0x2c830) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/epoll.cpp:179\r\n#9  0x43ecaedc in thread_routine (arg_=0x2c87c) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/thread.cpp:100\r\n#10 0x43a06068 in ?? () from ./105197/1418/lib/libpthread.so.0\r\nBacktrace stopped: previous frame identical to this frame (corrupt stack?)\r\n(gdb) frame 3\r\n#3  0x43eb70f0 in zmq::signaler_t::send (this=this@entry=0x2bdc0) at /usr/src/debug/libzmq/4.2.0-r0.0/git/src/signaler.cpp:181\r\n181\tin /usr/src/debug/libzmq/4.2.0-r0.0/git/src/signaler.cpp\r\n_(gdb) p w\r\n$7 = -1_\r\n(gdb) \r\n```\r\n\r\nCan you please take a look and provide any suggestion on how to avoid this scenario?\r\nI'm thinking if we could add some error check instead of aborting?\r\n\r\nAppreciate your help.\r\n\r\nThanks.\r\n"},"comment":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/comments/398824811","html_url":"https://github.com/zeromq/libzmq/issues/3169#issuecomment-398824811","issue_url":"https://api.github.com/repos/zeromq/libzmq/issues/3169","id":398824811,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODgyNDgxMQ==","user":{"login":"bluca","id":782193,"node_id":"MDQ6VXNlcjc4MjE5Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/782193?v=4","gravatar_id":"","url":"https://api.github.com/users/bluca","html_url":"https://github.com/bluca","followers_url":"https://api.github.com/users/bluca/followers","following_url":"https://api.github.com/users/bluca/following{/other_user}","gists_url":"https://api.github.com/users/bluca/gists{/gist_id}","starred_url":"https://api.github.com/users/bluca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluca/subscriptions","organizations_url":"https://api.github.com/users/bluca/orgs","repos_url":"https://api.github.com/users/bluca/repos","events_url":"https://api.github.com/users/bluca/events{/privacy}","received_events_url":"https://api.github.com/users/bluca/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T17:04:53Z","updated_at":"2018-06-20T17:04:53Z","author_association":"MEMBER","body":"There is no dependency (but you need to move from 3.x at some point, it's not maintained anymore)"}}
{"actor":{"display_login":"bluca"}}