Git Product home page Git Product logo

zeromq4-x's Introduction

ZeroMQ

Build Status

Welcome

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

Stable Fork

This repository is used for making stable releases. Please do not send pull requests here unless they are specifically and only for this fork. Rather, send them to libzmq/master. Issues with test cases may be back ported to this repository by its maintainers.

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 0MQ 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

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

Copying

Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL). For details see the files COPYING and COPYING.LESSER included with the 0MQ distribution.

zeromq4-x's People

Contributors

arsenm avatar bluca avatar calid avatar ckamm avatar cremes avatar dhammika avatar dkrikun avatar ewenmcneill avatar gitfoxi avatar guidog avatar hintjens avatar hurtonm avatar ianbarber avatar ipechorin avatar jcfr avatar jondyte avatar mato avatar mattconnolly avatar mditzel avatar methodmissing avatar minrk avatar mkoppanen avatar pijyoi avatar ricnewton avatar shripchenko avatar srombauts avatar steve-o avatar sustrik avatar ttimo avatar ulikoehler 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  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

zeromq4-x's Issues

Can not send messages between router<->dealer

Can not send messages through the router<->dealer in some case

I use dealer and router to send messages between server A and dest Server.
Because the bad net between servers, so I use the rinetd to transfer the message .

The architecture is like this:

2015-05-29 160913
There are 3 kind of routes between Server A and Dest Server.
And current route switch from one to another.(maybe frequently).

Here comes the problems.

Sometime dealer and router can not recieve message from echo other.
If I restart the problem with dealer in this case, it can worker again.

Can some one help me with this? Is this the bug for dealer&router? Or I use them in a wrong way.
Thank You.

Some Info of my server:

Centos 6.4 64bit;
dealer use the lua-zmq with zeromq 4.0.6
router user gozmq whith zeromq 4.0.6

Minor patches for building with CMake + MSVC

I just got around to building zeromq4-x under MSVC and linking it with a client project. I had to make a few minor changes to fix the build. And I have tested the following changes under MSVC 2012, 2013, and 2015. I am happy to make a pull request if that helps. Patches below:

C linkage mismatch

The functions in the headers are all declared extern "C". However, the implementations are compiled in a C++ source that does not have the extern "C" declaration. The result is that the library symbols get C++ name mangled and the resulting dll is missing all of the symbols exported in the header. The fix was to add extern "C" in zmq.cpp and zmq_utils.cpp:

diff --git a/src/zmq.cpp b/src/zmq.cpp
index daf4f08..e453f42 100644
--- a/src/zmq.cpp
+++ b/src/zmq.cpp
@@ -92,6 +92,7 @@ struct iovec {
 typedef char check_msg_t_size
     [sizeof (zmq::msg_t) ==  sizeof (zmq_msg_t) ? 1 : -1];

+extern "C" {

 void zmq_version (int *major_, int *minor_, int *patch_)
 {
@@ -1049,3 +1050,5 @@ int zmq_device (int /* type */, void *frontend_, void *backend_)
         (zmq::socket_base_t*) frontend_,
         (zmq::socket_base_t*) backend_, NULL);
 }
+
+} //extern "C"
\ No newline at end of file
diff --git a/src/zmq_utils.cpp b/src/zmq_utils.cpp
index 148ef95..548471e 100644
--- a/src/zmq_utils.cpp
+++ b/src/zmq_utils.cpp
@@ -34,6 +34,7 @@
 #   include <sodium.h>
 #endif

+extern "C" {

 void zmq_sleep (int seconds_)
 {
@@ -198,3 +199,5 @@ int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key)
     return -1;
 #endif
 }
+
+} //extern "C"

Static library name clash

The build produces a static and dynamic library. However the static library was given the same OUTPUT_NAME as the dynamic library. This leads to one library build overwriting the other, never sure which one libzmq.lib actually was. Simple fix, just give it the name "libzmq-static", I think this is consistent with the other compilers:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d720c5..c7418d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -501,7 +501,7 @@ if(MSVC)
     RELEASE_POSTFIX "${_zmq_COMPILER}-mt-s-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
     DEBUG_POSTFIX "${_zmq_COMPILER}-mt-sgd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
     COMPILE_FLAGS "/D ZMQ_STATIC"
-    OUTPUT_NAME "libzmq")
+    OUTPUT_NAME "libzmq-static")
 else()
     add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
     if(ZMQ_BUILD_FRAMEWORK)

Unable to bind to specific interface when IPv6 is enabled for socket on Win8.

By using pyzmq:

