Giter Site home page Giter Site logo

zeromq / zeromq4-1 Goto Github PK

View Code? Open in Web Editor NEW
125.0 24.0 137.0 13.02 MB

ZeroMQ 4.1.x stable release branch - bug fixes only

License: GNU General Public License v3.0

CMake 2.07% Shell 1.01% C++ 88.76% C 3.54% Batchfile 0.17% Makefile 1.18% M4 3.23% Dockerfile 0.04%

zeromq4-1's Introduction

ZeroMQ

Build Status

Welcome

The ZeroMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. ZeroMQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more.

Building and installation

See the INSTALL file included with the distribution.

Resources

Extensive documentation is provided with the distribution. Refer to doc/zmq.html, or "man zmq" after you have installed libzmq on your system.

Website: http://www.zeromq.org/

Development mailing list: [email protected] Announcements mailing list: [email protected]

Git repository: http://github.com/zeromq/libzmq

ZeroMQ developers can also be found on the IRC channel #zeromq, on the Freenode network (irc.freenode.net).

License

The project license is specified in COPYING and COPYING.LESSER.

libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library.

libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

zeromq4-1's People

Contributors

arsenm avatar bluca avatar c-rack avatar ckamm avatar cremes avatar dhammika avatar dkrikun avatar dmeehan1968 avatar evoskuil avatar ewenmcneill avatar hintjens avatar hurtonm avatar ianbarber avatar ipechorin avatar jondyte avatar lalebarde avatar mato avatar mattconnolly avatar methodmissing avatar mgatny avatar minrk avatar mkoppanen avatar olafmandel avatar pijyoi avatar ricnewton avatar shripchenko avatar soundart avatar srombauts avatar steve-o avatar sustrik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zeromq4-1's Issues

build error about randombytes.h

env: CentOS 6.7 x86_64, gcc 4.9.1
branch: master
rev: 5aa7bdf

I got 2 different build errors as detailed below.
Is it possible caused by tweetnacl integration added recently?

Case 1

build out of source, got error randombytes.h: No such file or directory

$ mkdir build && cd build
$ ../zeromq4-1.git/configure --without-documentation --without-libsodium
...
...
$ make
Making all in doc
make[1]: Entering directory `/tmp/build/doc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/build/doc'
make[1]: Entering directory `/tmp/build'
  CXX    src/libzmq_la-address.lo
  CXX    src/libzmq_la-clock.lo
  CXX    src/libzmq_la-ctx.lo
../zeromq4-1.git/src/ctx.cpp:51:25: fatal error: randombytes.h: No such file or directory
 #include "randombytes.h"
                         ^
compilation terminated.
make[1]: *** [src/libzmq_la-ctx.lo] Error 1
make[1]: Leaving directory `/tmp/build'
make: *** [all-recursive] Error 1

Case 2

build in source, got error ./tweetnacl/contrib/randombytes/randombytes.h:14:55: error: ISO C++ 1998 does not support 'long long'

$ ./configure --without-documentation --without-libsodium
...
...
$ make
Making all in doc
make[1]: Entering directory `/tmp/zeromq4-1.git/doc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/zeromq4-1.git/doc'
make[1]: Entering directory `/tmp/zeromq4-1.git'
  CXX    src/libzmq_la-address.lo
  CXX    src/libzmq_la-clock.lo
  CXX    src/libzmq_la-ctx.lo
In file included from src/ctx.cpp:51:0:
./tweetnacl/contrib/randombytes/randombytes.h:14:55: error: ISO C++ 1998 does not support 'long long' [-Werror=long-long]
 extern void randombytes(unsigned char *,unsigned long long);
                                                       ^
cc1plus: all warnings being treated as errors
make[1]: *** [src/libzmq_la-ctx.lo] Error 1
make[1]: Leaving directory `/tmp/zeromq4-1.git'
make: *** [all-recursive] Error 1

Large traffic when on zmq_pool

I'm not sure if this is a bug or intended behaviour, but I see a large traffic in windows Resource Monitor when calling zmq_pool in the loop (without any incomming connection)

	void * m_serverSocket{ nullptr };

	m_serverSocket = zmq_socket(zmq_ctx, ZMQ_REP);
	XASSERT(m_serverSocket != nullptr);

	//bind address to socket
	int rc = zmq_bind(m_serverSocket, "tcp://*:9990");
	XASSERT(rc == 0);
		
	zmq_msg_t msgRequest;
	rc = zmq_msg_init(&msgRequest);
	XASSERT(rc == 0);

	zmq_pollitem_t items[] = { m_serverSocket, 0, ZMQ_POLLIN, 0 };

	while ( true )
	{
		rc = zmq_poll(items, 1, 1000);
		if ( rc == 0 )
			continue;

		XASSERT(rc > 0 );

		if ( items[0].revents & ZMQ_POLLIN )
			break;
	}

This is what I see in Resource Monitor:

image

When I have more zmq_pools in the app or more complex app, I'm getting much bigger numbers:

image

All this bandwidth is caused only by waiting for the incoming transaction.

Assertion failed: pfd.revents & POLLIN (src/signaler.cpp:239)

Hi Pieter,

I've ran into an assertion today from src/signaler.cpp

