Skip to content

Assertion failed after poll #4805

@cacharle

Description

@cacharle

I get the following assertion when receiving on a pull socket:

Assertion failed: pfd.revents & POLLIN (C:\Users\...\vcpkg\buildtrees\zeromq\src\v4.3.5-37c87b6b8c.clean\src\signaler.cpp:238)

Here is the code that raises the assertion:

void Foo::run(std::stop_token stopToken)
{
    _injester = zmq::socket_t(_context, zmq::socket_type::pull);
    _publisher = zmq::socket_t(_context, zmq::socket_type::pub);
    _publisher.bind("inproc://foo");
    _injester.bind("inproc://bar");
    _injester.set(zmq::sockopt::rcvtimeo, 1000);

    while (!stopToken.stop_requested()) {
        zmq::message_t message;
        auto recvResult = _injester.recv(message); // Assert failed here
        if (!recvResult.has_value()) // Timeout
            continue;
        // do stuff
    }
}

I see the assertion is raised in that file:

zmq_assert (pfd.revents & POLLIN);

I'm not too familiar with poll so I'm not sure how it's possible to get something else in that place.

I am on Windows This happens on Windows and Linux, running the v4.3.5 version of libzmq.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions