Doron Somech
061ce6cea1
Merge pull request #3901 from bluca/fuzzers
...
Problem: test_connect_null_fuzzer doesn't correctly initialise messages
2020-05-07 13:34:26 +03:00
Luca Boccassi
5fd0711196
Problem: memory leak in test_connect_null_fuzzer
...
Solution: initialize message before re-using it so that
receive doesn't fail and messages can be deallocated
2020-05-06 22:26:03 +01:00
Luca Boccassi
243503c29e
Problem: set infinite timeouts on some tests by mistake
...
Solution: remove it
2020-05-06 20:56:36 +01:00
Doron Somech
f7b215c639
Merge pull request #3900 from bluca/fuzzers
...
Use fixed keys in fussers curve tests, run fuzzers github action only on PRs, attempt to fix uninitialised error in test helper
2020-05-06 15:12:03 +03:00
Luca Boccassi
fd3e5daaeb
Problem: fuzzing Github action ran on pushes on forks and fails
...
Solution: run in on PRs only as oss-fuzz uses Docker so the repository is
hard-coded
2020-05-06 12:39:45 +01:00
Luca Boccassi
346f8b8b20
Problem: uninitialised error in testutil helper
...
Solution: memset struct addrinfo to be sure
2020-05-06 11:51:55 +01:00
Luca Boccassi
5819867cd3
Problem: fuzzer curve tests use random keys
...
Solution: use fixed keys to reduce variability and increase the chance
that random data derived from it can break something
2020-05-06 11:47:15 +01:00
Doron Somech
d7e58fc880
Merge pull request #3899 from bluca/fuzzers
...
Problems: address sanitizer not enabled, oss-fuzz images not build-tested
2020-05-06 09:51:11 +03:00
Luca Boccassi
9f94aa866f
Problem: oss-fuzz images not tested on PRs
...
Solution: integrate oss-fuzz build via Github actions
2020-05-06 00:36:29 +01:00
Luca Boccassi
5b7f67a822
Problem: memory sanitizer not enabled in CI
...
Solution: add -fsanitize=leak to the sanitizers flag, and disable
test_many_sockets as it currently fails due to:
https://github.com/zeromq/libzmq/issues/3898
2020-05-06 00:14:02 +01:00
Luca Boccassi
c2ffe2e6d2
Merge pull request #3897 from bluca/fuzzers
...
Problem: test_hello_msg binds to hard-coded port and fails when it's in use
2020-05-05 20:36:26 +01:00
Luca Boccassi
2ac5ee7307
Problem: test_hello_msg binds to hard-coded port and fails when it's in use
...
Solution: use the common wildcard bind pattern instead
2020-05-05 14:13:38 +01:00
Doron Somech
04ecff399b
Merge pull request #3896 from bluca/fuzzers
...
Problems: memory sanitizer fails due to uninitialised global, want to run more tests with sanitizer
2020-05-05 15:51:00 +03:00
Luca Boccassi
3770937de3
Problem: we want to check for undefined behaviour in the CI
...
Solution: enable GCC's UBSAN in the sanitizer job
2020-05-05 12:58:39 +01:00
Luca Boccassi
0c5396849b
Problem: syntax errors in ci_build.sh
...
Solution: fix them
2020-05-05 12:16:19 +01:00
Luca Boccassi
cdd9e9d1f4
Problem: Travis uses old-old-old-stable Ubuntu by default
...
Solution: set default to bionic, and leave a few jobs that manually
set Trusty/Xenial to have more coverage
This is especially useful to get newer gcc for address sanitizer support
2020-05-05 11:48:55 +01:00
Luca Boccassi
96d3cb39e4
Problem: fuzz input which causes extra-large message allocation not stored
...
Solution: add it
2020-05-05 11:48:11 +01:00
Luca Boccassi
9ab3fbeee2
Problem: we want to have multiple seed corpora per fuzzer binary
...
Solution: store them each as a single line in the text file and convert them
at install time
2020-05-05 11:48:11 +01:00
Luca Boccassi
c4fd6dfea7
Problem: sanitizer tests cannot allocate much memory
...
Solution: restrict maximum message size to 64MB in tests
2020-05-05 11:42:06 +01:00
Luca Boccassi
7df845fb82
Problem: memory sanitizer detects uninitialised global variable usage
...
Solution: revert "Problem: complexity of start_connecting"
https://travis-ci.org/github/google/oss-fuzz/jobs/680325364
This reverts commit c590873ff7a81a3c373884eab37cbe2068fbfe4a.
Conflicts:
src/session_base.cpp
src/session_base.hpp
2020-05-04 22:02:04 +01:00
Doron Somech
309d1f1cb7
Merge pull request #3894 from bluca/fuzzers
...
Problems: sub/cancel broken with CURVE, fuzzers need corpora and better unit testing
2020-05-04 14:43:47 +03:00
Luca Boccassi
6b259224ee
Problem: fuzzer regression tests do very little
...
Solution: run them with the seed corpora
2020-05-04 11:42:22 +01:00
Luca Boccassi
c8e62cb2e0
Problem: no dictionaries and seed corpora for fuzzers
...
Solution: add them and install them where oss-fuzz expects them
2020-05-04 02:11:15 +01:00
Luca Boccassi
60ccf54fa6
Problem: sub/cancel broken with CURVE
...
Solution: handle downgrading sub/cancel messages in CURVE engine
2020-05-03 17:42:53 +01:00
Luca Boccassi
534580c31d
Merge pull request #3893 from gummif/gfa/blob-ref
...
Problem: extra blob copy
2020-05-02 14:26:06 +01:00
Luca Boccassi
103e39bd6f
Merge pull request #3892 from gummif/gfa/poller-event
...
Problem: unnecessary event struct and UB
2020-05-01 23:42:32 +01:00
Gudmundur Adalsteinsson
47a080aac0
Problem: extra blob copy
...
Solution: use reference tag
2020-05-01 22:27:44 +00:00
Gudmundur Adalsteinsson
284d90a436
Problem: unnecessary event struct and UB
...
Solution: simply use zmq_poller_event_t
2020-05-01 22:12:30 +00:00
Constantin Rack
e05fe370fe
Merge pull request #3890 from gummif/gfa/retfd
...
Problem: -1 used for invalid socket
2020-04-29 17:23:10 +00:00
Gudmundur Adalsteinsson
e18772f942
Problem: -1 used for invalid socket
...
Solution: use retired_fd instead
2020-04-29 17:12:08 +00:00
Luca Boccassi
aa29f7caff
Merge pull request #3889 from bluca/fuzzers
...
Problem: testutil build broken with gcc 4.4 on CentOS 6
2020-04-28 13:33:03 +01:00
Luca Boccassi
1443c0e787
Merge pull request #3887 from gummif/gfa/unify-fd
...
Problem: Multiple fd_t definitions
2020-04-28 13:32:52 +01:00
Luca Boccassi
5867d7cf5f
Merge pull request #3888 from gummif/gfa/poller-fd
...
Problem: Poller event fd unspecified
2020-04-28 11:26:58 +01:00
Gudmundur Adalsteinsson
d426f2ab0c
Problem: Multiple fd_t definitions
...
Solution: Unify definition
2020-04-28 08:50:18 +00:00
Luca Boccassi
a909e7296d
Problem: testutil build broken with gcc 4.4 on CentOS 6
...
Solution: do not alias sockaddr_un, but take a copy
tests/testutil.cpp: In function 'fd_t bind_socket_resolve_port(const char*, const char*, char*, int, int)':
tests/testutil.cpp:468: error: dereferencing pointer 'un_addr' does break strict-aliasing rules
2020-04-28 00:49:37 +01:00
Luca Boccassi
882cb6fdfb
Problem: static analysis shows dead store in testutil
...
Solution: remove it and rework the ifdefs to be safe against uninitialised use
2020-04-28 00:49:37 +01:00
Luca Boccassi
12a2f81717
Merge pull request #3885 from bluca/fuzzers
...
Problem: no fuzz testing
2020-04-27 23:21:50 +01:00
Gudmundur Adalsteinsson
bf22a9f3e9
Problem: Poller event fd unspecified
...
Solution: Specify an invalid file descriptor for socket events
2020-04-27 21:00:45 +00:00
Luca Boccassi
96787c35f8
Problem: no fuzz testing for API with variable input
...
Solution: add tests for zmq_bind, zmq_connect and zmq_z85_decode
2020-04-27 01:18:45 +01:00
Luca Boccassi
57df836381
Problem: no fuzz testing for CURVE
...
Solution: add simple, initial tests for client and server
2020-04-27 01:18:31 +01:00
Luca Boccassi
8e774f3cd6
Problem: no integration with fuzz testing
...
Solution: port the 2 new tests from oss-fuzz, and wire them up to
be ran manually with a static input in normal builds.
Add a specific configure option to use the external fuzzing engine
from oss-fuzz.
2020-04-27 01:18:08 +01:00
Luca Boccassi
c6d3bc68c8
Problem: ZMTP mocks duplicated across tests
...
Solution: define buffers in common header
2020-04-26 21:04:53 +01:00
Luca Boccassi
4f35d1af1a
Problem: using BSD sockets in test is duplicated across many tests
...
Solution: refactor in testutil.lib, so that they can be used for fuzzers too
2020-04-26 17:59:26 +01:00
Luca Boccassi
c81a973cd8
Problem: assert macros not detecting errors from syscall that do not return -1 on failure
...
Solution: add a new TEST_ASSERT_SUCCESS_RAW_ZERO_ERRNO macro so that
it can check explicitly for non-zero values. This will be used
for getaddrinfo().
2020-04-26 17:59:26 +01:00
Luca Boccassi
727637082f
Problem: test_shutdown_stress_tipc fails sometimes
...
Solution: create socket in the same thread where it is used
2020-04-26 15:08:04 +01:00
Luca Boccassi
b56195e995
Merge pull request #3882 from laplaceyang/relicense
...
RELICENSE: Grant from laplaceyang.
2020-04-22 10:16:42 +01:00
laplaceyang
491defdf12
RELICENSE: Grant from laplaceyang.
2020-04-22 17:11:58 +08:00
Luca Boccassi
9984d43143
Merge pull request #3879 from somdoron/master
...
problem: appveyor is very slow
2020-04-20 21:20:21 +01:00
Doron Somech
81056a7237
problem: appveyor is very slow
...
Solution: move to github actions
2020-04-20 22:55:28 +03:00
Luca Boccassi
a525323757
Merge pull request #3878 from Eelis/master
...
Problem: out-of-bounds array access in socket_poller::check_events.
2020-04-20 12:50:41 +01:00
Luca Boccassi
f00f464566
Merge pull request #3866 from gummif/gfa/poller-refactoring
...
Problem: poller item lookup can be simplified
2020-04-20 09:34:57 +01:00
Eelis van der Weegen
063f14a940
Problem: out-of-bounds array access in socket_poller::check_events.
2020-04-20 03:22:31 +02:00
Gudmundur Adalsteinsson
0b32fb3629
Problem: poller item lookup can be simplified
...
Solution: Extract generic find function
2020-04-19 20:53:56 +00:00
Luca Boccassi
d882e807dd
Merge pull request #3876 from somdoron/HELLO_MSG
...
problem: checking the wrong socket when sending hello msg
2020-04-18 23:32:31 +01:00
Luca Boccassi
08d94d0e16
Merge pull request #3877 from gummif/gfa/spinlock-fix
...
Problem: Spinning on atomics can cause hangs
2020-04-18 22:21:47 +01:00
Doron Somech
6ca07a30e3
problem: checking the wrong socket when sending hello msg
2020-04-18 22:45:49 +03:00
Doron Somech
2745ac31d7
Merge pull request #3875 from bluca/test
...
Fix coverage job and appveyor job
2020-04-18 20:25:17 +03:00
Gudmundur Adalsteinsson
ff80089939
Problem: Spinning on atomics can cause hangs
...
Solution: Add a sleep in the loop. Some versions of
valgrind may hang when spinning on atomic variables.
2020-04-18 12:44:59 +00:00
Luca Boccassi
5a78bad2a8
Problem: coverage CI job fails
...
Solution: bump OS to Xenial for newer python libraries
2020-04-18 11:06:58 +01:00
Luca Boccassi
7cac73401a
Problem: test_many_sockets always fails on Windows
...
Solution: don't run it
2020-04-18 11:03:15 +01:00
Luca Boccassi
ada6f0c058
Merge pull request #3871 from somdoron/DISCONNECT_MSG
...
problem: router doesn't know when peer disconnected
2020-04-18 10:49:50 +01:00
Luca Boccassi
7ce7b8b888
Merge pull request #3874 from shgalym/patch-1
...
typo fix root README
2020-04-18 10:48:07 +01:00
Galymzhàn Sh
d0b5713709
typo fix root README
2020-04-18 15:24:14 +06:00
Luca Boccassi
97a52af242
Merge pull request #3872 from gummif/gfa/poller-size
...
Problem: No support to query poller size
2020-04-17 22:50:34 +01:00
Gudmundur Adalsteinsson
9c6738bb45
Problem: No support to query poller size
...
Solution: Add zmq_poller_size that queries the number
of objects registered, allowing safer usages of poller
to avoid livelock situations.
2020-04-17 18:37:01 +00:00
Doron Somech
81444136d5
problem: router doesn't know when peer disconnected
...
ZMQ_ROUTER_NOTIFY doesn't have a context and doesn't play nice with protocols. with ZMQ_DISCONNECT_MSG we can set it to a protocol message, like DISCONNECT in majordomo. Router will send it when a peer is disconnected. Another advantage of ZMQ_DISCONNECT_MSG is that it also works on inproc.
Together with ZMQ_HEARTBEAT it allows to build very reliable protocols, and much simpler as well.
2020-04-17 18:04:28 +03:00
Luca Boccassi
4c1d720a47
Merge pull request #3870 from somdoron/HELLO_MSG
...
problem: ZMQ_HEARTBEAT is not useful without sending an hello message
2020-04-17 15:24:38 +01:00
Doron Somech
93da6763b0
problem: ZMQ_HEARTBEAT is not useful without sending an hello message
...
When using ZMQ_HEARTBEAT one still needs to implement application-level heartbeat in order to know when to send a hello message.
For example, with the majordomo protocol, the worker needs to send a READY message when connecting to a broker. If the connection to the broker drops, and the heartbeat recognizes it the worker won't know about it and won't send the READY msg.
To solve that, the majordomo worker still has to implement heartbeat. With this new option, whenever the connection drops and reconnects the hello message will be sent, greatly simplify the majordomo protocol, as now READY and HEARTBEAT can be handled by zeromq.
2020-04-17 14:54:58 +03:00
grmt
718ad8ab96
add wss transport and fix tipc tests when building using cmake on linux ( #3857 )
...
* Allow CMAKE to generate ws and wss transports
I guess there is little use of just ws transport, so by default
GnuTLS (and libsodium) are enabled
* cmake libzmq including wss transport (ubuntu 19.10 and ubuntu 19.10 + wsl 1.0)
test_security_fails (libsodium assert !?)
* updated relicense
* make external libs gnutls nss sodium optional
* #ifdef WSS classes and functions, build test*ws* only if correct libs are included, warning if libs not present
* make libsodium optional
* cmake fix tests TIPC transport
* clang-format pointed out a wrongly placed #ifdef
* GnuTLS before 3.6.7 is not safe
* msvc doesn't agree with strlen in array declaration, test_socks now at least compiles on windows
* windows: libsodium build fails, missing include dirs set by env var
* ws transport test only works when GnuTLS is found
* Fixed condition to use NSS / built in SHA1, so that test_ws_transport should now pass, also when GnuTLS is not found
2020-04-13 23:03:19 +01:00
Luca Boccassi
7276b6809a
Merge pull request #3868 from gummif/gfa/poller-sleep
...
Problem: poller sleeps forever if no events
2020-04-13 22:52:46 +01:00
Luca Boccassi
ef4bb9aa5e
Merge pull request #3865 from gummif/gfa/poller-fd-init
...
Problem: poller item fd uninitialized
2020-04-13 22:51:35 +01:00
Gudmundur Adalsteinsson
458d805eb6
Problem: poller sleeps forever if no events
...
Solution: Fail with error if no events are active and timeout is infinite
2020-04-13 21:18:12 +00:00
Gudmundur Adalsteinsson
a468ac782a
Problem: poller item fd uninitialized
...
Solution: Set to zero for socket events
2020-04-13 20:08:08 +00:00
Gudmundur Adalsteinsson
7b1fef28f9
Problem: boilerplate when init msg from data copy ( #3860 )
...
* Problem: boilerplate when init msg from data copy
Solution: Add zmq_msg_init_buffer to construct
a message by copying memory from buffer.
2020-04-09 23:59:43 +01:00
Luca Boccassi
347ff07c94
Merge pull request #3862 from gummif/gfa/poller-formatting
...
Problem: Strange zmq_poller doc formatting
2020-04-09 16:23:02 +01:00
Gudmundur Adalsteinsson
fa2af05d47
Problem: Strange zmq_poller doc formatting
...
Solution: Add newlines and extra asterisks
2020-04-09 14:18:34 +00:00
Luca Boccassi
ae45ac4e1f
Merge pull request #3861 from gummif/gfa/send-doc
...
Problem: zmq_send doc does not match declaration
2020-04-09 15:02:03 +01:00
Gudmundur Adalsteinsson
cbdf075658
Problem: zmq_send doc does not match declaration
...
Solution: add const to pointer type
2020-04-09 13:55:42 +00:00
Luca Boccassi
3c13e9222d
Merge pull request #3851 from gummif/gfa/ts-int
...
Problem: ZMQ_THREAD_SAFE is not bool
2020-03-23 21:11:29 +00:00
Gudmundur Adalsteinsson
e1fc84141d
Problem: ZMQ_THREAD_SAFE is not bool
...
Solution: Change documentation value type to int
2020-03-23 20:49:39 +00:00
Luca Boccassi
323420c5ea
Merge pull request #3850 from JSYoo5B/git-ignore-fix-track
...
Fix gitignore tracking file list
2020-03-18 08:42:22 +00:00
JaeSang Yoo
eceaaf360b
Problem: executable sources are not tracked
...
Solution: Fix .gitignore's exceptions for sources in tools/
2020-03-18 12:51:47 +09:00
Luca Boccassi
876d4bfead
Merge pull request #3849 from ferdnyc/zeromq-config-install
...
Install CMake config to LIBDIR by default, to correctly support multiarch
2020-03-17 08:16:07 +00:00
FeRD (Frank Dana)
a97158aa2a
Add relicensing statement for ferdnyc
...
Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2020-03-16 20:23:12 -04:00
FeRD (Frank Dana)
31569c78d9
Problem: CMake config doesn't support multiarch
...
Solution: Install CMake config in arch-dependent LIBDIR/cmake
Using "share/cmake/${PROJECT_NAME}" as DESTINATION for installing
ZeroMQConfig.cmake et al works for arch-independent configs, but
is wrong for multiarch. The configs for each version of the
library should be stored below the arch-dependent LIBDIR, using
the GNUInstallDirs ${CMAKE_INSTALL_LIBDIR} variable.
Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2020-03-16 20:22:52 -04:00
Luca Boccassi
bb9135da4f
Merge pull request #3847 from JSYoo5B/protocol-literals-refactor
...
Refactor protocol literals into constants
2020-03-14 13:54:17 +00:00
JaeSang Yoo
38fd1fdc8e
Problem: some cond. compile may cause problem
...
Some ifdefs in condition checking may cause problem in some compiler or
static analyzers. When PGM and NORM both are disabled, some condition
will be derived as false || false.
Solution: Splitted condition checking for every ifdef conditions
2020-03-14 22:20:54 +09:00
JaeSang Yoo
4f436ce00f
Problem: some conditional compile was not applied
...
Conditinoal compile for OPENPGM and NORM is mixed.
Also found few codes which needs conditional compile but not applied.
Solution: Apply conditional compile preprocessors
2020-03-14 19:55:54 +09:00
JaeSang Yoo
ebd22ecf85
Problem: literals protocol names still remains
...
Solution: replace into named constants
2020-03-14 19:55:54 +09:00
Luca Boccassi
0c7ee438a8
Merge pull request #3848 from JSYoo5B/optimize-gitignore
...
Optimizing gitignore files
2020-03-14 09:45:10 +00:00
JaeSang Yoo
2478887d4a
Problem: gitignore is messed up
...
Solution: optimize gitigore using patterns
* Categorize ignoring lists
* Use pattern to remove similar lists
* Marked source files to be tracked
2020-03-14 17:57:56 +09:00
Simon Giesecke
656205b5f9
Merge pull request #3844 from bluca/format
...
Problem: msg_t functions do not respect coding style
2020-03-07 14:58:48 +01:00
Luca Boccassi
f9417dab4d
Problem: msg_t functions do not respect coding style
...
Solution: fix them
2020-03-07 13:25:18 +00:00
Luca Boccassi
07d3687621
Merge pull request #3843 from JSYoo5B/man-udp-not-mentioned
...
Add UDP transport to related docs
2020-03-07 11:45:46 +00:00
JaeSang Yoo
ded0d83e47
Problem: wildcard address with udp not mentioned
...
* UDP is mentioned as available transport, and it also supports
wildcard addresses, but not mentioned
* zmq_unbind(7) also mentions about wild-card endpoint in zmq_bind(3)
Solution: add udp in wildcard address related docs
2020-03-07 14:55:01 +09:00
JaeSang Yoo
296beecd24
Problem: UDP is not mentioned in bind and connect
...
zmq_bind(3) and zmq_connect(3) does not mention UDP as available
transport types.
Solution: add udp mentioning line for related docs
2020-03-07 14:35:06 +09:00
Luca Boccassi
f915971653
Merge pull request #3838 from JSYoo5B/osx-build-doc-issue
...
Problem: building on OS X may failed
2020-02-29 13:50:19 +00:00
JaeSang Yoo
87f9e377dd
Problem: building on OS X may failed
...
Solution: Add troubleshooting guidelines to resolve
(Relicensing statement added)
2020-02-29 22:44:59 +09:00
Rickard Hallerbäck
2206cb37e0
ip_resolver_t: Silencing C++-warning -Wnon-virtual-dtor ( #3837 )
...
* ip_resolver_t: adding virtual descructor to silence C++-warning -Wnon-virtual-dtor
* adding my relicense
2020-02-28 16:49:12 +00:00
Mark Jan van Kampen
de0102e927
Fixes old Simon being in there
2020-02-24 09:05:39 +00:00