Assertion failed: pfd.revents & POLLIN (src/signaler.cpp:239)

At the point where it threw I close multiple sockets and contexts, so I'm not sure how to reproduce. But if I'm able to isolate it, I'll tell.

But I'm looking at the line from the assert:
https://github.com/zeromq/zeromq4-1/blob/master/src/signaler.cpp#L239
and at the man-page of poll():
http://linux.die.net/man/2/poll

The man-page states that it can return POLLERR, POLLHUP, or POLLNVAL as well. And on closing sockets and contexts I assume that e.g. POLLHUP can occur. Is assert the right choice here?

Greetings,

Rik

Problem: API compatibility broken between 4.1.0 and 4.1.1+

Due to commit ed6bf9f merged via PR #6 which was part of the 4.1.1 release, the behaviour of the socket bind/unbind API has changed when IPv6 is enabled.

Before that commit, you could bind "tcp://127.0.0.1:1234" and unbind using the same string, and it would work. After that commit, it no longer works and zmq_unbind returns an error.

This is because the unbind now needs to happen with the actual endpoint string, which when IPv6 is enable would be:
"tcp://[::ffff:127.0.0.1]:1234"

Given there have been many releases since 4.1.1, I'd say it's probably too late now to change back. But maybe we could add a note to the NEWS file so that users can expect this and avoid spending time debugging?

I found out about this issue when staging the upgrade of libzmq from 4.0.4 to 4.1.5 in our build system - and tests started blowing up left and right.

To reproduce:

#include <assert.h>
#include <zmq.h>

int main (int argc, char **argv)
{
    void *ctx = zmq_ctx_new ();
    assert (ctx);

    void *sb = zmq_socket (ctx, ZMQ_REP);
    assert (sb);

    int ipv6 = 1;
    int rc = zmq_setsockopt (sb, ZMQ_IPV6, &ipv6, sizeof (int));
    assert (rc == 0);

    rc = zmq_bind (sb, "tcp://127.0.0.1:9999");
    assert (rc == 0);

    rc = zmq_unbind (sb, "tcp://127.0.0.1:9999");
    assert (rc == 0);

    rc = zmq_close (sb);
    assert (rc == 0);

    rc = zmq_ctx_term (ctx);
    assert (rc == 0);
}

And I found the culprit by bisecting (save the above code as api_test.cpp and the following script as bisect.sh):

#!/bin/bash
make clean
make -j5
gcc -I./include -L./.libs -lzmq api_test.cpp
LD_LIBRARY_PATH=./.libs ./a.out
if [ $? -gt 0 ]
then
  exit 1
else
  exit 0
fi
git bisect start HEAD v4.1.0
git bisect run ./bisect.sh

...

ed6bf9f1781d082d198b098e06b906762f38f15e is the first bad commit
commit ed6bf9f1781d082d198b098e06b906762f38f15e
Author: lysyloren <[email protected]>
Date:   Wed Oct 29 10:17:30 2014 +0100

    Unbind socket with real endpoint when binding by wild-card * address

:040000 040000 bd07179b7b473a130dd8d95b9f1752093beecb2f b16abb01cf07f6908b9111b7b65236cd0b1abe90 M  doc
:040000 040000 e984021e4aff2332f4ea9b73a84fb178323fdb44 bde4cd826792171494d46a70e7f14faeb39b340e M  src
:040000 040000 2751e15d2321ce21f600d59695e349529c39fd2b 95b186d4b1ffce3202a7fb7c6233411201c847c8 M  tests
bisect run success

getsockopt only writes its own size instead of 'optvallen_'

Hi,

Today I've spent a few hours raging at my code again, in the end getsockopt's odd behavior was the culprit.

I'm using getsockopt with ZMQ_RCVMORE and according the API-docs (http://api.zeromq.org/master:zmq-getsockopt#toc4) this value requires int64_t. So I'm passing a nice int64_t. But after a lot of debugging more never becomes 0.

Looking at the implementation of libzmq:

if (option_ == ZMQ_RCVMORE) {
if (*optvallen_ < sizeof (int)) {
errno = EINVAL;
return -1;
}
*((int*) optval_) = rcvmore ? 1 : 0;
*optvallen_ = sizeof (int);
return 0;
}

It only checks for 'int'. So it never writes my full 64 bits. When more has a value of all 1's it is never overwritten.

So, the documentation is wrong about int64_t. And doesn't it make more sense to write the full 'optvallen_' instead of only 'sizeof(int)' bytes? The documentation states it makes my variable zero.

Kind regards,

Rik

Incorrect version in resource.rc for msvc builds

The past few releases have not incremented the version number in resource.rc to match package.config. For anyone building with MSVC and distributing the file with Windows Installer this is problematic as Windows Installer will not install the "newer" version because it has the same file version.

Can't connect to tcp/ipv6 address

#include <zmq.hpp>

int main()
{
    zmq::context_t context(1);
    zmq::socket_t s(context, ZMQ_REQ);
    int ipv6 = 1;
    s.setsockopt(ZMQ_IPV6, &ipv6, sizeof(ipv6));
    s.connect("tcp://[::1]:4506");                                                                                                         

    return 0;
}

This code works under 4.0.x, but under 4.1.x the call to connect() fails with "Invalid argument". The failure is triggered by the tcp address sanity check in zmq::socket_base_t::connect().

