New issue
Advanced search Search tips

Issue 855580 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug

Blocking:
issue 843511



Sign in to add a comment

ozone_unittests fails to run under msan due to references to uninitialized memory

Project Member Reported by thakis@chromium.org, Jun 22 2018

Issue description

I'm trying to add ozone_unittests to the cros msan bot. Many tests fail: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_chromeos_msan_rel_ng/800

ScreenManagerTest.MonitorDisabledInMirrorMode
ScreenManagerTest.CheckChangingMode
ScreenManagerTest.CheckMirrorModeAfterBeginReEnabled
DrmOverlayValidatorTest.RejectYUVBuffersIfNotSupported_MirroredControllers
DrmOverlayValidatorTest.RejectBufferAllocationFail
DrmWindowTest.CheckCursorSurfaceAfterChangingDevice
ScreenManagerTest.CheckProperConfigurationWithDifferentDeviceAndSameCrtc
ScreenManagerTest.ShouldDissociateWindowOnControllerRemoval
DrmOverlayValidatorTest.RejectYUVBuffersIfNotSupported
DrmOverlayValidatorTest.WindowWithNoController
ScreenManagerTest.CheckControllerAfterItIsRemoved
DrmOverlayValidatorTest.OverlayFormat_XRGB
ScreenManagerTest.CheckControllerToWindowMappingWithOverlappingWindows
ScreenManagerTest.CheckMirrorModeTransitions
ScreenManagerTest.CheckControllerToWindowMappingWithSameBounds
ScreenManagerTest.RejectBufferWithIncompatibleModifiers
ScreenManagerTest.ReuseFramebufferIfDisabledThenReEnabled
DrmOverlayValidatorTest.OptimalFormatXRGB_MirroredControllers
ScreenManagerTest.CheckWithInvalidBounds
ScreenManagerTest.EnableControllerWhenWindowHasNoBuffer
DrmOverlayValidatorTest.DontCollapseOverlayToPrimaryInFullScreen
ScreenManagerTest.EnableControllerWhenWindowHasBuffer
ScreenManagerTest.CheckForSecondValidController
ScreenManagerTest.CheckForControllersInMirroredMode
DrmWindowTest.CheckCallbackOnFailedSwap
DrmOverlayValidatorTest.OverlayFormat_YUV
ScreenManagerTest.DoNotEnterMirrorModeUnlessSameBounds
ScreenManagerTest.CheckControllerToWindowMappingWithDifferentBounds
DrmWindowTest.SetCursorImage
ScreenManagerTest.MonitorGoneInMirrorMode
ScreenManagerTest.CheckWithValidController
ScreenManagerTest.CheckMirrorModeModesettingWithDisplaysMode
DrmOverlayValidatorTest.DontPromoteMoreLayersThanAvailablePlanes
ScreenManagerTest.CheckDuplicateConfiguration


I looked through a few failures, and the ones I looked at all have the same cause: 

