New issue
Advanced search Search tips

Issue 711167 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

CHECK if the posted callback is null in PostTask implementations

Project Member Reported by tzik@chromium.org, Apr 13 2017

Issue description

When a null callback is posted to a PostTask implementation, it hits a DCHECK and eventually causes a crash by a null pointer access.
However, when the crash happened in the wild, it's less informative and actionable since the stack of the culprit is already gone on the null pointer access.
Though we can track where the null callback is posted from by a local variable of TaskAnnotator, it's a few step away from the crash report, and annoying to extract.

So, the check in the PostTask implementations should be CHECK instead of DCHECK, so that the triage of that sort of crash should get smoother.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/498d42bc7c665044b713fc9cbc86b459d58f0b50

commit 498d42bc7c665044b713fc9cbc86b459d58f0b50
Author: tzik <tzik@chromium.org>
Date: Thu Apr 13 07:42:48 2017

CHECK tasks posted by TaskRunner::PostTask

This CL is a reraise of http://crrev.com/2785943004 PS4.

A null callback posted to PostTask family eventually causes a null pointer
access crash. And its crash report doesn't indicate the culprit directly
without looking into the local variable of the minidump.

After this CL, the crash happens earlier and the crash report will
have meaningful trace.

BUG= 711167 , 709149

Review-Url: https://codereview.chromium.org/2815573002
Cr-Commit-Position: refs/heads/master@{#464333}

[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/deferred_sequenced_task_runner.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/message_loop/incoming_task_queue.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/task_scheduler/delayed_task_manager.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/task_scheduler/scheduler_worker_pool_impl.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/task_scheduler/sequence.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/threading/sequenced_worker_pool.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/threading/worker_pool_posix.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/base/threading/worker_pool_win.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/chrome/browser/after_startup_task_utils.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/content/renderer/categorized_worker_pool.cc
[modify] https://crrev.com/498d42bc7c665044b713fc9cbc86b459d58f0b50/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc

Comment 2 by tzik@chromium.org, Apr 14 2017

Status: Fixed (was: Untriaged)

Sign in to add a comment