Given the implementation of that check, I see no chance of successfully connecting to a tcp/ipv6 address. What am I missing?

Sending same message to a list of servers

Hello,
To anyone reading this. I came up with a problem and can't find the right pattern to implement a solution, PUSH/PULL, PUB/SUB, etc.
I need to send the same message to a list of remote servers. Basically the idea is to monitor some processes on remote machines, asking for some statistics. This really look like a PUB/SUB model, where the monitor application publish requests like "tell me the total number of type X messages processed on the last 10 minutes", and the remote processes that are up and running may respond. If some of them are down for maintenance, or crashed, they will simply not receive the message and not respond. That sounds perfect, BUT:
The remote processes to be monitored have no idea to where to connect to in order to start the subscription. I could start the monitor application on my laptop, it could run on a workmate's laptop, on a dedicated server or desktop for an administrator, etc. Also, there could be more than one instance of the monitor application. Also, the remote servers needs to answer back those messages, with the results.
I thought that the monitor application could start PAIR connections to a list of remote processes and just send messages to all of them on a loop, receiving from the same sockets. Not elegant design and also I realized that PAIR is to be used to couple threads and not to be used over the network, so I discarded the idea.
I thought I could start PUSH/PULL connections one by one, so the first sent message could have the "callback address" to where to connect back to answer, but then if the remote processes crashes and restarts, the client will have no idea about the reconnection and will not send the "callback address". I thought about this model mixed with the PUB/SUB, like connect to the remote server and tell "connect back a SUB socket to this address, to receive requests, and a PUSH socket to this other, to answer me back", but it is always the same problem. As the PUSH client can't detect reconnection, it does not know when to send the first message with the addresses.
I have ZeroMQ working great on a production system, with load balancing across servers, etc, but because all processes know their peers by configuration.
I see it would be a wonderful add-on to the PUSH/PULL PUB/SUB models if the client could connect to a list of remote servers and PUSH messages with load balancing (creating many connecting sockets instead of binding, but looking as one to the developer) or to PUB messages to all of them instead.
Anyway, does anyone have an idea about how to solve my problem?

Cant detect libsodium on ubuntu 14.04

zmq ver 4.1
Builded libsodium LATEST, set sodium_CFLAGS, sodium_LIBS etc.
./configure says: "checking for sodium... yes"

make:

./.libs/libzmq.so: undefined reference to crypto_secretbox_open' ./.libs/libzmq.so: undefined reference tocrypto_box_beforenm'
./.libs/libzmq.so: undefined reference to crypto_secretbox' ./.libs/libzmq.so: undefined reference tocrypto_box'
./.libs/libzmq.so: undefined reference to crypto_box_keypair' ./.libs/libzmq.so: undefined reference tosodium_init'
./.libs/libzmq.so: undefined reference to crypto_box_open' ./.libs/libzmq.so: undefined reference torandombytes_close'
./.libs/libzmq.so: undefined reference to crypto_box_open_afternm' ./.libs/libzmq.so: undefined reference torandombytes'
./.libs/libzmq.so: undefined reference to crypto_box_afternm' collect2: error: ld returned 1 exit status make[1]: *** [curve_keygen] Error 1 make[1]: Leaving directory/home/a1/soft/zmq/zeromq4-1-master'
make: *** [all-recursive] Error 1

ZMQ 4.1.3 returns unknown error upon REQ send

on a Linux virtual machine using several processes ( we can assume there is a pressure in terms of CPU & memory), zeromq 4.1.3 is used between two processes, on the REQ/REP mode.

Here is the output returned. : first is printed errno, and second is errno ( between parenthesis).
zmd_send returned negative value ( assuming -1).

zmq_send failed: Unknown error 156384763 (156384763) 
zmq_send failed: Unknown error 156384763 (156384763) 
zmq_send failed: Unknown error 156384763 (156384763) 
zmq_send failed: Unknown error 156384763 (156384763) 
zmq_send failed: Unknown error 156384763 (156384763) 

Do you have any suggestion on the possible root cause of the error ?
I looked at the zmq code but was unable to see how come a non set errno value could be set.
I have some guess ( [0] ), but not sure definitely, because I am not an expert of ZMQ.

Any help is welcome for:

  • identifying the possible cause of such issue
  • if you think zmq 4.2.5 fixes this

in addition to this, I Was thinking if in a system without memory, what happend with new() code call in c++. Is the new() call satisfied ?

Thanks,
Philippe

[0] https://github.com/zeromq/zeromq4-1/blob/master/src/socket_base.cpp#L853

Problem: there is no CI for OSX

Hello,

Travis supports OSX builds as a opt-in beta: http://docs.travis-ci.com/user/multi-os/

I requested my CZMQ fork to be enabled, and I did some work in libzmq, zeromq4-x, zeromq4-1, zproject and czmq to get it to work.

In case you are interested in enabling it, I am going to submit a set of PRs to fix the travis config and the ci_build environment so that it works on both Linux and OSX. The only code changes are backporting a test timeout fix that is in libzmq but not in zeromq4-1 and zeromq4-x.

To enable OSX on a project, it is necessary to send an email to [email protected] with a link to the project, asking to be added.

