Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Issue 25550003: Web Speech API: Fix a race condition causing renderer crash. (Closed)

Created:
7 years, 2 months ago by Primiano Tucci (use gerrit)
Modified:
7 years, 2 months ago
CC:
joi+watch-content_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Web Speech API: Fix a race condition causing renderer crash. The introduction of the MediaRequestPermission (i.e. infobar) has opened a race window which causes a recognition session to be aborted twice, causing a consequent crash on the renderer. The race window is the following: 1) Session 1 is started (SpeechRecognitionManagerImpl::StartSession) 2) Security checks for session 1 are started asynchronously (delegate_->CheckRecognitionIsAllowed). 3) Session 2 is started. This causes an immediate abort of session 1. 4) The oustanding security check for session 1 completes and returns a nack. The nack causes an abort of session 1 (in RecognitionAllowedCallback). However, session 1 was already aborted in 3). 5) The double abort is not tolerated by the renderer, which crashes. This CL closes the race window with a not-so-elegant fix. A refactoring of the speech_recognition_manager_impl.cc is STRONGLY adviced (Hint: use and extend the already existing FSM to keep track of the asynchronous completion of security checks. Don't introduce extra state with extra variables). BUG=296690, 116954 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=226523

Patch Set 1 #

Total comments: 6

Patch Set 2 : Nits + moved check #

Patch Set 3 : DCHECK #

Patch Set 4 : Fixed return condition #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -3 lines) Patch
M content/browser/speech/speech_recognition_manager_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/speech/speech_recognition_manager_impl.cc View 1 2 3 3 chunks +14 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Primiano Tucci (use gerrit)
PTAL
7 years, 2 months ago (2013-10-01 21:06:46 UTC) #1
jam
why is chromium-reviews@chromium.org not cc'd?
7 years, 2 months ago (2013-10-01 23:48:23 UTC) #2
Primiano Tucci (use gerrit)
On 2013/10/01 23:48:23, jam wrote: > why is mailto:chromium-reviews@chromium.org not cc'd? uhm, I'm afraid it ...
7 years, 2 months ago (2013-10-02 04:48:29 UTC) #3
tommi (sloooow) - chröme
lgtm % nits https://codereview.chromium.org/25550003/diff/1/content/browser/speech/speech_recognition_manager_impl.cc File content/browser/speech/speech_recognition_manager_impl.cc (right): https://codereview.chromium.org/25550003/diff/1/content/browser/speech/speech_recognition_manager_impl.cc#newcode188 content/browser/speech/speech_recognition_manager_impl.cc:188: DCHECK(iter != sessions_.end()); DCHECK_NE? https://codereview.chromium.org/25550003/diff/1/content/browser/speech/speech_recognition_manager_impl.cc#newcode189 content/browser/speech/speech_recognition_manager_impl.cc:189: ...
7 years, 2 months ago (2013-10-02 08:01:14 UTC) #4
no longer working on chromium
lgtm with one concern, please address it. https://codereview.chromium.org/25550003/diff/1/content/browser/speech/speech_recognition_manager_impl.cc File content/browser/speech/speech_recognition_manager_impl.cc (right): https://codereview.chromium.org/25550003/diff/1/content/browser/speech/speech_recognition_manager_impl.cc#newcode205 content/browser/speech/speech_recognition_manager_impl.cc:205: if (is_allowed) ...
7 years, 2 months ago (2013-10-02 09:05:06 UTC) #5
Primiano Tucci (use gerrit)
https://codereview.chromium.org/25550003/diff/1/content/browser/speech/speech_recognition_manager_impl.cc File content/browser/speech/speech_recognition_manager_impl.cc (right): https://codereview.chromium.org/25550003/diff/1/content/browser/speech/speech_recognition_manager_impl.cc#newcode188 content/browser/speech/speech_recognition_manager_impl.cc:188: DCHECK(iter != sessions_.end()); On 2013/10/02 08:01:14, tommi wrote: > ...
7 years, 2 months ago (2013-10-02 14:09:00 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/primiano@chromium.org/25550003/26001
7 years, 2 months ago (2013-10-02 17:36:39 UTC) #7
commit-bot: I haz the power
7 years, 2 months ago (2013-10-02 19:22:34 UTC) #8
Message was sent while issue was closed.
Change committed as 226523

Powered by Google App Engine
This is Rietveld 408576698