[ RUN      ] DrmOverlayValidatorTest.OverlayFormat_XRGB
==12994==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x156306b in ui::SameMode(_drmModeModeInfo const&, _drmModeModeInfo const&) ./../../ui/ozone/platform/drm/common/drm_util.cc:348:33
    #1 0x15d39af in ui::ScreenManager::ActualConfigureDisplayController(scoped_refptr<ui::DrmDevice> const&, unsigned int, unsigned int, gfx::Point const&, _drmModeModeInfo const&) ./../../ui/ozone/platform/drm/gpu/screen_manager.cc:167:7
    #2 0x15d3220 in ui::ScreenManager::ConfigureDisplayController(scoped_refptr<ui::DrmDevice> const&, unsigned int, unsigned int, gfx::Point const&, _drmModeModeInfo const&) ./../../ui/ozone/platform/drm/gpu/screen_manager.cc:144:7
    #3 0x4f2a03 in DrmOverlayValidatorTest::SetUp() ./../../ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc:109:20
    #4 0xbab3d5 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
    #5 0xbaef4b in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2667:11
    #6 0xbb09d9 in testing::TestCase::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2785:28
    #7 0xbe70e4 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5047:43
    #8 0xbe59b7 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
    #9 0x1629630 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46
    #10 0x1629630 in base::TestSuite::Run() ./../../base/test/test_suite.cc:275:0
    #11 0x1632ea0 in Run ./../../base/callback.h:96:12
    #12 0x1632ea0 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) ./../../base/test/launcher/unit_test_launcher.cc:225:0
    #13 0x163267e in base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) ./../../base/test/launcher/unit_test_launcher.cc:576:10
    #14 0xc0587c in main ./../../mojo/edk/test/run_all_unittests.cc:46:10
    #15 0x7f79b2496f44 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287:0
    #16 0x444a29 in _start ??:0:0
  Uninitialized value was stored to memory at
    #0 0x4649bb in __msan_memcpy /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:1492:3
    #1 0x15d3975 in mode ./../../ui/ozone/platform/drm/gpu/crtc_controller.h:42:41
    #2 0x15d3975 in ui::ScreenManager::ActualConfigureDisplayController(scoped_refptr<ui::DrmDevice> const&, unsigned int, unsigned int, gfx::Point const&, _drmModeModeInfo const&) ./../../ui/ozone/platform/drm/gpu/screen_manager.cc:167:0
    #3 0x15d3220 in ui::ScreenManager::ConfigureDisplayController(scoped_refptr<ui::DrmDevice> const&, unsigned int, unsigned int, gfx::Point const&, _drmModeModeInfo const&) ./../../ui/ozone/platform/drm/gpu/screen_manager.cc:144:7
    #4 0x4f2a03 in DrmOverlayValidatorTest::SetUp() ./../../ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc:109:20
    #5 0xbab3d5 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
    #6 0xbaef4b in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2667:11
    #7 0xbb09d9 in testing::TestCase::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2785:28
    #8 0xbe70e4 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5047:43
    #9 0xbe59b7 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
    #10 0x1629630 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46
    #11 0x1629630 in base::TestSuite::Run() ./../../base/test/test_suite.cc:275:0
    #12 0x1632ea0 in Run ./../../base/callback.h:96:12
    #13 0x1632ea0 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) ./../../base/test/launcher/unit_test_launcher.cc:225:0
    #14 0x163267e in base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) ./../../base/test/launcher/unit_test_launcher.cc:576:10
    #15 0xc0587c in main ./../../mojo/edk/test/run_all_unittests.cc:46:10
    #16 0x7f79b2496f44 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287:0
  Uninitialized value was created by a heap allocation
    #0 0x4b73f9 in operator new(unsigned long) /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_new_delete.cc:45:35
    #1 0x15d1700 in ui::ScreenManager::AddDisplayController(scoped_refptr<ui::DrmDevice> const&, unsigned int, unsigned int) ./../../ui/ozone/platform/drm/gpu/screen_manager.cc:120:39
    #2 0x4f2837 in DrmOverlayValidatorTest::SetUp() ./../../ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc:108:20
    #3 0xbab3d5 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
    #4 0xbaef4b in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2667:11
    #5 0xbb09d9 in testing::TestCase::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2785:28
    #6 0xbe70e4 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5047:43
    #7 0xbe59b7 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
    #8 0x1629630 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46
    #9 0x1629630 in base::TestSuite::Run() ./../../base/test/test_suite.cc:275:0
    #10 0x1632ea0 in Run ./../../base/callback.h:96:12
    #11 0x1632ea0 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) ./../../base/test/launcher/unit_test_launcher.cc:225:0
    #12 0x163267e in base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) ./../../base/test/launcher/unit_test_launcher.cc:576:10
    #13 0xc0587c in main ./../../mojo/edk/test/run_all_unittests.cc:46:10
    #14 0x7f79b2496f44 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287:0
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/b/s/w/ir/out/Release/ozone_unittests+0x156306b)



Looks like crtc_controller has a mode_ field but its constructor doesn't initialize it, and that's been that way since the class was added in https://chromium.googlesource.com/chromium/src/+/35d1d3a0d525595304fc8333373ddb660bd649cc

dnicoara, do you remember if that's intentional? Should something explicitly set the mode, or should it just get a default value in the ctor?

 
Status: Started (was: Untriaged)
Thank you for report. Definitely not intentional. I've uploaded a change for review to fix the bug: https://chromium-review.googlesource.com/c/chromium/src/+/1111977
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 22 2018

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