Here is a CZMQ full run (with all the various ZMQ versions):

https://travis-ci.org/bluca/czmq/builds/73772078

Problem: autogen.sh checks for libtool, which has been split out in Debian/Ubuntu

Autogen.sh looks for the libtool command as a mean to check if
libtool is available. But distributions like Debian and Ubuntu have
split the libtool package, and the libtool script is now in a
separate package. The solution is to look for the libtoolize command
too before failing, which is what the Autotools chain actually needs
on Linux. Keep checking for libtool to be compatible with OSX, where
the opposite is true.

MultiThread REQ/REP module question

Hi!
I want to build a RPC by using zmq, DEALER accept message and send msg to multithreads worker to handle. But when I sleep one thread by Poco::Thread::sleep, other threads can not handle messages and client cannot recv response until the sleep thread wakeup.

Thanks .

Abort in zmq::mailbox_t::recv at src/mailbox.cpp:80

Hello,
I am having random aborts at this point, with an application, every few hours. We just started running this software yesterday, and we are having this issue.
I have a question about the multithreading use. I read that zmq sockets can't be shared, so what I am doing is this :
I have a dedicated thread on an infinite loop ("while (true)") blocked at recv(), and when it receives a message it executes a callback. That callback just enqueues the message to a different Active Object, with its own thread, and returns to execute recv() again.
It is just simple as that, no sharing, but I just noticed something in a forum.
The model I use implies a main thread that creates the sockets when needed, and pass the socket to a different thread who will appropriate it use it. The concept behind is that I have two types of "Socket processors" (Active Objects with their own thread), one "Sender" and one "Receiver". So the main thread may create any type of socket, pair, push, pull, subscribe, it may connect it or may bind it, and once ready it may pass it to the "Receiver object", like : "here is your socket, start receiving messages from it".
That way the Receiver and Sender objects don't care what type of socket is, as long as it is a zmq socket.

But now I read somewhere that the socket must be used by the same thread that created it !!!
Is it true ? That invalidates my design.

I am using ZeroMQ 4.1.4

Thanks,

Luis

ZMQ_HAVE_CURVE should be defined in MSVC build import.props files

The definitions ZMQ_HAVE_CURVE and ZMQ_USE_LIBSODIUM are used in source codes, but in MSVC build import.props files, there is just a HAVE_LIBSODIUM preprocessor definition which is not used actually. So, in all MSVC import.props files, HAVE_LIBSODIUM should be replaced with ZMQ_USE_LIBSODIUM, and ZMQ_HAVE_CURVE should be added.

Ubuntu Mate 16.04: zeromq-4.1.2 fails make check

I followed the directions from this link: https://tuananh.org/2015/06/16/how-to-install-zeromq-on-ubuntu/
When I try to install zeromq it fails when I type make check with the following:

rjpeek@rjpeek-G31-M7-TE:/zeromq-4.1.2$ make check
Making check in doc
make[1]: Entering directory '/home/rjpeek/zeromq-4.1.2/doc'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/rjpeek/zeromq-4.1.2/doc'
make[1]: Entering directory '/home/rjpeek/zeromq-4.1.2'
CXX src/libzmq_la-address.lo
CXX src/libzmq_la-clock.lo
CXX src/libzmq_la-ctx.lo
CXX src/libzmq_la-curve_client.lo
src/curve_client.cpp: In constructor ‘zmq::curve_client_t::curve_client_t(const zmq::options_t&)’:
src/curve_client.cpp:61:18: error: ignoring return value of ‘int sodium_init()’, declared with attribute warn_unused_result [-Werror=unused-result]
sodium_init();
^
cc1plus: all warnings being treated as errors
Makefile:2529: recipe for target 'src/libzmq_la-curve_client.lo' failed
make[1]: *** [src/libzmq_la-curve_client.lo] Error 1
make[1]: Leaving directory '/home/rjpeek/zeromq-4.1.2'
Makefile:3112: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
rjpeek@rjpeek-G31-M7-TE:
/zeromq-4.1.2$

I am able to get "make check" to pass and install if I configure with this: ./configure --without-libsodium

interrupt system call in zmq_proxy

I want to use multi-sender and multi-recver mode.

I choose XSUB-XPUB because multi bind address problem.

i start a proxy thread like this:

void proxy() {
  zmq::context_t context(1);
  zmq::socket_t sub(context, ZMQ_XSUB);
  sub.bind("ipc://data_sender");
  zmq::socket_t pub(context, ZMQ_XPUB);
  pub.bind("ipc://data_recver");
  zmq::proxy(sub, pub, NULL);
}

int main() {
  thread t(&proxy);
  t.join();
}

but i catch a "interrupt sysmtem call" exception in proxy function.

i have handled this error in socket send and recv.

but why it happened in proxy, and how can i handle this?

--with-libsodium=no does nothing as of aefc5d1

I am no longer able to compile libsodium using --with-libsodium=no on the master branch.

root@debian:~/deps/zmq# ./configure --with-libsodium=no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
...
...
checking whether time.h and sys/time.h may both be included... yes
checking for uint32_t... yes
checking for working volatile... yes
./configure: line 19268: syntax error near unexpected token `sodium,'
./configure: line 19268: `    PKG_CHECK_MODULES(sodium, libsodium, have_sodium_library="yes")'

