New issue
Advanced search Search tips

Issue 825987 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 825327



Sign in to add a comment

Support PendingTask::task_backtrace from TaskScheduler

Project Member Reported by gab@chromium.org, Mar 26 2018

Issue description

Currently PendingTask::task_backtrace only stores the backtrace of the flow of PostTasks made from MessageLoops.

So a chain of PostTasks UI -> TaskScheduler -> IO -> TaskScheduler -> UI -> (crash) will result in no backtrace at all (because missing links per lack of MessageLoop::current() on TaskScheduler aren't even skipped, they result in the whole chain being dropped -- we could at least have had UI/IO otherwise)

Also, it's impractical in the first place to have this hardcoded into MessageLoop and requiring friend'ing (makes another refactoring I'm on more difficult @ issue 825327).
 

Comment 1 by gab@chromium.org, Mar 26 2018

Owner: gab@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 5 2018

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

commit ae4f9ce34ec9a809f683be15d7b6957070549031
Author: Gabriel Charette <gab@chromium.org>
Date: Thu Apr 05 19:00:01 2018

Move PendingTask::task_backtrace management completely to TaskAnnotator.

This fixes 3 things:
 1) No longer need a friended private variable on MessageLoop
    (this facilitates crbug.com/825327)
 2) Support backtraces that go through TaskScheduler (and eventual other
    TaskAnnotator users)
 3) Support backtraces for tasks posted when returning from a nested
    loop (MessageLoop would previously set the field to null rather than
    "previous" when returning from a task).

New TaskAnnotatorBacktraceIntegrationTests are largely based on previous
PendingTaskTests (plus testing support beyond simple MessageLoop/Thread).

Prefered making PendingTask::task_backtrace mutable to forcing all
PostTask annotations (TaskAnnotator::DidQueueTask and TaskTracker::WillPostTask)
to use a non-const pointer given this doesn't really modify the state of
the PendingTask but rather some internal tracing state.

This also revealed  issue 826902 .

Bug:  825987 , 825327,  826902 
Change-Id: Iae24c8d8745a6dadb2185f5c581fb1ff1d5b3f23
Reviewed-on: https://chromium-review.googlesource.com/982496
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548512}
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/BUILD.gn
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/debug/task_annotator.cc
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/debug/task_annotator.h
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/debug/task_annotator_unittest.cc
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/message_loop/message_loop.cc
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/message_loop/message_loop.h
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/pending_task.cc
[modify] https://crrev.com/ae4f9ce34ec9a809f683be15d7b6957070549031/base/pending_task.h
[delete] https://crrev.com/707b08d5df848b53efc5fb35616048df0444d203/base/pending_task_unittest.cc

Comment 3 by gab@chromium.org, Apr 5 2018

Status: Fixed (was: Started)

Comment 4 by gab@chromium.org, May 3 2018

Cc: robliao@chromium.org gab@chromium.org dmu...@chromium.org
 Issue 712770  has been merged into this issue.

Sign in to add a comment