c = zmq.Context.instance()
s = zmq.sokcet(zmq.ROUTER)
s.ipv6 = True
s.bind_to_random_port('tcp://192.168.56.1')  # Throws the "No such device" exception. The interface exists.
s.bind_to_random_port('tcp://fe80::8d3b:c128:5077:b64d') # No exception

Note that both on Linux and Mac it works.
I'm using Win8 Pro with all updates installed.

test_many_sockets failing from 4.0.4 to 4.0.7

Hi,

When I am calling ctest after building I always finish with an exception on the test test_many_sockets.
I tried all releases from 4.0.4 to 4.0.7.

output:

UpdateCTestConfiguration  from :/build/src/libzmq-v4.0.7-build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/build/src/libzmq-v4.0.7-build/DartConfiguration.tcl
Test project /build/src/libzmq-v4.0.7-build
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
Checking test dependency graph end
test 35
    Start 35: test_many_sockets

35: Test command: /build/src/libzmq-v4.0.7-build/bin/test_many_sockets
35: Test timeout computed to be: 9.99988e+06
35: test_many_sockets: /build/src/libzmq-v4.0.7/tests/test_many_sockets.cpp:40: void test_system_max(): Assertion `(int) sockets.size () < no_of_sockets' failed.
1/1 Test #35: test_many_sockets ................***Exception: Other  0.67 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.70 sec

The following tests FAILED:
         35 - test_many_sockets (OTHER_FAULT)
Errors while running CTest

Mac OS X, XCode 5: can't specify which C++ Standard Library to use

I tried all possible compiler switches I know of, but zeromq just always links with libc++. We have a library which is delivered in pre-compiled state and it links with libstdc++, unfortunately we can't compile zeromq so that it links with libstdc++. A flag for that purpose would be really great!

Odd crash on Mac OS X with ZeroMQ 4.0.6

This is an odd crash that happens sporadically:

0 libsystem_kernel.dylib 0x00007fff8debcc82 __kill + 10
1 libsystem_platform.dylib 0x00007fff88730f1a _sigtramp + 26
2 ??? 000000000000000000 0 + 0
3 libsystem_c.dylib 0x00007fff8b090b53 abort + 129
4 libsystem_malloc.dylib 0x00007fff8b0c41cb free + 428
5 libzmq.4.dylib 0x0000000112175c30 __gnu_cxx::new_allocatorstd::Rb_tree_node<zmq::pipe_t* >::deallocate(std::Rb_tree_nodezmq::pipe_t*, unsigned long) + 32 (new_allocator.h:97)
6 libzmq.4.dylib 0x0000000112175c02 std::Rb_tree<zmq::pipe_t, zmq::pipe_t
, std::_Identityzmq::pipe_t_, std::lesszmq::pipe_t*, std::allocatorzmq::pipe_t* >::M_put_node(std::Rb_tree_nodezmq::pipe_t*) + 50 (stl_tree.h:373)
7 libzmq.4.dylib 0x0000000112175b61 std::Rb_tree<zmq::pipe_t, zmq::pipe_t
, std::_Identityzmq::pipe_t_, std::lesszmq::pipe_t*, std::allocatorzmq::pipe_t* >::M_destroy_node(std::Rb_tree_nodezmq::pipe_t*) + 81 (stl_tree.h:404)
8 libzmq.4.dylib 0x0000000112175d1b std::Rb_tree<zmq::pipe_t, zmq::pipe_t
, std::_Identityzmq::pipe_t_, std::lesszmq::pipe_t*, std::allocatorzmq::pipe_t* >::M_erase(std::Rb_tree_nodezmq::pipe_t*) + 91 (stl_tree.h:1328)
9 libzmq.4.dylib 0x00000001121759d5 std::Rb_tree<zmq::pipe_t, zmq::pipe_t
, std::_Identityzmq::pipe_t_, std::lesszmq::pipe_t*, std::allocatorzmq::pipe_t* >::clear() + 37 (stl_tree.h:714)
10 libzmq.4.dylib 0x00000001121758a2 std::_Rb_tree<zmq::pipe_t*, zmq::pipe_t*, std::_Identityzmq::pipe_t*, std::lesszmq::pipe_t*, std::allocatorzmq::pipe_t* >::erase(std::Rb_tree_iteratorzmq::pipe_t*, std::Rb_tree_iteratorzmq::pipe_t*) + 114 (stl_tree.h:1339)
11 libzmq.4.dylib 0x0000000112175785 std::Rb_tree<zmq::pipe_t*, zmq::pipe_t*, std::Identityzmq::pipe_t*, std::lesszmq::pipe_t*, std::allocatorzmq::pipe_t* >::erase(zmq::pipe_t* const&) + 101 (stl_tree.h:1277)
12 libzmq.4.dylib 0x000000011217551d std::set<zmq::pipe_t*, std::lesszmq::pipe_t*, std::allocatorzmq::pipe_t* >::erase(zmq::pipe_t* const&) + 29 (stl_set.h:373)
13 libzmq.4.dylib 0x000000011218a24f zmq::session_base_t::pipe_terminated(zmq::pipe_t
) + 303 (session_base.cpp:215)
14 libzmq.4.dylib 0x000000011218a38f non-virtual thunk to zmq::session_base_t::pipe_terminated(zmq::pipe_t
) + 47 (session_base.cpp:230)
15 libzmq.4.dylib 0x000000011217fb93 zmq::pipe_t::process_pipe_term_ack() + 163 (pipe.cpp:313)
16 libzmq.4.dylib 0x000000011217840c zmq::object_t::process_command(zmq::command_t&) + 364 (object.cpp:108)
17 libzmq.4.dylib 0x0000000112169c2e zmq::io_thread_t::in_event() + 126 (io_thread.cpp:73)
18 libzmq.4.dylib 0x0000000112169d0c non-virtual thunk to zmq::io_thread_t::in_event() + 28 (io_thread.cpp:78)
19 libzmq.4.dylib 0x000000011216d6a3 zmq::kqueue_t::loop() + 803 (kqueue.cpp:199)
20 libzmq.4.dylib 0x000000011216d345 zmq::kqueue_t::worker_routine(void
) + 21 (kqueue.cpp:212)
21 libzmq.4.dylib 0x00000001121a246c thread_routine(void
) + 284 (thread.cpp:82)
22 libsystem_pthread.dylib 0x00007fff8af96268 _pthread_body + 131
23 libsystem_pthread.dylib 0x00007fff8af961e5 _pthread_start + 176
24 libsystem_pthread.dylib 0x00007fff8af9441d thread_start + 13

I've seen it multiple times, stack trace was the same. However I didn?t find any reproducible patter before it happens.

Our application is cross-platform (Linux, Windows, OSX) but we never seen anything like that on other platforms.

curve_keygen.c never sees HAVE_LIBSODIUM

things fixed in libzmq master but not in zeromq4-x:

  • curve_keygen.c includes platform.hpp
  • zmq_utils.h exposes zmq_z85_{en,de}code (encode used by curve_keygen.c)

Cant build under 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 to `crypto_box_beforenm'
./.libs/libzmq.so: undefined reference to `crypto_secretbox'
./.libs/libzmq.so: undefined reference to `crypto_box'
./.libs/libzmq.so: undefined reference to `crypto_box_keypair'
./.libs/libzmq.so: undefined reference to `sodium_init'
./.libs/libzmq.so: undefined reference to `crypto_box_open'
./.libs/libzmq.so: undefined reference to `randombytes_close'
./.libs/libzmq.so: undefined reference to `crypto_box_open_afternm'
./.libs/libzmq.so: undefined reference to `randombytes'
./.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