ZeroMQ : 4.2.0 : Error detected while waiting for received reply ACK, ZMQ error: 156384763, Operation cannot be accomplished in current state

ZeroMQ : 4.2.0 : Error detected while waiting for received reply ACK, ZMQ error: 156384763, Operation cannot be accomplished in current state.
we are using ZeroMQ from past 4 years and it is working fine till now as per new standards we have updated our android application to use Clang compiler instead of GCC and ZeroMQ is compiled using GCC still. we are getting above error when we changed to Clang compiler. Can some please share how i can resolve this is blocking our release.

Problem: ZeroMQ 4.1 downloads coming from VM that is about to be shut down

The downloads for ZeroMQ 4.1 are coming from download.zeromq.org which is a CNAME to an iMatix VM. That VM is about to be shut down (somewhere between late May and mid-June). When that VM is shut down the downloads for ZeroMQ 4.1 will not work if they are not changed.

Suggested solution:

  1. Tag at least the most recent (4.1.4) release in the GitHub repository to create a GitHub release at the commit representing 4.1.4.
  2. Arrange for the auto-builder to run on zeromq4-1 and upload ready-to-build archives (and/or manually upload the existing archives)
  3. Update the download page to link to the GitHub release hosted archives.

Ewen

build on latest ubuntu fail

pulled latest:

git clone https://github.com/zeromq/zeromq4-1.git
./autogen.sh 
./configure --without-libsodium
make -j6 && make check
PASS: test_timeo
./config/test-driver: line 107: 25920 Aborted                 (core dumped) "$@" > $log_file 2>&1
FAIL: test_filter_ipc
PASS: test_fork
PASS: test_abstract_ipc
make[4]: Entering directory '/home/people/arnaud/src/zeromq4-1'
Making all in doc
make[5]: Entering directory '/home/people/arnaud/src/zeromq4-1/doc'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/home/people/arnaud/src/zeromq4-1/doc'
make[5]: Entering directory '/home/people/arnaud/src/zeromq4-1'
make[5]: Leaving directory '/home/people/arnaud/src/zeromq4-1'
make[4]: Leaving directory '/home/people/arnaud/src/zeromq4-1'
============================================================================
Testsuite summary for zeromq 4.1.1
============================================================================
# TOTAL: 58
# PASS:  57
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
Please report to [email protected]
============================================================================
Makefile:3187: recipe for target 'test-suite.log' failed
make[3]: *** [test-suite.log] Error 1
make[3]: Leaving directory '/home/people/arnaud/src/zeromq4-1'
Makefile:3293: recipe for target 'check-TESTS' failed
make[2]: *** [check-TESTS] Error 2
make[2]: Leaving directory '/home/people/arnaud/src/zeromq4-1'
Makefile:3981: recipe for target 'check-am' failed
make[1]: *** [check-am] Error 2
make[1]: Leaving directory '/home/people/arnaud/src/zeromq4-1'
Makefile:3073: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
$ more ./test-suite.log 
====================================
   zeromq 4.1.1: ./test-suite.log
====================================

# TOTAL: 58
# PASS:  57
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test_filter_ipc
=====================

