Bug 225237 - www/firefox causes zombie through accessibility/speech-dispatcher
Summary: www/firefox causes zombie through accessibility/speech-dispatcher
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gecko (Nobody)
URL: https://www.freshports.org/accessibil...
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2018-01-16 22:34 UTC by Rob Belics
Modified: 2023-04-23 20:02 UTC (History)
3 users (show)

See Also:
jbeich: maintainer-feedback+
jbeich: maintainer-feedback? (avilla)
grahamperrin: maintainer-feedback? (multimedia)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Belics 2018-01-16 22:34:06 UTC
I don't know where to assign blame so I'm starting with Firefox 58.0,1 cause that's when I see the issue. I only noticed this for the first time a couple of days ago when running "top" and seeing one zombie process. 

$ ps ajx|grep -w Z
rob        87197   0.0  0.0       0      0  0  Z+   16:07       0:00.00 <defunct>
rob        87202   0.0  0.0   14928   2700  4  S+   16:08       0:00.00 grep 87197
$ ps aux|grep 87196
rob        87196   0.0  0.0   44048   7220  0  I+   16:07       0:00.00 /usr/local/lib/speech-
rob        87204   0.0  0.0   14928   2700  4  S+   16:08       0:00.00 grep 87196
$ ps aux|grep 87196
rob        87196   0.0  0.0   44048   7220  0  I+   16:07       0:00.00 /usr/local/lib/speech-dispatcher-modules/sd_cicero /usr/
rob        87206   0.0  0.0   14928   2700  4  S+   16:09       0:00.00 grep 87196

$ ps aux|grep 87196
rob        87196   0.0  0.0   44048   7220  0  I+   16:07       0:00.00 /usr/local/lib/speech-dispatcher-modules/sd_cicero /usr/local/etc/speech-dispatcher/modules/cicero.conf
rob        87235   0.0  0.0   14928   2700  4  S+   16:13       0:00.00 grep 87196

What I don't understand is that 'pkg info -r speech-dispatcher' shows www/chromium as dependent on this port and not Firefox.

Closing Firefox or killing it makes the zombie go away as I believe it should being the parent process.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-01-17 00:20:30 UTC
Firefox 44+ implements WebSpeech API on FreeDesktop platforms via speech-dispatcher. Firefox 49+ itself uses WebSpeech to Narrate a page. Both didn't have any changes in Firefox 58.

Steps To Reproduce:
1. pkg install firefox mesa-dri speech-dispatcher
2. firefox -new-instance -profile $(mktemp -d) https://en.wikipedia.org/
3. Click on Enter Reader View in URL bar
4. Click Narrate button at left side panel
5. Click Play

Firefox spawns sd_* processes as soon as step #3 which highlights there maybe an issue with initialization. Let's try to minify:

$ cat a.c
#include <libspeechd.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
  SPDConnection* mSpeechdClient = spd_open(argv[0], NULL, NULL, SPD_MODE_THREADED);
  spd_say(mSpeechdClient, SPD_MESSAGE, "Hello from Speech Dispatcher!");
  sleep(600);
  return 0;
}

$ pkg install speech-dispatcher pkgconf
$ cc a.c `pkg-config --cflags --libs speech-dispatcher`
$ ./a.out &
$ ps xd
  PID TT  STAT    TIME COMMAND
36621  -  SsJ  0:00.00 /usr/local/bin/speech-dispatcher --spawn --communication-method unix_socket -
36615  6  SJ   0:00.00 /usr/local/lib/speech-dispatcher-modules/sd_generic /usr/local/etc/speech-dis
36616  6  SJ   0:00.00 /usr/local/lib/speech-dispatcher-modules/sd_dummy /usr/local/etc/speech-dispa
36618  6  SJ   0:00.01 /usr/local/lib/speech-dispatcher-modules/sd_espeak /usr/local/etc/speech-disp
36619  6  SJ   0:00.00 /usr/local/lib/speech-dispatcher-modules/sd_cicero /usr/local/etc/speech-disp
36620  6  ZJ   0:00.00 - <defunct>
Comment 2 Jan Beich freebsd_committer freebsd_triage 2018-01-17 00:27:50 UTC
Maybe speech-dispatcher maintainer can check if Gecko uses API correctly.
https://searchfox.org/mozilla-central/rev/48cbb200aa02/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2023-04-23 20:02:17 UTC
What's the situation with firefox-112.0.1_1,2 and speech-dispatcher-0.11.2_1 on 13.2-RELEASE?

accessibility/speech-dispatcher is maintained by multimedia@