error compiling on 10.9

/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
CXXLD libzmq.la
ld: unknown option: --version-script=libzmq.vers
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libzmq.la] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

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

Compilation issue with MinGW + MSys

My apologies if this is something simple on my end, I'm quite inexperienced with MinGW.

I checked out zeromq4-x from github and ran ./autogen.sh. I receive the following output:

autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I config --force -I config
' is already registered with AC_CONFIG_FILES.
/usr/src/autoconf/autoconf-2.68-1/src/autoconf-2.68/lib/autoconf/status.m4:290:AC_CONFIG_FILES is expanded from...
configure.ac:432: the top level
/bin/m4: cannot remove temporary directory /tmp/ar5960.9128/m4-10exaV: Directory not empty
autom4te-2.68: /bin/m4 failed with exit status: 1
aclocal: /usr/bin/autom4te-2.68 failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
autogen.sh: error:autoreconf exited with status 0

Memory curruption due to double free

==8804== Thread 4:
==8804== Invalid read of size 1
==8804== at 0x4A08DAC: memcpy (mc_replace_strmem.c:882)
==8804== by 0x4C78163: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:113)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)
==8804== Address 0x54171df is 735 bytes inside a block of size 736 free'd
==8804== at 0x4A063F0: free (vg_replace_malloc.c:446)
==8804== by 0x4C5713B: zmq::msg_t::close() (msg.cpp:141)
==8804== by 0x4C781F0: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:83)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)
==8804==
==8804== Invalid free() / delete / delete[] / realloc()
==8804== at 0x4A063F0: free (vg_replace_malloc.c:446)
==8804== by 0x4C5713B: zmq::msg_t::close() (msg.cpp:141)
==8804== by 0x4C781F0: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:83)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)
==8804== Address 0x5416f00 is 0 bytes inside a block of size 736 free'd
==8804== at 0x4A063F0: free (vg_replace_malloc.c:446)
==8804== by 0x4C5713B: zmq::msg_t::close() (msg.cpp:141)
==8804== by 0x4C781F0: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:83)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)

