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

Issue 1460763004: Fix protocol for aborting and waiting for cancelable tasks. (Closed)

Created:
5 years, 1 month ago by Michael Lippautz
Modified:
5 years, 1 month ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix protocol for aborting and waiting for cancelable tasks. Since {CancelAndWait} blocks on the tasks that are still present in the internal hashmap, we are not allowed to remove the task upon trying to cancel it using {TryAbort}. The previous implementation suffered from a bug where: 1) The task was created and handed over to the platform. 2) The task was started by the platform, setting it to running state. 3) We called {TryAbort}, effectively removing it from the manager, but failing to cancel (as it was already running) 4) All tasks finished running, indicating this with their own semaphore. 5) The platform was stuck (scheduling) before destroying the task. 6) Main thread finished its work, waiting for all the necessary tasks, and the isolate terminated. 7) The platform destroyed the task, calling the destructor, calling into an already freed isolate. BUG=chromium:524425 LOG=N Committed: https://crrev.com/a698fd849bba5df74a44b31e284ec45362f33c12 Cr-Commit-Position: refs/heads/master@{#32118}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -8 lines) Patch
M src/cancelable-task.h View 2 chunks +6 lines, -0 lines 0 comments Download
M src/cancelable-task.cc View 1 2 chunks +22 lines, -8 lines 0 comments Download

Messages

Total messages: 10 (5 generated)
Hannes Payer (out of office)
lgtm https://codereview.chromium.org/1460763004/diff/1/src/cancelable-task.cc File src/cancelable-task.cc (right): https://codereview.chromium.org/1460763004/diff/1/src/cancelable-task.cc#newcode57 src/cancelable-task.cc:57: CHECK(removed != nullptr); DCHECK https://codereview.chromium.org/1460763004/diff/1/src/cancelable-task.cc#newcode72 src/cancelable-task.cc:72: CHECK(removed != ...
5 years, 1 month ago (2015-11-19 14:19:07 UTC) #3
Michael Lippautz
https://codereview.chromium.org/1460763004/diff/1/src/cancelable-task.cc File src/cancelable-task.cc (right): https://codereview.chromium.org/1460763004/diff/1/src/cancelable-task.cc#newcode57 src/cancelable-task.cc:57: CHECK(removed != nullptr); On 2015/11/19 14:19:07, Hannes Payer wrote: ...
5 years, 1 month ago (2015-11-19 14:20:30 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460763004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460763004/20001
5 years, 1 month ago (2015-11-19 14:20:47 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 1 month ago (2015-11-19 15:33:20 UTC) #9
commit-bot: I haz the power
5 years, 1 month ago (2015-11-19 15:33:59 UTC) #10
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/a698fd849bba5df74a44b31e284ec45362f33c12
Cr-Commit-Position: refs/heads/master@{#32118}

Powered by Google App Engine
This is Rietveld 408576698