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

Issue 2657283002: Do not delete synchronously in OnTaskRunnerDeleter. (Closed)

Created:
3 years, 10 months ago by pkalinnikov
Modified:
3 years, 10 months ago
Reviewers:
dcheng, tzik
CC:
chromium-reviews, vmpstr+watch_chromium.org, engedy
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not delete synchronously in OnTaskRunnerDeleter. Currently OnTaskRunnerDeleter::operator() relies on RunsTasksOnCurrentThread() method of the TaskRunner. However, the latter has weak guarantees on the returned value (see the comment to it). It can even always return true. Therefore, thread-unsafe objects can not be safely deleted under some circumstances. The current implementation also makes such a crashing scenario possible. Suppose there is an Object living in the SequencedTaskRunner and a Task has been posted to a TaskRunner to access the Object. After that, the deleter has been invoked and immediately deleted the Object. After that the Task got to execute in the TaskRunner, and tries to read from a deleted Object => undefined behavior. Review-Url: https://codereview.chromium.org/2657283002 Cr-Commit-Position: refs/heads/master@{#446920} Committed: https://chromium.googlesource.com/chromium/src/+/90cdf584494922804c8d0c81a83bcad271645659

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -3 lines) Patch
M base/sequenced_task_runner.h View 1 chunk +1 line, -3 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 18 (11 generated)
pkalinnikov
Hi guys, please take a look. tzik@: You are the author of the class, and ...
3 years, 10 months ago (2017-01-27 15:27:26 UTC) #6
dcheng
Is this causing a bug somewhere? I'm OK with this change, but it seems largely ...
3 years, 10 months ago (2017-01-27 19:25:09 UTC) #9
pkalinnikov
I have a pending CL that relies on fixing this behavior. I could make such ...
3 years, 10 months ago (2017-01-27 19:27:45 UTC) #10
tzik
lgtm
3 years, 10 months ago (2017-01-27 21:04:01 UTC) #11
dcheng
LGTM. Originally I was wondering why we had the synchronous delete, but if tzik is ...
3 years, 10 months ago (2017-01-28 01:26:10 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2657283002/1
3 years, 10 months ago (2017-01-28 09:55:40 UTC) #15
commit-bot: I haz the power
3 years, 10 months ago (2017-01-28 11:41:04 UTC) #18
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/90cdf584494922804c8d0c81a83b...

Powered by Google App Engine
This is Rietveld 408576698