lt-test_filter_ipc: tests/testutil.hpp:68: void bounce(void*, void*): Assertion `rc == 32' failed.

Smalltalk?

@hintjens this is probably the wrong place to ask this, but, hi :)

To what extent has Smalltalk influenced your work, and specifically your work on zemomq?

Migration to github created utter mess for downloads

Please restore the old download site. The process by which github creates releases is a god awful mess.

problem #1: Failure to create proper file names for source: -- v4.1.3.tar.gz rather than zeromq-4.1.3.tar.gz
problem #2: extracted source is a mess: tar xfz creates: zeromq4-1-4.1.3

compilation error in VS2010

Steps to reproduce:

  1. clone repo (latest commit was ff8b0aa)
  2. use vs2010 and open builds\msvc\vs2010\libzmq.sln
  3. try to build without any changes

1>..\..\..\..\src\socket_base.cpp(1300): error C2511: 'void zmq::socket_base_t::event_connected(const std::string &,zmq::fd_t)' : overloaded member function not found in 'zmq::socket_base_t' 1> c:\zeromq4-1\src\socket_base.hpp(61) : see declaration of 'zmq::socket_base_t' 1>..\..\..\..\src\socket_base.cpp(1315): error C2511: 'void zmq::socket_base_t::event_listening(const std::string &,zmq::fd_t)' : overloaded member function not found in 'zmq::socket_base_t' 1> c:\zeromq4-1\src\socket_base.hpp(61) : see declaration of 'zmq::socket_base_t' 1>..\..\..\..\src\socket_base.cpp(1325): error C2511: 'void zmq::socket_base_t::event_accepted(const std::string &,zmq::fd_t)' : overloaded member function not found in 'zmq::socket_base_t' 1> c:\zeromq4-1\src\socket_base.hpp(61) : see declaration of 'zmq::socket_base_t' 1>..\..\..\..\src\socket_base.cpp(1335): error C2511: 'void zmq::socket_base_t::event_closed(const std::string &,zmq::fd_t)' : overloaded member function not found in 'zmq::socket_base_t' 1> c:\zeromq4-1\src\socket_base.hpp(61) : see declaration of 'zmq::socket_base_t' 1>..\..\..\..\src\socket_base.cpp(1345): error C2511: 'void zmq::socket_base_t::event_disconnected(const std::string &,zmq::fd_t)' : overloaded member function not found in 'zmq::socket_base_t' 1> c:\zeromq4-1\src\socket_base.hpp(61) : see declaration of 'zmq::socket_base_t'

Question: epgm and curve?

Can epgm be used with curve? When I enable encryption on a Publish app, my Subscriber app still receives the data.

Steps

  1. I compiled 4.1.5 with epgm. I have a successful pub/sub between two machines using epgm via go zmq4
  2. When I enable AuthCurveAdd(), SetCurveServer(), SetCurveSecretKey() on the Publish app, the Subscriber app still receives the data. It's as if the curve functions are ignored. The return codes are not errors.

I also changed the protocol to tcp:// between the Publish ans Subscriber app. When encryption is enabled on the Publish app, the Subscriber app does not receive the data (as expected).

Espresso (zmq_proxy) doesn't work anymore

I'm issuing this because I don't know if I should change this.
There was this change to zeromq4-1, which seems to block (the Espresso example) until forever:

@@ -159,14 +159,16 @@ int zmq::proxy (
         }
         //  Process a request
         if (state == active
-        &&  items [0].revents & ZMQ_POLLIN) {
+        &&  items [0].revents & ZMQ_POLLIN
+        &&  items [1].revents & ZMQ_POLLOUT) {
             rc = forward(frontend_, backend_, capture_,msg);
             if (unlikely (rc < 0))
                 return -1;
         }
         //  Process a reply
         if (state == active
-        &&  items [1].revents & ZMQ_POLLIN) {
+        &&  items [1].revents & ZMQ_POLLIN
+        &&  items [0].revents & ZMQ_POLLOUT) {
             rc = forward(backend_, frontend_, capture_,msg);
             if (unlikely (rc < 0))
                 return -1;

Now the question is: Should I remove that ZMQ_POLLOUTs again, or should we use ZMQ_DONTWAIT (instead of 0) in the forward function?

Actually I don't even see the zmq_proxy registering the ZMQ_POLLOUT, there's just ZMQ_POLLIN; so does this make sense at all?

zmq_pollitem_t items [] = {
    { frontend_, 0, ZMQ_POLLIN, 0 },
    { backend_, 0, ZMQ_POLLIN, 0 },
    { control_, 0, ZMQ_POLLIN, 0 }
};

test_security_null fails for latest (4.1.7)

We are upgrading our custom build debian package but our CI is unable to finalize the build due too:

====================================
   zeromq 4.1.7: ./test-suite.log
====================================

# TOTAL: 63
# PASS:  62
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test_security_null
========================

lt-test_security_null: tests/test_security_null.cpp:109: int main(): Assertion `rc == 0' failed.

We use the latest master, building under Debian 8 with GCC.

zeromq 4.1.5 "make -j check" fails on Ubuntu 16.04 / ARMv8 system

Environment: ARMv8, 96 cores, Ubuntu 16.04. zeromq 4.1.5 built from source.

A gist of the test log:

https://gist.github.com/47ad1c08ea1441f97d0eb3ce894a64de

a summary

bash-3.2$ grep ^FAIL zeromq-4.1.5-test-suite-aarch64.log
FAIL: test_stream_empty
FAIL test_stream_empty (exit status: 134)
FAIL: test_unbind_wildcard
FAIL test_unbind_wildcard (exit status: 134)
FAIL: test_spec_req
FAIL test_spec_req (exit status: 134)
FAIL: test_spec_rep
FAIL test_spec_rep (exit status: 134)
FAIL: test_spec_dealer
FAIL test_spec_dealer (exit status: 134)
FAIL: test_spec_router
FAIL test_spec_router (exit status: 134)
FAIL: test_spec_pushpull
FAIL test_spec_pushpull (exit status: 134)
FAIL: test_req_correlate
FAIL test_req_correlate (exit status: 134)
FAIL: test_req_relaxed
FAIL test_req_relaxed (exit status: 134)
FAIL: test_conflate
FAIL test_conflate (exit status: 134)
FAIL: test_issue_566
FAIL test_issue_566 (exit status: 134)

What I expected: all tests pass.

More details:

zeromq4-1$ uname -a
Linux armv8hello.local.lan 4.4.0-38-generic #57-Ubuntu SMP Wed Sep 7 10:19:14 UTC 2016 aarch64 aarch64 aarch64 GNU/Linux

lt-test_filter_ipc: tests/testutil.hpp:84: void bounce(void*, void*): Assertion `rc == 32' failed.

Hi, I am receiving an error when trying to build an rpm on centos 7.4 using the spec file provided in 4.1.7.
Below is the error:

====================================
   zeromq 4.1.7: ./test-suite.log
====================================

# TOTAL: 63
# PASS:  62
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test_filter_ipc
=====================

lt-test_filter_ipc: tests/testutil.hpp:84: void bounce(void*, void*): Assertion `rc == 32' failed.
FAIL test_filter_ipc (exit status: 134)

Any help on how to resolve this issue will greatly be appreciated.
Thank you.

