On Fri, Feb 20, 2026 at 10:30:48AM -0500, Nicolas Mora wrote:
> Hello,
> 
> I don't deny you have an issue, but setting the flag critical for an issue
> you have with the package in stable may be a little bit much?
> 

Sorry, I was following the criteria that it makes me lose data (the
video that I wanted to save) that cannot be restored (no way to backup
upfront new videos). That has made some family members frustrated that
the NVR I setup does not work reliably.

I don't mind that the priority is downgrade, as long as the issue is
taken seriously and it results in an updated package. I would rather not
have to rebuild the package myself everytime there is an update.

> The bug also flags the package for autoremoval in testing...
> 
> Concerning your issue, can you be more specific on the problems?
> I'm using motion for a long time myself and I never had such problems.
> Maybe you can look at your system configuration, for example if you save the
> files on a remote location that could lead to files lock issues?
> 
> If the problem doesn't come from the package itself, we'll transfer it
> upstream then.
> 

I had the chance to look at it. Unfortunately, it seems upstream has
moved the codebase, even changing from C to C++. From what I could
conclude, the new codebase does not suffer from the same issue, that is,
it is already fixed there. But not the version in Debian stable.

Attached is a proposed fix (that needs to be properly massaged to be
applied for an archive upload). If attribution to the fix can be added,
please use:

Thadeu Lima de Souza Cascardo <[email protected]>

Thanks.
Cascardo.

> /Nicolas
diff -Nru motion-4.7.0/debian/changelog motion-4.7.0/debian/changelog
--- motion-4.7.0/debian/changelog       2025-03-30 11:32:58.000000000 -0300
+++ motion-4.7.0/debian/changelog       2026-02-21 15:56:27.000000000 -0300
@@ -1,3 +1,9 @@
+motion (4.7.0-3+fix1) unstable; urgency=medium
+
+  * Fix file descriptor leak.
+
+ -- Thadeu Lima de Souza Cascardo <[email protected]>  Sat, 21 Feb 2026 
15:56:27 -0300
+
 motion (4.7.0-3) unstable; urgency=medium
 
   [Carles Pina i Estany]
diff -Nru motion-4.7.0/debian/patches/fix_file_leak.patch 
motion-4.7.0/debian/patches/fix_file_leak.patch
--- motion-4.7.0/debian/patches/fix_file_leak.patch     1969-12-31 
21:00:00.000000000 -0300
+++ motion-4.7.0/debian/patches/fix_file_leak.patch     2026-02-21 
15:55:57.000000000 -0300
@@ -0,0 +1,12 @@
+Index: motion-4.7.0/src/ffmpeg.c
+===================================================================
+--- motion-4.7.0.orig/src/ffmpeg.c
++++ motion-4.7.0/src/ffmpeg.c
+@@ -958,6 +958,7 @@ static int ffmpeg_set_outputfile(struct
+             av_strerror(retcd, errstr, sizeof(errstr));
+             MOTION_LOG(ERR, TYPE_ENCODER, NO_ERRNO
+                 ,_("Could not write ffmpeg header %s"),errstr);
++            avio_close(ffmpeg->oc->pb);
+             ffmpeg_free_context(ffmpeg);
+             return -1;
+         }
diff -Nru motion-4.7.0/debian/patches/series motion-4.7.0/debian/patches/series
--- motion-4.7.0/debian/patches/series  2024-08-27 15:43:22.000000000 -0300
+++ motion-4.7.0/debian/patches/series  2026-02-21 15:55:38.000000000 -0300
@@ -1,2 +1,3 @@
 change-paths_set-debian-paths.patch
 spelling.patch
+fix_file_leak.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to