Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian....@packages.debian.org
Usertags: pu

[ Reason ]
As of version 3.3, mbrola does not properly detect the end of file of
its input, and thus remains stuck when e.g. the espeakup daemon is
terminating and wants to cleanly terminate its mbrola child process.

This is a regression compared to buster, in which the relevant code was
quite different.

[ Impact ]
Restarting the espeakup screen reader daemon (e.g. at the very least on
upgrading from bullseye to bookworm) remains stuck, until systemd loses
patience (which takes a minute or so). In the meanwhile the computer is
speechless, thus unusable for the blind user.

[ Tests ]
This was tested manually in unstable.

[ Risks ]
The code is very simple.

[ 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 ]
The do/while loop that keeps reading input data now breaks also when
feof(input) returns true.
diff -Nru mbrola-3.3+dfsg/debian/changelog mbrola-3.3+dfsg/debian/changelog
--- mbrola-3.3+dfsg/debian/changelog    2021-01-01 17:16:15.000000000 +0100
+++ mbrola-3.3+dfsg/debian/changelog    2021-08-25 22:20:51.000000000 +0200
@@ -1,3 +1,9 @@
+mbrola (3.3+dfsg-4+deb11u1) bullseye; urgency=medium
+
+  * patches/EOF: Fix detecting end of file.
+
+ -- Samuel Thibault <sthiba...@debian.org>  Wed, 25 Aug 2021 22:20:51 +0200
+
 mbrola (3.3+dfsg-4) unstable; urgency=medium
 
   * patches/flags: Fix passing hardening flags.
diff -Nru mbrola-3.3+dfsg/debian/patches/EOF mbrola-3.3+dfsg/debian/patches/EOF
--- mbrola-3.3+dfsg/debian/patches/EOF  1970-01-01 01:00:00.000000000 +0100
+++ mbrola-3.3+dfsg/debian/patches/EOF  2021-08-25 22:20:34.000000000 +0200
@@ -0,0 +1,24 @@
+https://github.com/numediart/MBROLA/pull/35
+
+commit 151763240cb170943e8cc050df8a1ae6347cb7bf
+Author: Samuel Thibault <samuel.thiba...@ens-lyon.org>
+Date:   Fri Aug 20 00:43:29 2021 +0200
+
+    Fix detecting EOF
+    
+    fgets returns NULL on EOF as well, so we need to call feof to properly
+    detect EOF.
+
+diff --git a/Parser/input_file.c b/Parser/input_file.c
+index eea2da2..ac3454d 100644
+--- a/Parser/input_file.c
++++ b/Parser/input_file.c
+@@ -38,7 +38,7 @@ static long readline_InputFile(Input* in, char *line, int 
size)
+ 
+       do
+               ret = fgets(line, size, (FILE*)in->self);
+-      while (ret == NULL && errno == EINTR);
++      while (ret == NULL && !feof((FILE*)in->self) && errno == EINTR);
+ 
+       return ret != NULL;
+ }
diff -Nru mbrola-3.3+dfsg/debian/patches/series 
mbrola-3.3+dfsg/debian/patches/series
--- mbrola-3.3+dfsg/debian/patches/series       2020-12-30 17:53:50.000000000 
+0100
+++ mbrola-3.3+dfsg/debian/patches/series       2021-08-25 22:20:34.000000000 
+0200
@@ -1,2 +1,3 @@
 intr
 flags
+EOF

Reply via email to