Speech dispatcher client hangs when spd_say is supplied with an empty string

RESOLVED FIXED in Firefox 45

Status

()

Core
DOM
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: eeejay, Assigned: eeejay)

Tracking

unspecified
mozilla45
Unspecified
Linux
Points:
---

Firefox Tracking Flags

(firefox45 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
When we supply an empty string to spd_say, it hangs and locks Firefox with the following JS:
speechSynthesis.speak(new SpeechSynthesisUtterance());
(Assignee)

Comment 1

2 years ago
Actually, nothing happens. But the queue is suspended, and if you call speechSynthesis.cancel() after the speak above, fx hangs.
(Assignee)

Updated

2 years ago
Depends on: 1226015
(Assignee)

Comment 2

2 years ago
Created attachment 8689296 [details] [diff] [review]
Fix hang on linux when sending an empty string to speech synth.
Attachment #8689296 - Flags: review?(bugs)
Comment on attachment 8689296 [details] [diff] [review]
Fix hang on linux when sending an empty string to speech synth.

I wonder if something here should happen async.
In fact, if I read the code correctly, we need to do that, since 
isn't mCurrentTask set _after_ Speak has been called (when nsSynthVoiceRegistry::GetInstance()->SpeakUtterance returns), but
then OnEnd has been called already and we're in an odd state then.

Or am I missing something here?
Attachment #8689296 - Flags: review?(bugs) → review-
(Assignee)

Comment 4

2 years ago
(In reply to Olli Pettay [:smaug] from comment #3)
> Comment on attachment 8689296 [details] [diff] [review]
> Fix hang on linux when sending an empty string to speech synth.
> 
> I wonder if something here should happen async.
> In fact, if I read the code correctly, we need to do that, since 
> isn't mCurrentTask set _after_ Speak has been called (when
> nsSynthVoiceRegistry::GetInstance()->SpeakUtterance returns), but
> then OnEnd has been called already and we're in an odd state then.
> 
> Or am I missing something here?

This is true! It works fine in e10s since it is async anyway. I'll come up with another patch.
(Assignee)

Comment 5

2 years ago
Created attachment 8693728 [details] [diff] [review]
Fix hang on linux when sending an empty string to speech synth.

Emulate speechd events and make it asynchronous.
Attachment #8689296 - Attachment is obsolete: true
Attachment #8693728 - Flags: review?(bugs)
Attachment #8693728 - Flags: review?(bugs) → review+

Comment 6

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/03c6bd7c9aec

Comment 7

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/03c6bd7c9aec
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox45: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.