View | Details | Raw Unified | Return to bug 255102 | Differences between
and this patch

Collapse All | Expand All

(-)libzmq4/Makefile (-1 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	libzmq4
1
PORTNAME=	libzmq4
2
DISTVERSIONPREFIX=	v
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	4.3.1
3
DISTVERSION=	4.3.4
4
PORTREVISION=	1
4
PORTREVISION=	1
5
CATEGORIES=	net
5
CATEGORIES=	net
6
MASTER_SITES=	https://github.com/zeromq/libzmq/releases/download/${DISTVERSIONFULL}/
6
MASTER_SITES=	https://github.com/zeromq/libzmq/releases/download/${DISTVERSIONFULL}/
(-)libzmq4/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1548985858
1
TIMESTAMP = 1618512754
2
SHA256 (zeromq-4.3.1.tar.gz) = bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb
2
SHA256 (zeromq-4.3.4.tar.gz) = c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5
3
SIZE (zeromq-4.3.1.tar.gz) = 1490122
3
SIZE (zeromq-4.3.4.tar.gz) = 2486520
(-)libzmq4/files/patch-PR3358 (-179 lines)
Lines 1-179 Link Here
1
From 4147957a5eec57ec7a2a416dca74c3c0299a3432 Mon Sep 17 00:00:00 2001
2
From: Luca Boccassi <bluca@debian.org>
3
Date: Sun, 13 Jan 2019 13:08:10 +0000
4
Subject: [PATCH 1/2] Problem: test_security_zap fails on architectures that
5
 disallow unaligned pointer access
6
7
Solution: use memcpy instead of doing pointer arithmetics with casting
8
and dereferencing to fix the error on sparc64
9
---
10
 tests/testutil_security.hpp | 2 +-
11
 1 file changed, 1 insertion(+), 1 deletion(-)
12
13
diff --git tests/testutil_security.hpp tests/testutil_security.hpp
14
index 90999118c..437bfb298 100644
15
--- tests/testutil_security.hpp
16
+++ tests/testutil_security.hpp
17
@@ -345,7 +345,7 @@ static int get_monitor_event_internal (void *monitor_,
18
     uint8_t *data = (uint8_t *) zmq_msg_data (&msg);
19
     uint16_t event = *(uint16_t *) (data);
20
     if (value_)
21
-        *value_ = *(uint32_t *) (data + 2);
22
+        memcpy (value_, data + 2, sizeof (uint32_t));
23
 
24
     //  Second frame in message contains event address
25
     zmq_msg_init (&msg);
26
27
From f64b697095c6d8862bdfd2a159857e915bbf20ee Mon Sep 17 00:00:00 2001
28
From: Luca Boccassi <bluca@debian.org>
29
Date: Sun, 13 Jan 2019 14:50:07 +0000
30
Subject: [PATCH 2/2] Problem: tests use hard-coded fixed IPC file path
31
32
Solution: use wildcards or random directories to avoid races when
33
multiple users are running the same test on the same machine
34
---
35
 tests/test_pair_ipc.cpp      |  9 +++++++--
36
 tests/test_rebind_ipc.cpp    | 13 ++++++++-----
37
 tests/test_reconnect_ivl.cpp | 10 +++++++---
38
 tests/test_use_fd.cpp        | 24 +++++++++++++++++++-----
39
 4 files changed, 41 insertions(+), 15 deletions(-)
40
41
diff --git tests/test_pair_ipc.cpp tests/test_pair_ipc.cpp
42
index c9a216dd2..ab4dde350 100644
43
--- tests/test_pair_ipc.cpp
44
+++ tests/test_pair_ipc.cpp
45
@@ -44,11 +44,16 @@ void tearDown ()
46
 
47
 void test_roundtrip ()
48
 {
49
+    char my_endpoint[256];
50
+    size_t len = sizeof (my_endpoint);
51
+
52
     void *sb = test_context_socket (ZMQ_PAIR);
53
-    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc:///tmp/test_pair_ipc"));
54
+    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc://*"));
55
+    TEST_ASSERT_SUCCESS_ERRNO (
56
+      zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
57
 
58
     void *sc = test_context_socket (ZMQ_PAIR);
59
-    TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, "ipc:///tmp/test_pair_ipc"));
60
+    TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint));
61
 
62
     bounce (sb, sc);
63
 
64
diff --git tests/test_rebind_ipc.cpp tests/test_rebind_ipc.cpp
65
index 830d18030..784641270 100644
66
--- tests/test_rebind_ipc.cpp
67
+++ tests/test_rebind_ipc.cpp
68
@@ -42,24 +42,27 @@ void tearDown ()
69
     teardown_test_context ();