Valgrind out put.

Socket type router dealer. This happens right after ERROR or AGAIN.

Assertion Failed: Permission Denied

I'm developing an application on Windows 10 with ZeroMQ for some background connection. I'm using Visual Studio 2008 C++ and ZeroMQ version 4.0.4.

When ZeroMQ connection and send the data, Windows will popup an exception with message box "Unhandled exception at ...". When I built a simple console application, in console output, there was a message "Assertion failed: Permission denied (......\src\tcp_connecter.cpp:284)".

There is no exception if I choose no-blocking the connection.

I tried to catch the error, while there was no exception captured, so I understand it might because of ZeroMQ background task. This style of error pop up is not friend to customer and I'm wondering whether there is a gentle way let application get the error and remind customer kindly.

the following is the sample code.

int main()
{
zmq::context_t zmq_ctx(1);
zmq::socket_t zmq_socket(zmq_ctx, ZMQ_REQ);

try {
    zmq_socket.connect("tcp://192.168.1.160:5000"); 

    std::string message = "Hello, World";
    zmq::message_t sock_msg(message.length());
    memcpy(sock_msg.data(), message.c_str(), message.length());

    zmq_socket.send(sock_msg);  // error happens 
}
catch (zmq::error_t e)
{
    printf("error happens in ZeroMQ: %s\n", e.what());
}

}

configure fails if it is executed in a different directory than the source tree

Executing configure --with-pgm from a different directory other than the source directory will fail with the following error message:

$ ls 
build  zeromq4-x
$ cd build
$ ../zeromq4-x/configure --with-pgm
 ../zeromq4-x configure: Unpacking libpgm-5.2.122~dfsg.tar.gz
 ../zeromq4-x/configure: line 19137: cd: foreign/openpgm: No such file or directory
 gzip: libpgm-5.2.122~dfsg.tar.gz: No such file or directory
 tar: This does not look like a tar archive
 tar: Exiting with failure status due to previous errors
 configure: error: cannot unpack the foreign/openpgm/libpgm-5.2.122~dfsg.tar.gz file

If configured without the option --with-pgm, the configure script will terminate without any issue.

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.

tests/testutil.hpp assumes _WIN32 is equivalent to using MSVC

Assuming _WIN32 equals MSVC breaks MinGW compilation of the tests directory. The code in question seems to enable some debugging facility.

Does such compiler specific code need to be included to begin with?
Or should the #ifdef test be patched to test for presence of MSVC? (which version?)

rpmbuild checkfile rpath error in centosx6.5_86_x64

hi,everyone!
I'm trying to build a rpm package of zeromq4.x . could someone help me understand what the error is and where the problem might be?

thankx ..

  • /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
  • WARNING: 'check-rpaths' detected a broken RPATH and will cause 'rpmbuild'
  •      to fail. To ignore these errors, you can set the '$QA_RPATHS'
    
  •      environment variable which is a bitmask allowing the values
    
  •      below. The current value of QA_RPATHS is 0x0000.
    
  • 0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor
  •           issue but are introducing redundant searchpaths without
    
  •           providing a benefit. They can also cause errors in multilib
    
  •           environments.
    
  • 0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute
  •           nor relative filenames and can therefore be a SECURITY risk
    
  • 0x0004 ... insecure RPATHs; these are relative RPATHs which are a
  •           SECURITY risk
    
  • 0x0008 ... the special '$ORIGIN' RPATHs are appearing after other
  •           RPATHs; this is just a minor issue but usually unwanted
    
  • 0x0010 ... the RPATH is empty; there is no reason for such RPATHs
  •           and they cause unneeded work while loading libraries
    
  • 0x0020 ... an RPATH references '..' of an absolute path; this will break
  •           the functionality when the path before '..' is a symlink
    
  • Examples:
  • - to ignore standard and empty RPATHs, execute 'rpmbuild' like
  • $ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild my-package.src.rpm
  • - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like
  • $ RPM_BUILD_ROOT= /usr/lib/rpm/check-rpaths

  • ERROR 0001: file '/usr/bin/curve_keygen' contains a standard rpath '/usr/lib64' in [/usr/lib64]
    error: Bad exit status from /var/tmp/rpm-tmp.FAxjLp (%install)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.FAxjLp (%install)

