{"action":"reopened","issue":{"url":"https://api.github.com/repos/nanomsg/nanomsg/issues/469","labels_url":"https://api.github.com/repos/nanomsg/nanomsg/issues/469/labels{/name}","comments_url":"https://api.github.com/repos/nanomsg/nanomsg/issues/469/comments","events_url":"https://api.github.com/repos/nanomsg/nanomsg/issues/469/events","html_url":"https://github.com/nanomsg/nanomsg/issues/469","id":108522825,"number":469,"title":"assertion failure in ipc_shutdown","user":{"login":"europelee","id":5900089,"avatar_url":"https://avatars.githubusercontent.com/u/5900089?v=3","gravatar_id":"","url":"https://api.github.com/users/europelee","html_url":"https://github.com/europelee","followers_url":"https://api.github.com/users/europelee/followers","following_url":"https://api.github.com/users/europelee/following{/other_user}","gists_url":"https://api.github.com/users/europelee/gists{/gist_id}","starred_url":"https://api.github.com/users/europelee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/europelee/subscriptions","organizations_url":"https://api.github.com/users/europelee/orgs","repos_url":"https://api.github.com/users/europelee/repos","events_url":"https://api.github.com/users/europelee/events{/privacy}","received_events_url":"https://api.github.com/users/europelee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-27T08:48:14Z","updated_at":"2015-10-23T06:12:51Z","closed_at":null,"body":"Hi guys:\r\nI run example tests/ipc_shutdown with the 0.6-beta version codes ( Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-32-generic x86_64)),\r\nand sometimes it fails: \r\nsrc=0 type=33988\r\nAssertion failed: src == NN_SOCK_SRC_EP && type == NN_EP_STOPPED (src/core/sock.c:839).\r\nthe analysis:\r\n1.\r\nipc_shutdown.c already had signal(SIGPIPE, SIG_IGN); so it is not the problem(tcp_shutdown & ipc_shutdown failures (Solaris/illumos) #394).\r\n2.\r\nI found that nn_sock_shutdown solved the problem on the old version as the below:\r\n    default:\r\n        if (type == NN_PIPE_STARTED || type == NN_PIPE_IN || type == NN_PIPE_OUT) {\r\n            /*  Silently ignore connection acknowledgement during shutdown.\r\n                This is an infrequent, benign race condition when an endpoint\r\n                async connection starts just before the bound endpoint is\r\n                closed or zombified, and the connection succeeds while the\r\n                socket is still shutting down (nominally, while other endpoints\r\n                continue to shut down). srcptr should be a valid nn_pipebase. */\r\n            nn_assert (srcptr);\r\n            break;\r\nbut the current version why not?\r\ninstead:\r\n\r\n   834     if (nn_slow (sock->state == NN_SOCK_STATE_STOPPING_EPS)) {\r\n   835\r\n   836         /*  Endpoint is stopped. Now we can safely deallocate it. */\r\n   837         if (!(src == NN_SOCK_SRC_EP && type == NN_EP_STOPPED)) {\r\n   838             fprintf (stderr, \"src=%d type=%d\\n\", (int) src, (int) type);\r\n   839             nn_assert (src == NN_SOCK_SRC_EP && type == NN_EP_STOPPED);\r\n   840         }\r\n"}}