New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 742596 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocked on:
issue 742976



Sign in to add a comment

WeakPtr sequence checker failing in PolicyPrefIndicatorTest.CheckPolicyIndicators

Project Member Reported by michae...@chromium.org, Jul 13 2017

Issue description

The browser test PolicyPrefIndicatorTestInstance/PolicyPrefIndicatorTest.CheckPolicyIndicators/14 is failing on try job runs on linux_chromium_chromeos_ozone_rel_ng.

Example failure: https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/428544

[24697:24816:0713/152511.687415:FATAL:weak_ptr.cc(26)] Check failed: sequence_checker_.CalledOnValidSequence(). WeakPtrs must be checked on the same sequenced thread.
#0 0x0000037aeb3c base::debug::StackTrace::StackTrace()
#1 0x0000037c6d01 logging::LogMessage::~LogMessage()
#2 0x0000037cbf9c base::internal::WeakReference::is_valid()
#3 0x000005f46a17 _ZN4base8internal7InvokerINS0_9BindStateIMN13safe_browsing10V4DatabaseEFvRK13scoped_refptrINS_22SingleThreadTaskRunnerEENS_8CallbackIFvRKSt6vectorINS3_14ListIdentifierESaISC_EEELNS0_8CopyModeE1ELNS0_10RepeatModeE1EEEEJNS_7WeakPtrIS4_EES7_SK_EEEFvvEE7RunImplIRKSM_RKSt5tupleIJSO_S7_SK_EEJLm0ELm1ELm2EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE
#4 0x00000385c0c0 base::debug::TaskAnnotator::RunTask()
#5 0x0000038140fd base::internal::TaskTracker::PerformRunTask()
#6 0x000003814737 base::internal::TaskTrackerPosix::PerformRunTask()
#7 0x000003813942 base::internal::TaskTracker::RunNextTask()
#8 0x0000038667da base::internal::SchedulerWorker::Thread::ThreadMain()
#9 0x00000381c32f base::(anonymous namespace)::ThreadFunc()
#10 0x7f992f660184 start_thread
#11 0x7f992c05cbed clone

Flakiness dashboard https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=CheckPolicyIndicators%2F14
 

Comment 1 by pmarko@chromium.org, Jul 14 2017

Cc: kmarshall@chromium.org pmarko@chromium.org
+kmarshall

This seems to be similar to bug 729716 which was probably fixed by crrev.com/523983 which got reverted two weeks ago.
 
Details:
The symbol in #3 is actually something like

void base::internal::Invoker<base::internal::BindState<
    void (safe_browsing::V4Database::*)(scoped_refptr<base::SingleThreadTaskRunner> const&, base::Callback<void (std::vector<safe_browsing::ListIdentifier, .. > const&), ..>),
    base::WeakPtr<safe_browsing::V4Database>, ...>::RunImpl<..>(...)

so it seems that it's invoking a callback which takes a vector<ListIdentifier>. The only such callback I could find was the safe_browsing::DatabaseReadyForUpdatesCallback. So it seems that that callback is invoked from a different thread than the one where it was created by base::Bind (i.e. where the weakptr was acquired).

The only callback with such a signature I could find is safe_browsing::DatabaseReadyForUpdatesCallback passed into V4Database::VerifyChecksum.

The code around that currently does:
db_task_runner_->PostTask(
    FROM_HERE,
    base::Bind(&V4Database::VerifyChecksumOnTaskRunner,
               weak_factory_on_io_.GetWeakPtr(), callback_task_runner,
               db_ready_for_updates_callback));

which seems weird to me (running on db_task_runner_ with a weakptr acquited by weak_factory_on_io_), but I might be missing something.

Comment 2 by pmarko@chromium.org, Jul 14 2017

Sorry for the broken CL link, it should be:
https://chromium-review.googlesource.com/523983

Comment 3 by kbr@chromium.org, Jul 14 2017

Cc: kbr@chromium.org
Components: Services>Safebrowsing
Another failure:
https://luci-milo.appspot.com/buildbot/tryserver.chromium.linux/linux_chromium_chromeos_ozone_rel_ng/428822

Comment 4 by kbr@chromium.org, Jul 14 2017

 Issue 742976  has been merged into this issue.

Comment 5 by kbr@chromium.org, Jul 14 2017

Labels: -Pri-1 Sheriff-Chromium Pri-0
Status: Available (was: Untriaged)
This test is failing on a significant number of tryjobs and causing CLs to be rejected from the CQ. linux_chromium_chromeos_ozone_rel_ng is unacceptably flaky because of this; see  Issue 742966  for another problem, and the attached screenshot.

I don't see an easy way to just disable the one parameterized version PolicyPrefIndicatorTestInstance/PolicyPrefIndicatorTest.CheckPolicyIndicators/14 .

Fixing these CQ flakes is urgent. I would be inclined to disable the test entirely but am concerned about allowing broken CLs to land in the product. Who can take this?

Screen Shot 2017-07-14 at 10.30.37 AM.png
736 KB View Download

Comment 6 by kbr@chromium.org, Jul 14 2017

Components: Enterprise Security

Comment 7 by kbr@chromium.org, Jul 14 2017

Blockedon: 742976
Cc: dpranke@chromium.org
Note that per  Issue 742976  (which I duplicated into this one), chromium-try-flakes found this flaky on both the regular and Ozone bots (which dpranke@ just folded together, BTW).

