🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #3666

Bug#1147124: trixie-pu: package mdadm/4.4-11+deb13u1

#3666
From: Samuel Thibault
Date: Sat, 07 Nov 2026 22:30
115 lines
6241 bytes
Hello,

I realize this didn't get feedback, is there something missing?

With regards,
Samuel

Samuel Thibault, le lun. 07 sept. 2026 23:37:19 +0200, a ecrit:
> Package: release.debian.org
> Severity: normal
> Tags: trixie
> X-Debbugs-Cc: mdadm@packages.debian.org
> Control: affects -1 + src:mdadm
> User: release.debian.org@packages.debian.org
> Usertags: pu
> 
> Hello,
> 
> I have uploaded mdadm 4.4-11+deb13u1 for proposal to trixie
> 
> [ Reason ]
> As reported on #1115497, there is a memory leak in the mdmonitor daemon.
> After a few weeks of operation, this can eat a few gigabytes. This is a
> regression over oldstable.
> 
> [ Impact ]
> Administrators of servers using mdmonitor have to restart the service
> from times to times to drop the memory consumption.
> 
> [ Tests ]
> This is commited upstream, and confirmed on the three servers where I
> noticed the issue.
> 
> [ Risks ]
> The code is a mere added unref, and commited upstream.
> 
> [ 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 (old)stable
>   [X] the issue is verified as fixed in unstable
> 
> [ Changes ]
> This adds an unref call corresponding to the udev_monitor_receive_device
> call whose returned pointer is not stored.
> 
> Samuel

> diff -Nru mdadm-4.4/debian/changelog mdadm-4.4/debian/changelog
> --- mdadm-4.4/debian/changelog	2025-04-25 18:24:19.000000000 +0200
> +++ mdadm-4.4/debian/changelog	2026-08-23 21:40:00.000000000 +0200
> @@ -1,3 +1,11 @@
> +mdadm (4.4-11+deb13u1) trixie; urgency=medium
> +
> +  * Non-Maintainer Upload.
> +  * Adding patch from Peter Mann <peter.mann@sh.cz> to fix memory leak in
> +    mdadm --monitor --scan (Closes: #1115497).
> +
> + -- Samuel Thibault <sthibault@debian.org>  Sun, 23 Aug 2026 21:40:00 +0200
> +
>  mdadm (4.4-11) sid; urgency=medium
>  
>    [ Daniel Baumann ]
> diff -Nru mdadm-4.4/debian/patches/debian/0015-monitor-memory-leak.patch mdadm-4.4/debian/patches/debian/0015-monitor-memory-leak.patch
> --- mdadm-4.4/debian/patches/debian/0015-monitor-memory-leak.patch	1970-01-01 01:00:00.000000000 +0100
> +++ mdadm-4.4/debian/patches/debian/0015-monitor-memory-leak.patch	2026-08-23 21:40:00.000000000 +0200
> @@ -0,0 +1,39 @@
> +Author: Peter Mann <peter.mann@sh.cz>
> +Description: Memory leak in mdadm --monitor --scan (Closes: #1115497).
> + At mdadm/udev.c:153:
> + ...
> + if (udev_monitor_receive_device(udev_monitor))
> +   return UDEV_STATUS_SUCCESS; /* event detected */
> + ...
> + .
> + According to libudev docs:
> + On success, udev_monitor_receive_device() returns a pointer to a newly referenced device that was received via the monitor. The caller is responsible to drop this reference when done.
> + .
> + As you can see, the reference to the device never gets dropped.
> + We put together a quick patch, which seems to have fixed the issue or at least substantially reduced the amount of leaks.
> + .
> + Since we have no experience with the codebase, we have no idea about the implications of these changes.
> + We would appreciate if someone took a closer look.
> + .
> + Additionaly as a workaround, passing MDADM_NO_UDEV=1 env to mdadm stops the leaks as well, since it bypasses the leaking codepath.
> +Forwarded: https://github.com/md-raid-utilities/mdadm/pull/197
> +
> +diff -Naurp mdadm.orig/udev.c mdadm/udev.c
> +--- mdadm.orig/udev.c
> ++++ mdadm/udev.c
> +@@ -149,9 +149,13 @@ enum udev_status udev_wait_for_events(in
> + 	tv.tv_sec = seconds;
> + 	tv.tv_usec = 0;
> + 
> +-	if (select(fd + 1, &readfds, NULL, NULL, &tv) > 0 && FD_ISSET(fd, &readfds))
> +-		if (udev_monitor_receive_device(udev_monitor))
> ++	if (select(fd + 1, &readfds, NULL, NULL, &tv) > 0 && FD_ISSET(fd, &readfds)) {
> ++		struct udev_device *dev = udev_monitor_receive_device(udev_monitor);
> ++		if (dev) {
> ++			udev_device_unref(dev);
> + 			return UDEV_STATUS_SUCCESS; /* event detected */
> ++		}
> ++	}
> + 	return UDEV_STATUS_TIMEOUT;
> + }
> + #endif
> diff -Nru mdadm-4.4/debian/patches/series mdadm-4.4/debian/patches/series
> --- mdadm-4.4/debian/patches/series	2025-03-09 18:03:14.000000000 +0100
> +++ mdadm-4.4/debian/patches/series	2026-08-23 21:40:00.000000000 +0200
> @@ -10,4 +10,5 @@
>  debian/0011-systemd-directory.patch
>  debian/0012-bin-directory.patch
>  debian/0013-xmalloc-ftbfs.patch
> +debian/0015-monitor-memory-leak.patch
>  upstream/0001-manpage-remove-bitmap.patch
Technical Details
Message-ID: <NWX58-atUJ-17@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
References: <NAPeh-fPMX-5@gated-at.bofh.it> <NAPeh-fPMX-5@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From: Samuel Thibault <sthibault@debian.org>
Newsgroups: linux.debian.bugs.dist,linux.debian.devel.release
Subject: Bug#1147124: trixie-pu: package mdadm/4.4-11+deb13u1
Date: Sat, 07 Nov 2026 23:30:02 +0100
Message-ID: <NWX58-atUJ-17@gated-at.bofh.it>
References: <NAPeh-fPMX-5@gated-at.bofh.it> <NAPeh-fPMX-5@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <1147124@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Sat Nov  7 22:27:12 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: Samuel Thibault <sthibault@debian.org>, 1147124@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: debian-release@lists.debian.org
X-Debian-Pr-Message: followup 1147124
X-Debian-Pr-Package: release.debian.org
X-Debian-Pr-Keywords: trixie
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Organization: I am not organized
X-Debian-User: sthibault
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2001363
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 115
Sender: robomod@news.nic.it
X-Original-Date: Sat, 7 Nov 2026 23:26:25 +0100
X-Original-Message-ID: <au-lkbJarnD1Lq7u@end>
X-Original-References: <ap8uj1vRufy1v2T5@end> <ap8uj1vRufy1v2T5@end>