70
 }
71
 
72
-static const char *SOCKET_ADDR = "ipc:///tmp/test_rebind_ipc";
73
-
74
 void test_rebind_ipc ()
75
 {
76
+    char my_endpoint[256];
77
+    size_t len = sizeof (my_endpoint);
78
+
79
     void *sb0 = test_context_socket (ZMQ_PUSH);
80
     void *sb1 = test_context_socket (ZMQ_PUSH);
81
 
82
-    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb0, SOCKET_ADDR));
83
+    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb0, "ipc://*"));
84
+    TEST_ASSERT_SUCCESS_ERRNO (
85
+      zmq_getsockopt (sb0, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
86
 
87
     void *sc = test_context_socket (ZMQ_PULL);
88
-    TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, SOCKET_ADDR));
89
+    TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint));
90
 
91
     send_string_expect_success (sb0, "42", 0);
92
     recv_string_expect_success (sc, "42", 0);
93
 
94
     test_context_socket_close (sb0);
95
 
96
-    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb1, SOCKET_ADDR));
97
+    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb1, my_endpoint));
98
 
99
     send_string_expect_success (sb1, "42", 0);
100
     recv_string_expect_success (sc, "42", 0);
101
diff --git tests/test_reconnect_ivl.cpp tests/test_reconnect_ivl.cpp
102
index b67b40e5f..6dd0e4cd2 100644
103
--- tests/test_reconnect_ivl.cpp
104
+++ tests/test_reconnect_ivl.cpp
105
@@ -71,11 +71,15 @@ void test_reconnect_ivl_against_pair_socket (const char *my_endpoint_,
106
 #if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_GNU)
107
 void test_reconnect_ivl_ipc (void)
108
 {
109
-    const char *ipc_endpoint = "ipc:///tmp/test_reconnect_ivl";
110
+    char my_endpoint[256];
111
+    size_t len = sizeof (my_endpoint);
112
+
113
     void *sb = test_context_socket (ZMQ_PAIR);
114
-    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, ipc_endpoint));
115
+    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc://*"));
116
+    TEST_ASSERT_SUCCESS_ERRNO (
117
+      zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
118
 
119
-    test_reconnect_ivl_against_pair_socket (ipc_endpoint, sb);
120
+    test_reconnect_ivl_against_pair_socket (my_endpoint, sb);
121
     test_context_socket_close (sb);
122
 }
123
 #endif
124
diff --git tests/test_use_fd.cpp tests/test_use_fd.cpp
125
index 67414f5bf..e9852b13d 100644
126
--- tests/test_use_fd.cpp
127
+++ tests/test_use_fd.cpp
128
@@ -237,24 +237,38 @@ void pre_allocate_sock_ipc_int (void *zmq_socket_, const char *path_)
129
                              sizeof (struct sockaddr_un));
130
 }
131
 
132
+char ipc_endpoint[16];
133
+
134
 void pre_allocate_sock_ipc (void *sb_, char *my_endpoint_)
135
 {
136
-    pre_allocate_sock_ipc_int (sb_, "/tmp/test_use_fd_ipc");
137
-    strcpy (my_endpoint_, "ipc:///tmp/test_use_fd_ipc");
138
+    strcpy (ipc_endpoint, "tmpXXXXXX");
139
+
140
+#ifdef HAVE_MKDTEMP
141
+    TEST_ASSERT_TRUE (mkdtemp (ipc_endpoint));
142
+    strcat (ipc_endpoint, "/ipc");
143
+#else
144
+    int fd = mkstemp (ipc_endpoint);
145
+    TEST_ASSERT_TRUE (fd != -1);
146
+    close (fd);
147
+#endif
148
+
149
+    pre_allocate_sock_ipc_int (sb_, ipc_endpoint);
150
+    strcpy (my_endpoint_, "ipc://");
151
+    strcat (my_endpoint_, ipc_endpoint);
152
 }
153
 
154
 void test_req_rep_ipc ()
155
 {
156
     test_req_rep (pre_allocate_sock_ipc);
157
 
158
-    TEST_ASSERT_SUCCESS_ERRNO (unlink ("/tmp/test_use_fd_ipc"));
159
+    TEST_ASSERT_SUCCESS_ERRNO (unlink (ipc_endpoint));
160
 }
161
 
162
 void test_pair_ipc ()
