Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: Assertion failed in zmq::signaler_t::send #2360

Merged
merged 1 commit into from
Mar 3, 2017
Merged

Problem: Assertion failed in zmq::signaler_t::send #2360

merged 1 commit into from
Mar 3, 2017

Conversation

10-5
Copy link
Contributor

@10-5 10-5 commented Mar 3, 2017

Solution: Change to the way it does below on non-Windows platforms, retry when send returns -1.

Solution: Change to the way it does below on non-Windows platforms, retry when send returns -1.
@bluca bluca merged commit 34be53d into zeromq:master Mar 3, 2017
@bluca
Copy link
Member

bluca commented Mar 3, 2017

Thank you!

@hartcw
Copy link

hartcw commented Aug 9, 2017

I see a similar abort from zmq_connect() on windows, but the callstack shows it happens in zmq::signaler_t::recv().

I suspect a similar fix is needed there, to handle the case where ::recv() returns an unexpected value.

@bluca
Copy link
Member

bluca commented Aug 9, 2017

Could you please test a fix and send a PR, if it solves your problem?

@bjovke
Copy link
Contributor

bjovke commented Aug 9, 2017

@nexcvon Are you sure that it's good to potentially loop forever if send () returns SOCKET_ERROR?
It is now the same behavior as before #2362 so it kind of reverts that PR.
Why should there be any asserts for failed send () if there's a possibility for it to fail?
assert () is used only to protect the program from highly irregular behavior. I'm not sure that failure on send () fits into that category...
And what are the guarantees that it will succeed if retried?
On Linux in the same function there's this code:

errno = EINTR;
break;

So it is possible to just set errno and return in case of send () error?
Furthermore, zmq_assert (nbytes == sizeof (dummy)); might also be the cause of troubles on Windows.
I'm not 100% familiar with libzmq internals, but if code looks strange on first sight there's a high potential that it actually is not good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants