Closed Bug 1225928 Opened 4 years ago Closed 4 years ago

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

Categories

(Core :: DOM: Core & HTML, defect)

Unspecified
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: eeejay, Assigned: eeejay)

References

Details

Attachments

(1 file, 1 obsolete file)

When we supply an empty string to spd_say, it hangs and locks Firefox with the following JS:
speechSynthesis.speak(new SpeechSynthesisUtterance());
Actually, nothing happens. But the queue is suspended, and if you call speechSynthesis.cancel() after the speak above, fx hangs.
Depends on: 1226015
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-
(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.
Emulate speechd events and make it asynchronous.
Attachment #8689296 - Attachment is obsolete: true
Attachment #8693728 - Flags: review?(bugs)
Attachment #8693728 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/03c6bd7c9aec
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.