commit 925e657795e92bb10d19e875410234d1efc478a9
Author: Daniel Nicoara <dnicoara@chromium.org>
Date: Fri Jun 22 14:38:36 2018

[Ozone-DRM] Fix msan error of use of uninitialized memory

BUG= 855580 
TEST=Compiled and ran ozone_unittests with msan

Change-Id: I9f2d42b98210f9edca33d6d5defcae0ed29f1a07
Reviewed-on: https://chromium-review.googlesource.com/1111977
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569615}
[modify] https://crrev.com/925e657795e92bb10d19e875410234d1efc478a9/ui/ozone/platform/drm/gpu/crtc_controller.h

Status: Fixed (was: Started)
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 22 2018

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

commit 65338c09a5e9cbf8eae281d52eefc14182e58a8a
Author: Nico Weber <thakis@chromium.org>
Date: Fri Jun 22 19:13:40 2018

Enable more tests on the cros memory bots.

The motivation is to remove chromium_memory_chromiumos_asan_gtests in favor
of linux_chromeos_rel_gtests, but when I tried doing that directly [1], I got
many asan/lsan and msan reports for these tests. Some of them pass however,
so I'd like to lock in the working ones while I work on fixing the broken ones.

1: https://chromium-review.googlesource.com/c/chromium/src/+/1110703

Adds to "Linux ChromiumOS MSan Tests" and "Linux Chromium OS ASan LSan Tests (1)" these tests:
- chromevox_tests
- gl_unittests_ozone (to asan/lsan only)
- ozone_gl_unittests
- ozone_x11_unittests
- select_to_speak_extension_tests
- views_mus_interactive_ui_tests

Bug: 843511
Bug:  855573 , 855580 , 855588 
Bug:  855584 , 855585 , 855583 
Change-Id: I9402cd43d1d0ef95432eba8231ae79c936b4848b
Reviewed-on: https://chromium-review.googlesource.com/1112037
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569725}
[modify] https://crrev.com/65338c09a5e9cbf8eae281d52eefc14182e58a8a/testing/buildbot/chromium.memory.json
[modify] https://crrev.com/65338c09a5e9cbf8eae281d52eefc14182e58a8a/testing/buildbot/test_suite_exceptions.pyl
[modify] https://crrev.com/65338c09a5e9cbf8eae281d52eefc14182e58a8a/testing/buildbot/test_suites.pyl

Project Member

Comment 5 by bugdroid1@chromium.org, Jun 25 2018

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

commit 5ecf35f1ab2a0a4e2fda04595383231c251f8a9e
Author: Nico Weber <thakis@chromium.org>
Date: Mon Jun 25 01:50:22 2018

Enable more tests on the cros memory bots.

Enable views_mus_unittests on both lsan/asan and on msan, it should pass now.

Enable ozone_unittests and wayland_client_perftests on just msan
(they don't pass on lsan/asan yet).

With this, linux_chromeos_rel_specific_gtests_asan_bringup is identical to
linux_chromeos_rel_specific_gtests and can be removed, and because of _that_,
chromium_memory_chromiumos_asan_gtests is identical to linux_chromeos_rel_gtests
and can also be removed.

As a consequence, tests added to the cros rel bots will be added to the
memory bots automatically going forward.

TBR=kbr

Bug: 843511
Bug:  855580 , 855588 , 855584 , 855585 , 855583 
Change-Id: I6a28ebae4c9005ce508f8caef07679a1bb50285c
Reviewed-on: https://chromium-review.googlesource.com/1112957
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569949}
[modify] https://crrev.com/5ecf35f1ab2a0a4e2fda04595383231c251f8a9e/testing/buildbot/chromium.memory.json
[modify] https://crrev.com/5ecf35f1ab2a0a4e2fda04595383231c251f8a9e/testing/buildbot/test_suite_exceptions.pyl
[modify] https://crrev.com/5ecf35f1ab2a0a4e2fda04595383231c251f8a9e/testing/buildbot/test_suites.pyl
[modify] https://crrev.com/5ecf35f1ab2a0a4e2fda04595383231c251f8a9e/testing/buildbot/waterfalls.pyl

Sign in to add a comment