vs2008 builds fail with zmq 4.1.4

VS2008 project fails to build libzmq with "Cannot open include file: stdint.h". I added a copy of that file to my directory and added it to the include path.

It then failed with "error C3861: if_nametoindex: identifier not found". I tried the instructions listed for a similar VS2013 problem, and added iphlpapi.lib to the link libs, but that didn't fix the compile problem.

I have seen similar problems posted against 4.1.4. Will this issue be addressed in the 4.1.x line?

Windows/mingw64 build fails w/ signed/unsigned compare warning

When building on windows using mingw64, the build fails trying to compile socket_base.cpp:122 - comparing the fd w/ -1.

Change fd8d6d471f486fd2392a17774f4c26e99af21f66 in master fixes this issue. Is it possible to get this change back ported to zeromq4-x?

Warning: Implicit conversion loses integer precision

Getting warnings in Xcode.
In zmq.cpp, in the function zmq_poll(), the lines

return usleep (timeout_ * 1000);

and

timeout = end - now;

In zmp_utils.cpp, in the function zmq_z85_decode() the line

unsigned int string_len = strlen (string);

You need to either do a cast (in the case of usleep() since it is a system function and it expects and unsigned int), or you need to change the data type of the variables.

zmq_z85_decode() incredibly slow on large inputs

While working on Pretty Curved Privacy, I stumbled upon a problem with zmq_z85_decode(). It works good in general but becomes really slow on large Z85 encoded inputs.

Example: I create a 1MB Z85 encoded file:

% dd if=/dev/random bs=1024 count=1000 | pcp1 -z -O testfile
1000+0 records in
1000+0 records out
1024000 bytes transferred in 0.081855 secs (12509917 bytes/sec)

% ls -l testfile 
-rw-r--r--  1 user user  1316132 Nov  4 14:11 testfile

% head -2 testfile 
----- BEGIN Z85 ENCODED FILE -----
17H&xr.f^C>5lb#K1].p^70sdpV*Q5!sD}HSFfYfQf?e/E?1Ww{m.Ui0qzeSk{fY$hrLy#[

Now, when decoding it, it takes 4 minutes:

% time pcp1 -Z -I testfile -O /dev/null
real    4m5.067s
user    3m52.699s
sys     0m0.008s

I have traced it down to the while loop in zmq_z85_decode(), this is where it takes such a long time.

That's not really a bug but I want to use pcp for file encryption and time matters in this area.

inproc ZMQ_PUB/SUB crashed at zmq_msg_recv

image

zeromq version:latest on git up, i pull it 2 days agao
I build a simple server with zeromq and libuv. Use zeromq as inproc message dispatcher.
With each tcp connection, i create a zmq_sub socket(inproc) to receive some data and use uv_write send it to client.

But sometimes it will crash.

I paste the crashed screen shot on top line.

BTW: Is there another way to post my question? Cause I wonder is it right that i post my question here?

Make install installs as zmq 3

The following is output during a make install

 /bin/mkdir -p '/usr/local/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libzmq.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libzmq.so.3.0.0 /usr/local/lib/libzmq.so.3.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libzmq.so.3.0.0 libzmq.so.3 || { rm -f libzmq.so.3 && ln -s libzmq.so.3.0.0 libzmq.so.3; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libzmq.so.3.0.0 libzmq.so || { rm -f libzmq.so && ln -s libzmq.so.3.0.0 libzmq.so; }; })
libtool: install: /usr/bin/install -c .libs/libzmq.lai /usr/local/lib/libzmq.la
libtool: install: /usr/bin/install -c .libs/libzmq.a /usr/local/lib/libzmq.a
libtool: install: chmod 644 /usr/local/lib/libzmq.a
libtool: install: ranlib /usr/local/lib/libzmq.a
libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

The library is installed as libzmq.so.3 instead of 4 even though it is version 4 which is being compiled and installed. This was done with the download of the POSIX tarball downloaded from zeromq.org.

php zeromq extension: Unable to load dynamic library php_zmq.dll