zeromq4.1.5 library be generated compile error on VS2008

Operation steps:

  1. download zeromq4.1.5.zip, unpack it
  2. use vs2008 and open libzmq.sln
  3. try to build .... link error be generated:

_Error 2 error LNK2019: unresolved external symbol "public: __thiscall zmq::socks_connecter_t::socks_connecter_t(class zmq::io_thread_t *,class zmq::session_base_t *,struct zmq::options_t const &,struct zmq::address_t *,struct zmq::address_t *,bool)" (??0socks_connecter_t@zmq@@QAE@PAVio_thread_t@1@PAVsession_base_t@1@ABUoptions_t@1@PAUaddress_t@1@3_N@Z) referenced in function "private: void _thiscall zmq::session_base_t::start_connecting(bool)" (?start_connecting@session_base_t@zmq@@AAEX_N@Z) session_base.obj

hung inside zmq_bind

Hi,

I using zmq 4.1.3 and my application hung on zmq_bind call.

gdb backtrace (kill -6):

#0  0x00007f203f20487d in recvmsg () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f203f2204e4 in __netlink_request (h=0x7ffefd282820, type=<optimized out>) at ../sysdeps/unix/sysv/linux/ifaddrs.c:177
#2  0x00007f203f220742 in getifaddrs_internal (ifap=<optimized out>) at ../sysdeps/unix/sysv/linux/ifaddrs.c:352
#3  0x00007f203f221510 in *__GI_getifaddrs (ifap=0x7ffefd2828a8) at ../sysdeps/unix/sysv/linux/ifaddrs.c:849
#4  0x000000000054766f in zmq::tcp_address_t::resolve_nic_name (this=this@entry=0xa9d6e0, nic_=nic_@entry=0xa9d768 "127.0.0.1", ipv6_=ipv6_@entry=false, is_src_=is_src_@entry=false)
    at src/tcp_address.cpp:170
#5  0x000000000054794b in zmq::tcp_address_t::resolve_interface (this=0xa9d6e0, interface_=0xa9d768 "127.0.0.1", ipv6_=false, is_src_=false) at src/tcp_address.cpp:258
#6  0x0000000000547f35 in zmq::tcp_address_t::resolve (this=0xa9d6e0, name_=0xa9be28 "127.0.0.1:50101", local_=true, ipv6_=false, is_src_=false) at src/tcp_address.cpp:448
#7  0x0000000000549ebe in zmq::tcp_listener_t::set_address (this=0xa9d3a0, addr_=0xa9be28 "127.0.0.1:50101") at src/tcp_listener.cpp:164
#8  0x00000000005447ab in zmq::socket_base_t::bind (this=0xa9cdb0, addr_=<optimized out>) at src/socket_base.cpp:400
#9  0x00000000004e3d56 in io::zmq::socket::bind (this=0xa98a48, endpoint=0xa9c968 "tcp://127.0.0.1:50101") at /home/qf/package/io/1.1.20/x86_64-linux-gnu/include/io/zmq/socket.hpp:203
#10 0x00000000004e3e44 in io::zmq::socket::bind (this=0xa98a48, endpoint="tcp://127.0.0.1:50101") at /home/qf/package/io/1.1.20/x86_64-linux-gnu/include/io/zmq/socket.hpp:212
#11 0x00000000004e3e6d in io::zmq::socket_base::bind (this=0xa98a40, endpoint="tcp://127.0.0.1:50101") at /home/qf/package/io/1.1.20/x86_64-linux-gnu/include/io/zmq/socket_base.hpp:91
#12 0x00000000004e35fa in app::context::context (this=0xa98770, loop=..., cfg=...) at /home/ksergey/dev/whawkes/src_new/context.cpp:41
#13 0x00000000004e1605 in app::process::process (this=0xa986a0) at /home/ksergey/dev/whawkes/src_new/process.cpp:49
#14 0x00000000004defae in framework::Application<app::process>::exec (this=0x80f8f0, argc=2, argv=0x7ffefd283308)
    at /home/qf/package/framework/0.6.0/x86_64-linux-gnu/include/framework/application.hpp:168
#15 0x00000000004dd2c1 in main (argc=2, argv=0x7ffefd283308) at /home/ksergey/dev/whawkes/src_new/main.cpp:34

It's zeromq issue or os issue?

11:53:24 ✔ ksergey@qf-quorra ~ $ cat /etc/debian_version 
7.8

Thanks

EHOSTDOWN from getsockopt must not cause assertion abort; causes SaltStack crashes

With zeromq-4.1.5 from FreeBSD ports, as used by SaltStack.

For some time I have been observing instability of a running salt_minion on several of our FreeBSD hosts: after a couple of days Salt master loses contact with most FreeBSD hosts, but Linux hosts remain connected. After such event one can find a coredump of a salt-minion process (written in python) on such systems, and manually restarting a salt_minion is needed.

After adding some debugging, and capturing stdout and stderr of a non-daemonized salt-minion process, the following is the last reported line:

Host is down (src/tcp_connecter.cpp:359)

So it seems there was some minor network glitch or outage, and libzmq decided to abort the process with an assertion, which is supposed to exempt all usual network socket -related problems and catch only a potential application problem.