163
 {
164
     test_pair (pre_allocate_sock_ipc);
165
 
166
-    TEST_ASSERT_SUCCESS_ERRNO (unlink ("/tmp/test_use_fd_ipc"));
167
+    TEST_ASSERT_SUCCESS_ERRNO (unlink (ipc_endpoint));
168
 }
169
 
170
 void test_client_server_ipc ()
171
@@ -262,7 +276,7 @@ void test_client_server_ipc ()
172
 #if defined(ZMQ_SERVER) && defined(ZMQ_CLIENT)
173
     test_client_server (pre_allocate_sock_ipc);
174
 
175
-    TEST_ASSERT_SUCCESS_ERRNO (unlink ("/tmp/test_use_fd_ipc"));
176
+    TEST_ASSERT_SUCCESS_ERRNO (unlink (ipc_endpoint));
177
 #endif
178
 }
179
 
(-)libzmq4/files/patch-PR3359 (-45 lines)
Lines 1-45 Link Here
1
From d55956574d3b98268ec31045b012029ffc4b1a8c Mon Sep 17 00:00:00 2001
2
From: Luca Boccassi <bluca@debian.org>
3
Date: Mon, 14 Jan 2019 00:10:08 +0000
4
Subject: [PATCH] Problem: test_rebind_ipc still fails
5
6
Solution: create manually the random IPC file to reuse
7
---
8
 tests/test_rebind_ipc.cpp | 20 +++++++++++++++-----
9
 1 file changed, 15 insertions(+), 5 deletions(-)
10
11
diff --git tests/test_rebind_ipc.cpp tests/test_rebind_ipc.cpp
12
index 784641270..b14cb81d9 100644
13
--- tests/test_rebind_ipc.cpp
14
+++ tests/test_rebind_ipc.cpp
15
@@ -44,15 +44,25 @@ void tearDown ()
16
 
17
 void test_rebind_ipc ()
18
 {
19
-    char my_endpoint[256];
20
-    size_t len = sizeof (my_endpoint);
21
+    char my_endpoint[32], random_file[16];
22
+    strcpy (random_file, "tmpXXXXXX");
23
+
24
+#ifdef HAVE_MKDTEMP
25
+    TEST_ASSERT_TRUE (mkdtemp (random_file));
26
+    strcat (random_file, "/ipc");
27
+#else
28
+    int fd = mkstemp (random_file);
29
+    TEST_ASSERT_TRUE (fd != -1);
30
+    close (fd);
31
+#endif
32
+
33
+    strcpy (my_endpoint, "ipc://");
34
+    strcat (my_endpoint, random_file);
35
 
36
     void *sb0 = test_context_socket (ZMQ_PUSH);
37
     void *sb1 = test_context_socket (ZMQ_PUSH);
38
 
39
-    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb0, "ipc://*"));
40
-    TEST_ASSERT_SUCCESS_ERRNO (
41
-      zmq_getsockopt (sb0, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
42
+    TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb0, my_endpoint));
43
 
44
     void *sc = test_context_socket (ZMQ_PULL);
45
     TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint));
(-)libzmq4/files/patch-R1111 (+12 lines)
Line 0 Link Here
1
diff -Naur ../../../libzmq4.clean/work/zeromq-4.3.4/tests/testutil.hpp tests/testutil.hpp
2
--- ../../../libzmq4.clean/work/zeromq-4.3.4/tests/testutil.hpp	2021-01-03 22:46:02.000000000 +0100
3
+++ tests/testutil.hpp	2021-04-15 21:35:27.115634000 +0200
4
@@ -45,6 +45,8 @@
5
 #include <arpa/inet.h>
6
 #include <unistd.h>
7
 #include <stdlib.h>
8
+#include <sys/socket.h>
9
+#include <netinet/in.h>
10
 #endif
11
 
12
 //  This defines the settle time used in tests; raise this if we
(-)libzmq4/pkg-plist (-1 / +1 lines)
Lines 2-8 Link Here
2
include/zmq.h
2
include/zmq.h
3
lib/libzmq.so
3
lib/libzmq.so
4
lib/libzmq.so.5
4
lib/libzmq.so.5
5
lib/libzmq.so.5.2.1
5
lib/libzmq.so.5.2.4
6
libdata/pkgconfig/libzmq.pc
6
libdata/pkgconfig/libzmq.pc
7
%%MANPAGES%%man/man3/zmq_atomic_counter_dec.3.gz
7
%%MANPAGES%%man/man3/zmq_atomic_counter_dec.3.gz
8
%%MANPAGES%%man/man3/zmq_atomic_counter_destroy.3.gz
8
%%MANPAGES%%man/man3/zmq_atomic_counter_destroy.3.gz

Return to bug 255102