Bug#969488: Assertion failed when speaking some Unicode characters
Dennis Filder
d.filder at web.de
Thu Sep 3 18:28:11 BST 2020
Package: speechd-up
Version: 0.5~20110719-9
SYMPTOMS
I ran into a failed assertion. When pressing certain Unicode
characters like U+20AC (EURO SIGN) or U+2192 (RIGHTWARDS ARROW) on the
console via a keyboard, speechd-up exits suddenly. The same happens
when moving the cursor over a Unicode character in a text editor or on
a readline prompt. I first ran into this under Buster.
DIAGNOSIS
>From strace:
...
write(2, "speechd-up: speechd-up.c:457: parse_buf: Assertion `bytes <= BUF_SIZE' failed.\n", 79) = 79
...
WORKAROUND
The problem only manifests when speechd-up is started with the default
command line "speechd-up -l1". Putting this into
/etc/default/speechd-up prevents the bug from being triggered:
DAEMON_OPTS="$DAEMON_OPTS -D/dev/softsynthu -cUTF-8"
ANALYSIS
The error is in speechd-up.c:main():
750 ...
751 chars_read = read(fd, buf, BUF_SIZE);
752 if (chars_read < 0) {
753 ...
chars_read is declared as size_t, but read() returns ssize_t, thus a
failed read returning -1 (errno==11/EAGAIN in my case) triggers the
assertion in parse_buf().
The patch fixes the error and also adds code to retry the read after a
short delay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speechd-up-fix_assert2.patch
Type: text/x-diff
Size: 945 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-a11y-devel/attachments/20200903/b27b6e7b/attachment.patch>
More information about the Pkg-a11y-devel
mailing list