https://chromium-try-flakes.appspot.com/all_flake_occurrences?key=ahVzfmNocm9taXVtLXRyeS1mbGFrZXNyWwsSBUZsYWtlIlBQb2xpY3lQcmVmSW5kaWNhdG9yVGVzdEluc3RhbmNlL1BvbGljeVByZWZJbmRpY2F0b3JUZXN0LkNoZWNrUG9saWN5SW5kaWNhdG9ycy8xNAw.

Comment 8 by w...@chromium.org, Jul 14 2017

We should re-land kmarshall's patch 523983 ASAP - unfortunately it was reverted because of a KitKat breakage, which we seem to be missing try-bot coverage for - any suggestions for how we can address that?
Cc: jbudorick@chromium.org
Labels: -Pri-0 -Sheriff-Chromium Pri-1
I don't know that we have any K trybots; maybe jbudorick@ has suggestions.

Downgrading to P1 since I think the tests are off the CQ for the moment.
linux_android_rel_ng is K, though it's K phone and iirc kmarshall's patch only broke K tablet?

Comment 11 by w...@chromium.org, Jul 14 2017

Owner: kmarshall@chromium.org
Status: Started (was: Available)
@jbudorick - that's possible (I'm not that involved in this). Any suggestions for testing on a K tablet, then?
Outside of local testing (which is likely easier if you can get your hands on an N7v2), it's possible to launch tests from local builds into the K tablet swarming bots, but we have very limited capacity there. I have a doc containing the instructions for doing so that I'll send over.

Comment 14 by pmarko@google.com, Jul 14 2017

Is it just me or are there no logs of the failure in https://bugs.chromium.org/p/chromium/issues/detail?id=736924 (due to which kmarshall's CL was reverted)?
I *do* have a N7 kicking around. It's not on Kitkat but I can flash it.
Project Member

Comment 16 by bugdroid1@chromium.org, Jul 14 2017

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

commit e6af5cab1a0d4fde0e721bcdb5de52254679b27f
Author: Kevin Marshall <kmarshall@chromium.org>
Date: Fri Jul 14 23:52:07 2017

Reland "Fix thread safety issues with safe browsing DB."

This is a reland of 0ac8d89ee822c431ea66e0a7da762bb8c28b1877
Original change's description:
> Fix thread safety issues with safe browsing DB.
> 
> Fix thread safety issues with safe browsing DB.
> The Safe Browsing DB has some sequence consistency issues, which
> is caught by the stricter WeakPtr semantics detailed on CL 2908073007.
> 
> * Delete SafeBrowsingDatabaseManager on IO thread.
> * Remove illegal dereferencing of IO-thread WeakPtr from DB thread in
>   V4Database::VerifyChecksumOnTaskRunner
> * Remove non-threadsafe accesses of |io_thread_| resident members from
>   the DB thread in V4LocalDatabaseManager.
> * Add IO-thread runloops to unit tests to handle database teardown.
> 
> 
> R=nparker@chromium.org
> CC=wez@chromium.org
> 
> Bug: 729716
> Change-Id: I1bc620d42aca2f1cc99e482b7776a628d783d390
> Reviewed-on: https://chromium-review.googlesource.com/523983
> Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
> Reviewed-by: Charlie Harrison <csharrison@chromium.org>
> Reviewed-by: Greg Thompson <grt@chromium.org>
> Reviewed-by: Varun Khaneja <vakh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#481735}

TBR=csharrison@chromium.org, grt@chromium.org, vakh@chromium.org

Bug: 729716,  742596 
Change-Id: I4d67aa201c54be7a1e75a7375ac9861a29f1d87f
Reviewed-on: https://chromium-review.googlesource.com/571684
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486946}
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/chrome/browser/safe_browsing/incident_reporting/resource_request_detector_unittest.cc
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/BUILD.gn
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/database_manager.cc
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/database_manager.h
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/database_manager_unittest.cc
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/remote_database_manager_unittest.cc
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/v4_database.cc
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/v4_database.h
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/v4_local_database_manager.h
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/safe_browsing_db/whitelist_checker_client_unittest.cc
[modify] https://crrev.com/e6af5cab1a0d4fde0e721bcdb5de52254679b27f/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc

Owner: pmarko@chromium.org
Status: Fixed (was: Started)
OK, relanded the fix - please verify?
Status: Verified (was: Fixed)
Thank you!
According to the chromium-try-flakes[1], the last failures were 2017-07-14 23:01:42 UTC. The CL landed Jul 14 23:52:07 2017.

The flakiness dashboard[2] also looks fine IMO.

[1] https://chromium-try-flakes.appspot.com/all_flake_occurrences?key=ahVzfmNocm9taXVtLXRyeS1mbGFrZXNyWwsSBUZsYWtlIlBQb2xpY3lQcmVmSW5kaWNhdG9yVGVzdEluc3RhbmNlL1BvbGljeVByZWZJbmRpY2F0b3JUZXN0LkNoZWNrUG9saWN5SW5kaWNhdG9ycy8xNAw

[2] https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=browser_tests (with patch)&tests=PolicyPrefIndicatorTestInstance/PolicyPrefIndicatorTest.CheckPolicyIndicators/14

Sign in to add a comment