I have XAMPP with PHP Version 5.6.8. I want to install zeromq extension. Tried the following dlls from http://pecl.php.net/package/zmq/1.1.2/windows. Of course I have extension=php_zmq.dll in \xampp\php\php.ini

php_zmq-1.1.2-5.6-nts-vc11-x64
php_zmq-1.1.2-5.6-ts-vc11-x64

php_zmq-1.1.2-5.6-nts-vc11-x86
php_zmq-1.1.2-5.6-ts-vc11-x86

Getting the error

PHP Warning: PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_zmq.dll' - %1 is not a valid Win32 application.in
Unknown on line 0

zeromq-4.0.1, Xcode 5.0.1

Warning: self-explanatory from description:

/Users/dev/Projects/ZeroMQ-Framework.git.NEW/zeromq-4.0.1/src/ipc_listener.cpp:127:24: 
'tempnam' is deprecated: 
This function is provided for compatibility reasons only.  
Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.

And, offending code...

    //  Allow wildcard file
    if (addr[0] == '*') {
        char *tmpstr = tempnam (NULL, NULL);
        addr.assign (tmpstr);
        free (tmpstr);
    }

close zmq_socket monitor

I need to stop a socket monitor and when i close it , it remain on the zmq_msg_recv. I can't destroy the context because i have other monitor that listen for other connection. There is a way to notify it?

ZMQ 4.0.4 crash

*** glibc detected *** /home/cetc/code/codeset/civilmanager_access/ca: double free or corruption (fasttop): 0x00007fffd400e7f0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x38fb075e66]
/usr/local/lib/libzmq.so.4(+0x1d933)[0x7ffff7b98933]
/usr/local/lib/libzmq.so.4(+0x3dfc9)[0x7ffff7bb8fc9]
/usr/local/lib/libzmq.so.4(+0x324a3)[0x7ffff7bad4a3]
/usr/local/lib/libzmq.so.4(+0x29f88)[0x7ffff7ba4f88]
/usr/local/lib/libzmq.so.4(+0x19384)[0x7ffff7b94384]
/usr/local/lib/libzmq.so.4(+0x1848e)[0x7ffff7b9348e]
/usr/local/lib/libzmq.so.4(+0x37a46)[0x7ffff7bb2a46]
/lib64/libpthread.so.0[0x38fb4079d1]
/lib64/libc.so.6(clone+0x6d)[0x38fb0e89dd]
#0 0x00000038fb032625 in raise () from /lib64/libc.so.6
#1 0x00000038fb033e05 in abort () from /lib64/libc.so.6
#2 0x00000038fb070537 in libc_message () from /lib64/libc.so.6
#3 0x00000038fb075e66 in malloc_printerr () from /lib64/libc.so.6
#4 0x00007ffff7b98933 in zmq::msg_t::close (this=0x7fffdc0051d0) at msg.cpp:137
#5 0x00007ffff7bb8fc9 in zmq::encoder_base_tzmq::v2_encoder_t::encode (this=0x7fffdc000d60, data
=0x7fffeebfc078, size
=Unhandled dwarf expression opcode 0xf3

) at encoder.hpp:83
#6 0x00007ffff7bad4a3 in zmq::stream_engine_t::out_event (this=0x7fffdc0051b0) at stream_engine.cpp:284
#7 0x00007ffff7ba4f88 in zmq::session_base_t::read_activated (this=0x7fffdc005540, pipe_=0x7fffdc009900) at session_base.cpp:246
#8 0x00007ffff7b94384 in zmq::io_thread_t::in_event (this=0x7fffe8003170) at io_thread.cpp:73
#9 0x00007ffff7b9348e in zmq::epoll_t::loop (this=0x7fffe80033f0) at epoll.cpp:165
#10 0x00007ffff7bb2a46 in thread_routine (arg_=0x7fffe8003460) at thread.cpp:81
#11 0x00000038fb4079d1 in start_thread () from /lib64/libpthread.so.0
#12 0x00000038fb0e89dd in clone () from /lib64/libc.so.6

My server is using two sockets now. One is Push type. The other is Sub. when I do stress test I only use the Push socket.With increasing pressure zmq crash.I can not judge whether it is due to my own code. Any Idea?

Make issue missing libzmq.vers