The problem is that the exemption list is missing the EHOSTDOWN error code, which should not be a cause of a process abort.

The essential code snippet is shown here:

/usr/ports/net/libzmq4/work/zeromq-4.1.5/src/tcp_connecter.cpp :

 zmq::fd_t zmq::tcp_connecter_t::connect ()
 {
     //  Async connect has finished. Check whether an error occurred
     int err = 0;
     socklen_t len = sizeof err;

     const int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char*) &err, &len);

     //  Assert if the error was caused by 0MQ bug.
     //  Networking problems are OK. No need to assert.
 [...]
     //  Following code should handle both Berkeley-derived socket
     //  implementations and Solaris.
     if (rc == -1)
         err = errno;
     if (err != 0) {
         errno = err;
         errno_assert (
             errno == ECONNREFUSED ||
             errno == ECONNRESET ||
             errno == ETIMEDOUT ||
             errno == EHOSTUNREACH ||
   +         errno == EHOSTDOWN ||
             errno == ENETUNREACH ||
             errno == ENETDOWN ||
             errno == EINVAL);
         return retired_fd;
     }

So, please add the missing "errno == EHOSTDOWN ||" exemption to the errno_assert list.

Here is the patch:

--- src/tcp_connecter.cpp~      2016-06-17 13:38:14.000000000 +0200
+++ src/tcp_connecter.cpp       2017-02-23 17:38:25.616705000 +0100
@@ -355,4 +355,5 @@
             errno == ETIMEDOUT ||
             errno == EHOSTUNREACH ||
+            errno == EHOSTDOWN ||
             errno == ENETUNREACH ||
             errno == ENETDOWN ||

I don't know about the equivalent code section a couple of lines higher, pertaining to Windows. If a Windows system has an errno code WSAEHOSTDOWN known, it should be added there too.

Btw, the equivalent sister patch for the FreeBSD port net/libzmq4 is here:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217313

assert error in 4.14

I think in the content_t class, we must check the ptr has been destroyed or not, otherwise if we called the close before destroy, then the ZMQ_ASSERT will be raise when the class destroying.

    inline ~context_t () ZMQ_NOTHROW
    {
        if (!ptr)
        {
            return;
        }

        int rc = zmq_ctx_destroy (ptr);
        ptr = NULL;
        ZMQ_ASSERT (rc == 0);
    }

    inline void close() ZMQ_NOTHROW
    {
        if (!ptr)
        {
            return;
        }

        int rc = zmq_ctx_destroy (ptr);
        ptr = NULL;
        ZMQ_ASSERT (rc == 0);
    }

ZMQ 4.1.4, Recv returns -1 with EINTR error

I am relatively new to ZMQ and have read the Guide to obtain a basic understanding.
The program has two threads are all the sockets being used by a thread are initialized in the same thread.
I am facing the following error,

  while(more)
    {
      /* Get The Pair */
      clock_gettime(CLOCK_REALTIME, &S2);
      nByteS = zmq_recv(reciever, data, sizeof(char), 0);
      assert(nByteS != -1); 
  
      /* Multilply the Pair */
      clock_gettime(CLOCK_REALTIME, &S3);
     
      theApp->run(PairList[count].M2, PairList[count].M1, PairList[count].P, 16, &Sum4, &Sum4, &Sum3, &Sum4);
    
      clock_gettime(CLOCK_REALTIME, &E3);
      /* Check if there is more data */ 
      more = (long int)(*data)&more_mask;
      loop = (long int)(*data)&loop_mask;
          
      /* Send the Product along with the indication of whether there is more data */
      //printf("Sending Product Matrix... %ld\n", more);
      
      if(loop)
	{
	  nByteR = zmq_send(sendResult, msg, 2, 0); 
	  assert(nByteR!=-1);
	}

      clock_gettime(CLOCK_REALTIME, &E2);
      Sum1+=Exec_Time(S2, S3);
      Sum2+=Exec_Time(S3, E3);
      count = (count+1)%noOfPairs;
    }

The sockets being used are initialized in the same thread.
The zmq_recv function is returning -1 with errno set to EINTR
The guide shows a program where the program continues to execute on receiving this error code.

Am I supposed to do the same?

PairList is a shared variable between the threads. Could this be the cause of the Error?

Automake recursion and pgm dependency

The current build process utilizes recursive make which has documented issues. This recursive approach is used to compile pgm as a non-installed dependency linking to an internal library created in the pgm build process. Given that pgm is supported via pkg-config, the non-installed dependency support is a complication which should be dropped and the build process should be flattened.

Mingw compilation on Windows

Under windows when compiling using Mingw there is a linking error:

\zeromq-4.1.6\builds\mingw32/../../src/session_base.cpp:520: undefined reference to `zmq::socks_connecter_t::socks_connecter_t(zmq::io_thread_t*, zmq::session_base_t*, zmq::options_t const&, zmq::address_t*, zmq::address_t*, bool)'
collect2.exe: error: ld returned 1 exit status
Makefile.mingw32:40: recipe for target 'libzmq.dll' failed
mingw32-make: *** [libzmq.dll] Error 1

This error is caoused by missing of 2 source files compilation in makefile. It can be fixed by adding two files:
socks_connecter.o socks.o
to Makefile.mingw32 to OBJS section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.