-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Assertion failure: !(pollset [i].revents & POLLNVAL) (poll.cpp:157) #2895
Comments
I investigated where an INVALID_SOCKET might come from and found the following:
|
A similar situation is here: Line 1330 in 4518e0c
Maybe fd can never be retired_fd/-1 here for some reason, but then an assertion should be added here. |
I tried to create a large number of context, and one socket in each context. After about 4000 contexts/sockets, zmq_socket fails with an error code of ENOBUFS, which is out of the specified behaviour of zmq_socket. However, probably the same error might occur during make_fdpair. This is most probably caused by the global limit of ephemeral ports being exceeded (https://blogs.technet.microsoft.com/tristank/2008/03/11/maxuserport-what-it-is-what-it-does-when-its-important/). The appropriate reaction would be to retry after some time IMO. |
With the following code I was able to trigger the problem zmq::signaler_t:
I then get an assertion failure here:
i.e. here: Line 192 in 4518e0c
and the socket was retired_fd, so make_fdpair has failed in the ctor. |
On at least once attempt, I got a socket error WSAENOBUFS from this call: Line 525 in 4518e0c
This should either fail the whole zmq_socket call, and leave a consistent state, or retry (or both). |
Not completely fixed, as seen e.g. in https://ci.appveyor.com/project/sigiesec/libzmq/build/build-378/job/0hkiqeywv9op2a9w#L1183 |
I'm also having this same problem with 4.2.3 with ZMQ_USE_POLL |
It's fixed in 4.2.5 |
@Crypto2 Note however that poller=poll is broken on Windows, and will no longer be offered as an option in master. Either use poller=select with 4.2.5, or poller=epoll with master, support for which was only recently added under Windows. |
Issue description
An assertion failure occurs in the following line:
libzmq/src/poll.cpp
Line 157 in 3226b8e
The fd member of the offending entry in pollset in that case has the value -1 / retired_fd.
Apparently, this was already the case when poll was called, which caused poll to set the revents of the entry to POLLNVAL.
I found that it is possible to call add_fd with a fd_ parameter of retired_fd/-1, which is not checked, so I assume this has happened somehow, but I do not know via which call chain this happened.
Environment
Minimal test code / Steps to reproduce the issue
Unfortunately, I have not been able to reproduce this issue. It occurs if some networking issues happen, such as firewall configurations between peers change, or the local network settings are reconfigured. I don't know yet what exactly triggers the issue, but it has occurred several times on different machines.
What's the actual result? (include assertion message & call stack if applicable)
Assertion failure: !(pollset [i].revents & POLLNVAL) within a zmq::poll_t::worker_routine thread.
What's the expected result?
No assertion failure, operation continues.
The text was updated successfully, but these errors were encountered: