New issue
Advanced search Search tips
Starred by 1 user

Issue metadata

Status: Fixed
Closed: Nov 2016
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

issue 563816

Sign in to add a comment

Histogram logging in OffscreenCanvasFrameDispatcherImpl::dispatchFrame is not thread safe

Project Member Reported by, Nov 9 2016 Back to list

Issue description

The timer histograms for the cases where we are in a worker are implemented using static variables.  When running with assertions enabled, this causes crashes due to thread safety checks. This can be observed when re-loading a page that uses offscreencanvas.commit in a worker. After reloading the page, a new worker is created and the statics end up being accessed on a different thread from where they were initialized.  This is most likely also causing flake on the test bots: If two offscreen canvas "in-worker" tests get executed on the same test driver, the second test will crash. 

Comment 1 by, Nov 9 2016

Blocking: 563816
Project Member

Comment 2 by, Nov 16 2016

The following revision refers to this bug:

commit e9ccbda7993554fbdeab8810be5e4ac3ac669f8d
Author: xidachen <>
Date: Wed Nov 16 01:21:04 2016

Make OffscreenCanvas histogram thread safe

In OffscreenCanvasFrameDispatcherImpl::dispatchFrame, we have a timer
histogram at the end of this function which uses DEFINE_STATIC_LOCAL. This
is not thread safe in the cases where multiple worker commit at the same
time. This CL makes the timer histogram thread safe.

A layout test has been added to make sure that the test doesn't crash.

BUG= 663916 

Cr-Commit-Position: refs/heads/master@{#432333}


Status: Fixed (was: Assigned)

Sign in to add a comment