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

Assertion failed: fetched (xrep.cpp:196) #38

Closed
bwbuchanan opened this issue Jun 27, 2010 · 9 comments
Closed

Assertion failed: fetched (xrep.cpp:196) #38

bwbuchanan opened this issue Jun 27, 2010 · 9 comments

Comments

@bwbuchanan
Copy link
Contributor

When a client of an XREP socket disconnects, this assertion fails. Code to reproduce to follow. According to git-bisect, the bug was introduced by commit 10c28c1:

Author: Martin Hurton <hurtonm@gmail.com>
Date:   Sat Jun 19 20:46:16 2010 +0200

    Revive reader on pipe termination
@bwbuchanan
Copy link
Contributor Author

@ellisonbg
Copy link

I see this one as well.

@mato
Copy link
Contributor

mato commented Jul 1, 2010

I get this with stock 2.0.7 as well as current git, so it doesn't seem to be related to the mentioned commit. As a workaround, setting the IDENTITY of the client (REQ/XREQ) socket makes the problem go away.

Martin Sustrik is away until mid next-week, I will remind him to take a look at this when he gets back.

@bwbuchanan
Copy link
Contributor Author

The specific test case I linked to above is definitely triggered by this commit in my environment, as confirmed by git-bisect. Reverting that change from current git makes the test case succeed for me. Perhaps this is a race condition, or there are multiple ways to trigger the bug.

@echou
Copy link

echou commented Jul 5, 2010

In xrep::xrecv(), call all readers' check_read() to determine current_reader, then the identity is returned at first. The real messages are returned by successive xrecv calls.

The above code assumes pipe's front message is a normal message. However it can be a DELIMITER message to indicate the termination of the pipe. In this case reader.read() return false (but check_read() returns true). It breaks the assumption and causes the assertion fail.

@hurtonm
Copy link
Member

hurtonm commented Jul 6, 2010

I have fixed this in my private repo (http://github.com/hurtonm/zeromq2/commit/9daf6214dff8a2fe1d3bfadb5b4ab58bb38cf354).
Brian (and others) could you please test and report back? If everything is OK, I will merge upstream.

@bwbuchanan
Copy link
Contributor Author

Looks fixed to me, thanks!

@mato
Copy link
Contributor

mato commented Jul 6, 2010

Looks ok here too. Thanks!

@hurtonm
Copy link
Member

hurtonm commented Jul 7, 2010

Thanks for reports. I have merged the fix into master now.

csrl pushed a commit to exosite-archive/zeromq2 that referenced this issue Dec 22, 2012
updated INSTALL documentation as per pull request zeromq#37
mrvn pushed a commit to mrvn/libzmq that referenced this issue Jul 2, 2015
benjdero pushed a commit to benjdero/libzmq that referenced this issue Feb 20, 2023
Basic performance test tool
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

5 participants