You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling the attached test code with g++ test.cpp -o test -lzmq -fsanitize=thread it hangs when claling to recv(). Without tsan it works correctly.
Environment
libzmq version (commit hash if unreleased): 4.3.5
cppzmq: 4.10.0
gcc: 14.2.1 (but it can reproduce also with clang)
this looks a race condition, you send before you recv on a pub sub pair.
you have to wait a little before sending a message or the receiver will never see anything.
You might just send a message every few milliseconds and it should be ok.
I didn't know if the publisher would queue the messages until high watermark is hit before dropping, if it did then this would work, if not I would receive a TSAN log. Thinking it now, it would be dumb to queue messages that way, in a pub/sub at least.
In any case, I would expect fsanitize=thread to throw something in a case like that. I was also using -DENABLE_INTRINSITCS for ZMQ, which, afaik, helps the sanitizer instrument the code better.
Issue description
When compiling the attached test code with
g++ test.cpp -o test -lzmq -fsanitize=thread
it hangs when claling torecv()
. Without tsan it works correctly.Environment
Minimal test code / Steps to reproduce the issue
What's the actual result? (include assertion message & call stack if applicable)
It just hangs without any information, crash or error
What's the expected result?
It shows the published message
The text was updated successfully, but these errors were encountered: