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

Erasure of retired fd's in select.cpp causes an assertion in MSVC 2008 STL #55

Closed
MikaelKjaer opened this issue Aug 31, 2010 · 1 comment

Comments

@MikaelKjaer
Copy link

I was hitting an issue with an SCL enabled STL library in connection with the way select_t::loop was erasing retired fd's. The problem as identified by the SCL assertion was that by the time the iterator given to the erase method was called it was considered invalid by the library. I am not sure this isn't just a "quirk" of the MSVC STL library as the other code looks valid to me as well.

But I put in a more common way to perform the erase by getting a new valid iterator from it when it is done to continue with. I have run the patch on 32-bit Windows but there is nothing platform specific about the proposed solution:

    if (retired) {
        fd_set_t::iterator it = fds.begin();
        while (it != fds.end()) {
            if (it->fd == retired_fd) {
                it = fds.erase(it);
            }
            else {
                it++;
            }
        }
        retired = false;
    }
@sustrik
Copy link
Member

sustrik commented Sep 1, 2010

Fixed in 59315eb

csrl pushed a commit to exosite-archive/zeromq2 that referenced this issue Dec 22, 2012
drahosp pushed a commit to LuaDist/libzmq that referenced this issue Feb 13, 2014
…om_zmq_h

Older versions of C compilers don't like C++ comments
benjdero pushed a commit to benjdero/libzmq that referenced this issue Feb 20, 2023
This issue was closed.
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

No branches or pull requests

2 participants