When attempting to make in install directory the following error is output by make:
Making all in src
make[1]: Entering directory /home/a1g0rithm/zeromq/zeromq-4.0.4/src' make all-am make[2]: Entering directory/home/a1g0rithm/zeromq/zeromq-4.0.4/src'
CXXLD libzmq.la
/usr/bin/ld: cannot open linker script file libzmq.vers: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [libzmq.la] Error 1
make[2]: Leaving directory /home/a1g0rithm/zeromq/zeromq-4.0.4/src' make[1]: *** [all] Error 2 make[1]: Leaving directory/home/a1g0rithm/zeromq/zeromq-4.0.4/src'
make: *** [all-recursive] Error 1

This was apparently fixed by changing line 174 (#62) in Makefile.am, but it's not working with either setting, I can reproduce if need be. I cannot locate this file on the system anywhere, after expanding the tar.

Regards,
**_NOTE_
Was able to fix by cloning from git, TAR installation file do not contain 'libzmq.vers'...

Missing (obsolete) #include when compiling with mingw

When compiling with mingw, <Mstcpip.h> (src/windows.hpp:168) is missing. Just commenting out the include suffices, as <ws2tcpip.h> is also included.

I am not sure what the effects will be when compiling with MSVC or other configurations (currently no means to test that), so I am hesitant to submit a pull_request.

Any advice?

CMake fails to compile

When adding an external project to CMake:

ExternalProject_Add(
    EP_zeromq
    PREFIX     ${CMAKE_CURRENT_BINARY_DIR}
    GIT_REPOSITORY https://github.com/zeromq/zeromq4-x.git
    GIT_TAG v4.0.3
    SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/zeromq

    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DZMQ_BUILD_FRAMEWORK=0
    )

The build fails with:

[ 66%] Building CXX object CMakeFiles/test_connect_resolve.dir/tests/test_connect_resolve.cpp.o
In file included from /code/build/thirdparty/src/zeromq/tests/test_connect_resolve.cpp:20:0:
/code/build/thirdparty/src/zeromq/tests/testutil.hpp:25:31: fatal error: ../src/platform.hpp: No such file or directory
compilation terminated.
make[5]: *** [CMakeFiles/test_connect_resolve.dir/tests/test_connect_resolve.cpp.o] Error 1
make[4]: *** [CMakeFiles/test_connect_resolve.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [thirdparty/src/EP_zeromq-stamp/EP_zeromq-build] Error 2
make[1]: *** [thirdparty/CMakeFiles/EP_zeromq.dir/all] Error 2
make: *** [all] Error 2

INSTALL direction example doesn't work

I'm trying to compile zmq from the source in this repo.

The INSTALL file mentions this as an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix

To me that means I should be able to compile ZMQ using gcc with the C99 standard (even though GitHub marks ZMQ as a C++ project).

When I try to compile on Ubuntu 16.04 LTS, I get:

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 for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '1000' is supported by ustar format... yes
checking whether GID '1000' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for gcc... c99
checking whether the C compiler works... no
configure: error: in `/home/j/repos/zeromq4-1':
configure: error: C compiler cannot create executables
See `config.log' for more details

I have attached the config.log that was generated by configure.

Any ideas on how to get this working?

ZMQ_STREAM sockets should be notified for peer disconnections.

As discussed on the mailing list, servers using ZMQ_STREAM sockets need to keep per-connection state (like buffers) but are never notified that connections have been closed or dropped. The obvious workaround, using per-connection timeouts, is a pain to maintain, inefficient and often undesirable.

Suggested improvement: when a peer disconnects, have zmq_poll() mark the ZMQ_STREAM socket as readable and let the next zmq_msg_recv() return a 0-length message as a "peer disconnected" notification. When the applications receives the 0-length message, it should drop the per-connection data for that connection.

zmq_z85_decode() doesn't catch invalid z85 chars within base85 range

Not sure if this is a bug, but at least it's misleading.

Given the following test program:

char tilde[6] = "~~~~~";
byte dst[4];
int it
if(zmq_z85_decode(dst, tilde) == NULL) {
  fprintf(stderr, "fail\n");
}
else {
  for(i=0; i<4;++i) fprintf(stderr, "%02x", dst[i]);
  fprintf(stderr, "\n");
}

This prints 00000000. The same works with ''''' for example. It's misleading since characters such as ~ are not part of the z85 character base and should therefore not produce a 0, but an decoder error.

Or so I think.

best,
Tom

Cmake cross-compile linker error

When using cmake to cross-compile zmq, a linker error occurs (using i686-w64-mingw32-g++ (GCC) 4.8.2):

CMakeFiles/libzmq.dir/version.rc.res: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed

The version.rc file is not compiled correctly. Solution is to add -O coff option to the RC compiler. Pull request will follow shortly.

compilation with MSVC 2008 is broken: stdint.h is not available here

1>------ Build started: Project: libzmq, Configuration: Release Win32 ------
1>Performing Pre-Build Event...
1> 1 file(s) copied.
1>Compiling...
1>zmq_utils.cpp
1>d:\dev\github\zeromq4-x\src../include/zmq_utils.h(25) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
1>zmq.cpp
1>d:\dev\github\zeromq4-x\src../include/zmq.h(390) : error C2061: syntax error : identifier 'uint8_t'
...
...

The same issue was fixed 4 months ago in zeromq/libzmq@31ee92f

Out of source builds failed

reproducible steps below:

$ cd /tmp

$ git clone https://github.com/zeromq/zeromq4-x.git && cd zeromq4-x
$ ./autogen.sh

$ mkdir zmq4_build && cd zmq4_build
$ ../zeromq4-x/configure --without-documentation
...

$ make
...
  CXX    libzmq_la-raw_encoder.lo
  CXXLD  libzmq.la
/usr/bin/ld: cannot open linker script file libzmq.vers: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [libzmq.la] Error 1
make[2]: Leaving directory `/tmp/zmq4_build/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/zmq4_build/src'
make: *** [all-recursive] Error 1

Build fails if libsodium is used

Build fails if libsodium is used. The patch below fixes it

0MQ version 4.0.2
gcc version 4.4.5 (Debian 4.4.5-8)
Linux 2.6.32-5-amd64

--- configure.ac    2013-10-08 18:03:22.000000000 +0200
+++ configure.ac.new    2013-11-24 19:58:57.000000000 +0100
@@ -257,7 +257,7 @@
 # Checks for libraries
 AC_CHECK_LIB([pthread], [pthread_create])
 AC_CHECK_LIB([rt], [clock_gettime])
-AC_CHECK_LIB([sodium], [sodium_init],,AC_MSG_WARN(libsodium is needed for CURVE security))
+AC_CHECK_LIB([sodium], [sodium_init],[libzmq_pedantic="no"],AC_MSG_WARN(libsodium is needed for CURVE security))

 #
 # Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec

CDECL calling convention is not explicitly specified in zmq.h

If a client application is built with "stdcall" calling convention and links with ZMQ it gets "unresolved external symbols" errors (at least in Visual Studio)

The problem can be solved by providing explicit "cdecl" specification in all external ZMQ functions prototypes in "zmq.h"

(actually, that's the way the problem is solved in our stdcall-compiled project - by manual editing "zmq.h")

Warning: "tempnam" is deprecated

Warning in Xcode:

/Pods/libzmq/src/ipc_listener.cpp:127:24: 'tempnam' is deprecated: 
This function is provided for compatibility reasons only.  
Due to security concerns inherent in the design of tempnam(3), it is highly 
recommended that you use mkstemp(3) instead.

This library is being used by an iOS app via CocoaPods (https://cocoapods.org/pods/libzmq). It looks like the issue was fixed a long time ago (Nov 2013) in the libzmq repo (zeromq/libzmq#794), but it hasn't been propagated yet into this repo and its CocoaPod.

zeromq-4.0.5 Solaris 11, when libsodium not in use, libssp should not be added.

libsodium is not part of standard Solaris. However someone may compile it. libsodium requires libssp Currently on solaris libssp is added even if libsodium is NOT in use which cause a compile issue. libssp is also not part of solaris.

Fix only add libssp if libsodium is found.
Only use libsodium if libssp is also found.

solaris)
....cut...
ssp library is required for libsodium on Solaris-like systems
LDFLAGS="-lssp $LDFLAGS"

Some extra reading
http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt

libzmq.so:
libnsl.so.1 => /lib/libnsl.so.1
libsocket.so.1 => /lib/libsocket.so.1
libstdc++.so.6 => /usr/sfw/lib/libstdc++.so.6
libm.so.2 => /lib/libm.so.2
libgcc_s.so.1 => /usr/sfw/lib/libgcc_s.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libc.so.1 => /lib/libc.so.1
libzmq.so.4:
libnsl.so.1 => /lib/libnsl.so.1
libsocket.so.1 => /lib/libsocket.so.1
libstdc++.so.6 => /usr/sfw/lib/libstdc++.so.6
libm.so.2 => /lib/libm.so.2
libgcc_s.so.1 => /usr/sfw/lib/libgcc_s.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libc.so.1 => /lib/libc.so.1

gcc version 3.4.3 (csl-sol210-3_4-20050802)
SunOS XXX 5.11 11.0 i86pc i386 i86pc Solaris

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.