New issue
Advanced search Search tips

Issue 666592 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Data race on base::trace_event::TraceLog::enabled_modes_

Project Member Reported by thestig@chromium.org, Nov 18 2016

Issue description

Maybe related to r431300 ?

https://build.chromium.org/p/chromium.memory.full/builders/Linux%20TSan%20Tests/builds/3672 has a failure in SingleProcessMemoryTracingTest.RendererInitiatedSingleDump. We know the bot was green maybe a week before that, and it was purple for a while. When it transitioned from purple to red, this problem popped out.

WARNING: ThreadSanitizer: data race (pid=179953)
  Write of size 1 at 0x7b5c000003d8 by thread T4 (mutexes: write M2076):
    #0 SetEnabled base/trace_event/trace_log.cc:688 (content_browsertests+0x0000029a7cfc)
    #1 content::TracingControllerImpl::SetEnabledOnFileThread(base::trace_event::TraceConfig const&, int, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) content/browser/tracing/tracing_controller_impl.cc:239

Previous read of size 1 at 0x7b5c000003d8 by thread T22:
  #0 UpdateCategoryState base/trace_event/trace_log.cc:514 (content_browsertests+0x0000029a64fd)
  #1 GetCategoryGroupEnabled base/trace_event/trace_log.cc:500 (content_browsertests+0x0000029a64fd)
  #2 serviceScriptedAnimations third_party/WebKit/Source/core/page/PageAnimator.cpp:45 (content_browsertests+0x0000050ce366)
  #3 animate third_party/WebKit/Source/web/PageWidgetDelegate.cpp:54 (content_browsertests+0x0000041bdf14)

I can reproduce this locally with a few tries by running the following from a TSAN build: content_browsertests --no-sandbox --gtest_filter=SingleProcessMemoryTracingTest.RendererInitiatedSingleDump

If there are DBus errors, disable the bluez::DBusBluezManagerWrapperLinux calls in content/shell/browser/shell_browser_main_parts.cc.

So what's up with base::trace_event::TraceLog::enabled_modes_ ? Sometimes it's protected by a lock. Other times it's accessed without a lock. There's even IsEnabled() and enabled_modes() in the header.
 
Cc: -primiano@chromium.org oysteine@chromium.org
Owner: primiano@chromium.org
Status: Started (was: Untriaged)
I think I know precisely what it is, I screwed up in my last refactoring and accidentally removed that check out of the lock. I realized that last day.
Fix is here: https://codereview.chromium.org/2495173002/

Components: Speed>Tracing
Components: -Internals>Tracing
Status: Fixed (was: Started)
 https://codereview.chromium.org/2495173002/ landed long time ago. closing.

Sign in to add a comment