[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1034165: unblock: waypipe/0.8.4-3



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: waypipe@packages.debian.org, gspr@nonempty.org
Control: affects -1 + src:waypipe

Please unblock package waypipe.


[ Reason ]
Waypipe versions prior to 0.8.6 contain a memory leak that is documented
as bug #1034163 [1]. I have cherry-picked a one-line fix from upstream
[2], and have verified that it fixes the problem. I have uploaded
0.8.4-3 to unstable with that patch as the only change. A debdiff
against 0.8.4-2 (in testing) is attached.

[ Impact ]
If the unblock isn't granted, Bookworm will ship with a version of
waypipe that leaks memory, making long-running sessions
problematic. Since waypipe's job is to provide SSH forwarding (à la "ssh
-X") to software running under Wayland, such long-running sessions are
expected.

[ Tests ]
By running waypipe in debug mode, e.g.

 waypipe -d ssh localhost weston-simple-shm  2>&1 | grep "in flight"

one can watch the "number of bytes in flight" messages report an
ever-increasing number of bytes in the version of waypipe in Bookworm
(0.8.4-2). With the fixed version from unstable (0.8.4-3), the number
of bytes in flight remains bounded.

This test was recommended to me by waypipe's upstream author.

[ Risks ]
The fix is a one-line patch, authored by upstream and already released
as part of upstream's version 0.8.6.

[ Checklist ]
  [X] all changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in testing


[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034163

[2] https://gitlab.freedesktop.org/mstoeckl/waypipe/-/commit/9070c4c527c906cb186588ca410d92d2f7f3c7ba


unblock waypipe/0.8.4-3
diff -Nru waypipe-0.8.4/debian/changelog waypipe-0.8.4/debian/changelog
--- waypipe-0.8.4/debian/changelog	2022-11-23 17:11:16.000000000 +0100
+++ waypipe-0.8.4/debian/changelog	2023-04-10 15:51:36.000000000 +0200
@@ -1,3 +1,9 @@
+waypipe (0.8.4-3) unstable; urgency=medium
+
+  * Add upstream patch to fix memory leak. (Closes: #1034163)
+
+ -- Gard Spreemann <gspr@nonempty.org>  Mon, 10 Apr 2023 15:51:36 +0200
+
 waypipe (0.8.4-2) unstable; urgency=medium
 
   * Increase timeout limit for build-time tests. (Closes: #1011322)
diff -Nru waypipe-0.8.4/debian/patches/0001-Fix-a-memory-leak.patch waypipe-0.8.4/debian/patches/0001-Fix-a-memory-leak.patch
--- waypipe-0.8.4/debian/patches/0001-Fix-a-memory-leak.patch	1970-01-01 01:00:00.000000000 +0100
+++ waypipe-0.8.4/debian/patches/0001-Fix-a-memory-leak.patch	2023-04-10 15:51:36.000000000 +0200
@@ -0,0 +1,29 @@
+From: Gard Spreemann <gspr@nonempty.org>
+Date: Mon, 10 Apr 2023 12:21:18 +0200
+Subject: Fix a memory leak
+
+This cherry-picks upstream commit
+9070c4c527c906cb186588ca410d92d2f7f3c7ba. The original commit message
+follows.
+
+This was introduced by a0f6bfa191f55b99e4ff68dd0063aa0c0e12dcbd
+incorrectly checking when to increase the value of
+cxs->last_confirmed_msgno. As a result, one of the two Waypipe
+processes would leak all the messages sent to the other process.
+---
+ src/mainloop.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mainloop.c b/src/mainloop.c
+index 181319c..38a084d 100644
+--- a/src/mainloop.c
++++ b/src/mainloop.c
+@@ -280,7 +280,7 @@ static int interpret_chanmsg(struct chan_msg_state *cmsg,
+ 	} else if (type == WMSG_ACK_NBLOCKS) {
+ 		struct wmsg_ack *ackm = (struct wmsg_ack *)packet;
+ 		if (msgno_gt(ackm->messages_received,
+-				    cxs->last_received_msgno)) {
++				    cxs->last_confirmed_msgno)) {
+ 			cxs->last_confirmed_msgno = ackm->messages_received;
+ 		}
+ 		return 0;
diff -Nru waypipe-0.8.4/debian/patches/series waypipe-0.8.4/debian/patches/series
--- waypipe-0.8.4/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ waypipe-0.8.4/debian/patches/series	2023-04-10 15:51:36.000000000 +0200
@@ -0,0 +1 @@
+0001-Fix-a-memory-leak.patch

Attachment: signature.asc
Description: PGP signature


Reply to: