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
Perhaps this is user error, but I wanted to write up an issue just to clarify. Notice between the zmq3 Proxy and zmq4Proxy, zmq4 has a for loop where zmq3 does not.
If you instantiate frontend and backend sockets then execute Proxy(frontend, backend), say in a separate goroutine, you would expect that once you close both sockets in the parent process, the Proxy call should exit with an error due to interruption (expected). See: https://libzmq.readthedocs.io/en/zeromq4-1/zmq_proxy.html#toc2
Now, a simple test on a M1 Macos will work every time, however, running this sort of test in a Github actions CI workflow for example, will almost always trigger a segfault:
My guess is that the first Proxy executes successfully, then the sockets are closed, which then returns an error, but since there is a for loop in zmq4, it'll try again and the sockets will be nil triggering a segfault? Is there a need for a for loop? Why does it exist?
The text was updated successfully, but these errors were encountered:
Ok, this doesn't seem to have to do anything with the for loop. Rather, the main thread that calls Close on the sockets ends up setting socket.soc to nil which then gets a nil dereference in Proxy it seems.
I'm still not sure if this is user error, a bug in the go wrapper or a zeromq bug? Again, this only happens when executed in a github actions container.
Sockets are not thread safe. This a problem in zmq, not in Go. You shouldn't create a socket in one goroutine, and use it in another. You should execute Proxy in the same goroutine where you created the sockets.
Perhaps this is user error, but I wanted to write up an issue just to clarify. Notice between the zmq3
Proxy
and zmq4Proxy
, zmq4 has afor
loop where zmq3 does not.If you instantiate
frontend
andbackend
sockets then executeProxy(frontend, backend)
, say in a separate goroutine, you would expect that once you close both sockets in the parent process, theProxy
call should exit with an error due to interruption (expected). See: https://libzmq.readthedocs.io/en/zeromq4-1/zmq_proxy.html#toc2Now, a simple test on a M1 Macos will work every time, however, running this sort of test in a Github actions CI workflow for example, will almost always trigger a segfault:
My guess is that the first
Proxy
executes successfully, then the sockets are closed, which then returns an error, but since there is afor
loop in zmq4, it'll try again and the sockets will be nil triggering a segfault? Is there a need for afor
loop? Why does it exist?The text was updated successfully, but these errors were encountered: