Commit Graph

24 Commits

Author SHA1 Message Date
Luca Boccassi
da31917f4f Relicense from LGPL3 + exceptions to Mozilla Public License version 2.0
Relicense permission collected from all relevant authors as tallied at:
https://github.com/rlenferink/libzmq-relicense/blob/master/checklist.md
The relicense grants are collected under RELICENSE/ and will be moved
to the above repository in a later commit.

Fixes https://github.com/zeromq/libzmq/issues/2376
2023-06-05 20:31:47 +01:00
Arnaud Loonstra
f7df6c8599 deprecate sprint and replace with snprintf 2023-01-24 22:45:48 +01:00
Luca Boccassi
de03c9a6ab Problem: test_inproc_connect occasionally fails on slow archs
Solution: actually send a message rather than just opening/closing
the sockets, as connecting is asynchronous.

tests/test_inproc_connect.cpp:341:test_bind_before_connect:PASS
tests/test_inproc_connect.cpp:342:test_connect_before_bind:PASS
tests/test_inproc_connect.cpp:343:test_connect_before_bind_pub_sub:PASS
tests/test_inproc_connect.cpp:344:test_connect_before_bind_ctx_term:PASS
tests/test_inproc_connect.cpp:345:test_multiple_connects:PASS
tests/test_inproc_connect.cpp:346:test_multiple_threads:PASS
Assertion failed: _state == active || _state == waiting_for_delimiter (src/pipe.cpp:504)
0  0xffffa015d3e4 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::zmq_abort(char const*)+0xc)
1  0xffffa017b208 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::pipe_t::process_delimiter()+0xb0)
2  0xffffa017b420 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::pipe_t::read(zmq::msg_t*)+0xd8)
3  0xffffa01a4b28 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::xpub_t::xread_activated(zmq::pipe_t*)+0x110)
4  0xffffa01a3758 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::xpub_t::xattach_pipe(zmq::pipe_t*, bool, bool)+0x68)
5  0xffffa018dc3c in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::socket_base_t::attach_pipe(zmq::pipe_t*, bool, bool)+0x94)
6  0xffffa016f288 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::object_t::process_command(zmq::command_t const&)+0x148)
7  0xffffa014ee3c in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::ctx_t::connect_inproc_sockets(zmq::socket_base_t*, zmq::options_t const&, zmq::ctx_t::pending_connection_t const&, zmq::ctx_t::side)+0xdc)
8  0xffffa0150bec in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::ctx_t::connect_pending(char const*, zmq::socket_base_t*)+0x1fc)
9  0xffffa0190034 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (zmq::socket_base_t::bind(char const*)+0x3e4)
10  0xaaaae50475d8 in /usr/src/packages/BUILD/tests/.libs/test_inproc_connect (simult_bind(void*)+0x28)
11  0xffffa019bfb8 in /usr/src/packages/BUILD/src/.libs/libzmq.so.5 (thread_routine+0x70)
12  0xffffa00e07e4 in /lib/aarch64-linux-gnu/libpthread.so.0 (start_thread+0x18c)
13  0xffff9fdcab2c in /lib/aarch64-linux-gnu/libc.so.6 (clone+0x5c)
2021-06-14 11:43:06 +01:00
Simon Giesecke
cd954e207d Problem: use of C-style casts
Solution: use static_cast/reinterpret_cast instead
2019-12-08 15:24:48 +01:00
Simon Giesecke
af4fa22fd8 Problem: default test setUp/tearDown functions duplicated in many test programs
Solution: define setUp/tearDown functions via SETUP_TEARDOWN_TESTCONTEXT macro where possible
2019-03-24 12:53:12 -04:00
Luca Boccassi
4d38552445 Problem: GCC warnings about string overflows in tests
Solution: mostly false positives, but fix them
2019-01-14 23:50:56 +00:00
Simon Giesecke
779d120fa3 Problem: tests do not follow naming style
Solution: apply naming style
2018-05-27 13:24:08 +02:00
Simon Giesecke
64f2b100da Problem: test_context_socket is not thread-safe
Solution: use regular zmq_socket instead in thread functions
2018-05-23 17:32:27 +02:00
Simon Giesecke
fdfa907187 Problem: test_inproc_connect not using test framework
Solution: migrate to unity
2018-05-23 13:48:58 +02:00
sigiesec
41f459e1dc Problem: formatting inconsistent
Solution: applied clang-format
2018-02-02 15:47:43 +01:00
sigiesec
1414bf938c Problem: use of unqualified "id" in code example
Solution: use "routing_id" instead
2017-09-19 17:54:52 +02:00
Luca Boccassi
fab846a5e5 Problem: zmq_ctx_term asserts with connect-before-bind and sockets with identity over inproc transport
Solution: check if the connecting inproc socket has been closed
before trying to send the identity.
Otherwise the pipe will be in waiting_for_delimiter state causing
writes to fail and the connect to assert when the context is being
torn down and the pending inproc connects are resolved.
Add test case that covers this behaviour.
2016-09-24 18:59:29 +01:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
Richard Newton
096007c574 Fix zmq crash when calling shutdown with a pending inproc socket connect 2015-08-21 10:06:54 +01:00
Pieter Hintjens
8620c3e032 Problem: source file headers are somewhat confusing about LGPLv3
Of course people still "can" distributed the sources under the
LGPLv3. However we provide COPYING.LESSER with additional grants.

Solution: specify these grants in the header of each source file.
2015-06-02 22:33:55 +02:00
Pieter Hintjens
94d9a4ffdf Problem: copyright statements are out of date
Solution: update for 2015

Fixes #1320
2015-01-22 10:32:37 +01:00
Richard Newton
31cff7ccf9 Add test for unbinding inproc socket. 2014-07-09 10:28:26 +01:00
Pieter Hintjens
cfc754f393 Merge pull request #1020 from jemc/inproc_simult
Add failing test reproducing issue #1015.
2014-05-23 16:03:15 +02:00
Pieter Hintjens
a9a15ccf6f Use different endpoint for each test step 2014-05-16 16:00:37 +02:00
Joe Eli McIlvain
5cf74db6bb Add failing test reproducing issue #1015.
There is a race condition when connect and bind on a new inproc
endpoint happen "simultaneously" in threads.  Causes the error:
  Assertion failed: ok (ctx.cpp:474)
2014-05-09 11:02:01 -07:00
Richard Newton
668c42fc26 Fix hang on term when inproc is connected but never bound. 2014-02-12 23:10:23 +00:00
Pieter Hintjens
b3b9e046ee Updated copyright statements for 2014 2014-01-02 12:00:57 +01:00
Pieter Hintjens
5b60540ed0 Removed over-long pauses in tests
- used msleep (10) in most places instead of zmq_sleep (1)
- may cause failures on slower machines
- to change, modify SETTLE_TIME in testutil.h
- tested down to 1 msec on fast boxes
2013-11-06 13:42:57 +01:00
Pieter Hintjens
e05556075f Renamed inproc connect test (name was too long) 2013-09-19 09:36:43 +02:00