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

Issue 697935 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Invalid downcast in browsing_data_remover_factory.cc

Project Member Reported by krasin@chromium.org, Mar 2 2017

Issue description

tip / Linux x86-64

1. Build unit_tests with ubsan:

$ gn gen out/ubsan '--args=is_debug=false is_ubsan_no_recover=true is_ubsan=true is_ubsan_vptr=true is_ubsan_null=true symbol_level=2' --check
$ ninja -C out/ubsan unit_tests

2. Run the test:

$ ./out/ubsan/unit_tests --gtest_filter=ChromeContentBrowserClientClearSiteDataTest.RegistrableDomains
IMPORTANT DEBUGGING NOTE: batches of tests are run inside their
own process. For debugging a test inside a debugger, use the
--gtest_filter=<your_test_name> flag along with
--single-process-tests.
Using sharding settings from environment. This is shard 0/1
Using 1 parallel jobs.
Note: Google Test filter = ChromeContentBrowserClientClearSiteDataTest.RegistrableDomains
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ChromeContentBrowserClientClearSiteDataTest
[ RUN      ] ChromeContentBrowserClientClearSiteDataTest.RegistrableDomains
../../chrome/browser/browsing_data/browsing_data_remover_factory.cc:49:10: runtime error: downcast of address 0x2ec9eb362e00 which does not point to an object of type 'BrowsingDataRemoverImpl'
0x2ec9eb362e00: note: object is of type 'MockBrowsingDataRemover'
 c9 2e 00 00  28 71 b6 12 00 00 00 00  b0 71 b6 12 00 00 00 00  10 2e 36 eb c9 2e 00 00  10 2e 36 eb
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'MockBrowsingDataRemover'
    #0 0x615b9b9 in BrowsingDataRemoverFactory::GetForBrowserContext(content::BrowserContext*) chrome/browser/browsing_data/browsing_data_remover_factory.cc:49:10
    #1 0x7dfc80 in (anonymous namespace)::ChromeContentBrowserClientClearSiteDataTest::remover() chrome/browser/chrome_content_browser_client_unittest.cc:358:9
    #2 0x7e03d9 in (anonymous namespace)::ChromeContentBrowserClientClearSiteDataTest_RegistrableDomains_Test::TestBody() chrome/browser/chrome_content_browser_client_unittest.cc:506:5
    #3 0x5646981 in testing::Test::Run() testing/gtest/src/gtest.cc:2474:5
    #4 0x5647de3 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11
    #5 0x56490ed in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #6 0x56550f1 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #7 0x565408b in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255:10
    #8 0x47aa840 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #9 0x47aa840 in base::TestSuite::Run() base/test/test_suite.cc:271
    #10 0x47ad3b4 in Run base/callback.h:85:12
    #11 0x47ad3b4 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:211
    #12 0x47ad237 in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:453:10
    #13 0x479ef4e in main chrome/test/base/run_all_unittests.cc:30:10
    #14 0x7fce5e8bdf44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287
    #15 0x676b20 in _start (/usr/local/google/home/krasin/chr33/src/out/ubsan/unit_tests+0x676b20)

That breakes UBSan Vptr buildbot:
https://build.chromium.org/p/chromium.fyi/builders/UBSanVptr%20Linux/builds/2161

 
Cc: msramek@chromium.org krasin@chromium.org
Owner: dullweber@chromium.org
Status: Assigned (was: Started)
The culprit is https://codereview.chromium.org/2720723002/ that made MockBrowsingDataRemover to not derive from BrowsingDataRemoverImpl.


Christian, can you please take care of this?
Labels: -Pri-3 Pri-1
Bumping up the priority as it breaks the buildbot and potentially masks other problems from being spotted.
Sorry about the issue, I will fix it tomorrow. 
I didn't submit any other cl that depends on this change yet so it should be safe to revert until then.
Thanks, fixing tomorrow is fine.

For today, I will keep an eye on the failing bot to spot any new regressions which otherwise won't be reported.
Cc: dullweber@chromium.org thakis@chromium.org
 Issue 697986  has been merged into this issue.
Status: Fixed (was: Assigned)
Thank you for the fix. The buildbot is now green:
https://build.chromium.org/p/chromium.fyi/builders/UBSanVptr%20Linux/builds/2166

Sign in to add a comment