Skip to content

Commit

Permalink
Disable GPU in capture tests in MSan
Browse files Browse the repository at this point in the history
Attempting to initialize the GPU triggers MSan failures in GL with eager
checks enabled in MSan:

Uninitialized bytes in strlen at offset 0 inside [0x70200013dec0, 30)
==589==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fffeeba96de in glLabelObjectEXT (/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x4f6de)
    #1 0x7fffeeba9b10 in glLabelObjectEXT (/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x4fb10)
    #2 0x7fffeeb879a3  (/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x2d9a3)
    #3 0x7fffeeb894c0  (/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x2f4c0)
    #4 0x7fffeeb8e400  (/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x34400)
    #5 0x7fffeeb8f384  (/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x35384)
    #6 0x7fffeeb8bd9a  (/lib/x86_64-linux-gnu/libGLX_mesa.so.0+0x31d9a)
    #7 0x7fffecceb484 in queryExtensionsString third_party/angle/src/libANGLE/renderer/gl/glx/FunctionsGLX.cpp:354:12
    #8 0x7fffecceb484 in rx::FunctionsGLX::initialize(_XDisplay*, int, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>*) third_party/angle/src/libANGLE/renderer/gl/glx/FunctionsGLX.cpp:223:30
    #9 0x7fffeccdada2 in rx::DisplayGLX::initialize(egl::Display*) third_party/angle/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp:114:15
    #10 0x7fffec70f649 in egl::Display::initialize() third_party/angle/src/libANGLE/Display.cpp:1082:36
    chromium#11 0x7fffec0bed17 in egl::Initialize(egl::Thread*, egl::Display*, int*, int*) third_party/angle/src/libGLESv2/egl_stubs.cpp:514:5
    chromium#12 0x7fffec0c6319 in EGL_Initialize third_party/angle/src/libGLESv2/entry_points_egl_autogen.cpp:571:27
    chromium#13 0x7fffefc4000d in eglInitialize third_party/angle/src/libEGL/libEGL_autogen.cpp:177:12
    chromium#14 0x5555868ec92a in gl::GLDisplayEGL::InitializeDisplay(bool, std::__Cr::vector<gl::DisplayType, std::__Cr::allocator<gl::DisplayType>>, gl::EGLDisplayPlatform, gl::GLDisplayEGL*) ui/gl/gl_display.cc:769:10
    chromium#15 0x5555868eb310 in gl::GLDisplayEGL::Initialize(bool, std::__Cr::vector<gl::DisplayType, std::__Cr::allocator<gl::DisplayType>>, gl::EGLDisplayPlatform) ui/gl/gl_display.cc:660:8
    chromium#16 0x55556c6f1957 in ui::GLOzoneEGL::InitializeGLOneOffPlatform(bool, std::__Cr::vector<gl::DisplayType, std::__Cr::allocator<gl::DisplayType>>, gl::GpuPreference) ui/ozone/common/gl_ozone_egl.cc:25:17
    chromium#17 0x55558b1a8999 in gl::init::InitializeGLOneOffPlatform(gl::GpuPreference) ui/gl/init/gl_initializer_ozone.cc:27:26
    chromium#18 0x55558b1a6978 in gl::init::InitializeGLOneOffPlatformImplementation(bool, bool, bool, gl::GpuPreference) ui/gl/init/gl_factory.cc:211:24
    chromium#19 0x55558b1a6208 in gl::init::(anonymous namespace)::InitializeGLOneOffPlatformHelper(bool, gl::GpuPreference) ui/gl/init/gl_factory.cc:135:10
    chromium#20 0x55558b1a662d in gl::init::InitializeGLNoExtensionsOneOff(bool, gl::GpuPreference) ui/gl/init/gl_factory.cc:166:10
    chromium#21 0x55558b227379 in gpu::GpuInit::InitializeAndStartSandbox(base::CommandLine*, gpu::GpuPreferences const&) gpu/ipc/service/gpu_init.cc:495:18
    chromium#22 0x55559ab41ce4 in content::GpuMain(content::MainFunctionParams) content/gpu/gpu_main.cc:358:39
    chromium#23 0x55557b5888da in content::RunZygote(content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:685:14
    chromium#24 0x55557b58abad in content::RunOtherNamedProcessTypeMain(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, content::MainFunctionParams, content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:789:12
    chromium#25 0x55557b58e4fe in content::ContentMainRunnerImpl::Run() content/app/content_main_runner_impl.cc:1156:10
    chromium#26 0x55557b585aaf in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/content_main.cc:332:36
    chromium#27 0x55557b58644a in content::ContentMain(content::ContentMainParams) content/app/content_main.cc:345:10
    chromium#28 0x555580df9c37 in content::LaunchTestsInternal(content::TestLauncherDelegate*, unsigned long, int, char**) content/public/test/test_launcher.cc:385:12
    chromium#29 0x555580dfab58 in content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) content/public/test/test_launcher.cc:504:10
    chromium#30 0x555582b8afec in LaunchChromeTests(unsigned long, content::TestLauncherDelegate*, int, char**) chrome/test/base/chrome_test_launcher.cc:392:10
    chromium#31 0x55557d422a0e in main chrome/test/base/browser_tests_main.cc:60:10
    chromium#32 0x7ffff48456c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    chromium#33 0x7ffff4845784 in __libc_start_main csu/../csu/libc-start.c:360:3
    chromium#34 0x55555e647029 in _start (/usr/local/google/home/dcheng/src/chrome/src/out/msan/browser_tests+0x90f3029) (BuildId: 6cbc295b16ac1107)

  Uninitialized value was created by a heap allocation
    #0 0x55555e675a22 in malloc /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cpp:1021:3
    #1 0x7ffff489b087 in __vasprintf_internal libio/vasprintf.c:116:16
    #2 0x4ae8d349882b18ff  (<unknown module>)

Bug: 40240570
Change-Id: If59faa297e214b7219ebb4c5c9572b44a33ee070
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5548826
Reviewed-by: Elad Alon <[email protected]>
Commit-Queue: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1303583}
  • Loading branch information
zetafunction authored and Chromium LUCI CQ committed May 21, 2024
1 parent b9e1a85 commit de85918
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
9 changes: 5 additions & 4 deletions chrome/browser/media/webrtc/capture_handle_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,12 @@ class CaptureHandleBrowserTest : public WebRtcTestBase {
switches::kEnableExperimentalWebPlatformFeatures);
command_line->AppendSwitchASCII(
switches::kAutoSelectTabCaptureSourceByTitle, kCapturedTabTitle);
// TODO(crbug.com/40260482): Remove this after fixing feature
// MSan and GL do not get along so avoid using the GPU with MSan.
// TODO(crbug.com/40260482): Remove the CrOS exception after fixing feature
// detection in 0c tab capture path as it'll no longer be needed.
if constexpr (!BUILDFLAG(IS_CHROMEOS)) {
command_line->AppendSwitch(switches::kUseGpuInTests);
}
#if !BUILDFLAG(IS_CHROMEOS) && !defined(MEMORY_SANITIZER)
command_line->AppendSwitch(switches::kUseGpuInTests);
#endif
}

void TearDownOnMainThread() override {
Expand Down
7 changes: 4 additions & 3 deletions chrome/browser/media/webrtc/sub_capture_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,12 @@ class SubCaptureBrowserTestBase : public WebRtcTestBase {
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(
switches::kEnableExperimentalWebPlatformFeatures);
// MSan and GL do not get along so avoid using the GPU with MSan.
// TODO(crbug.com/40260482): Remove this after fixing feature
// detection in 0c tab capture path as it'll no longer be needed.
if constexpr (!BUILDFLAG(IS_CHROMEOS)) {
command_line->AppendSwitch(switches::kUseGpuInTests);
}
#if !BUILDFLAG(IS_CHROMEOS) && !defined(MEMORY_SANITIZER)
command_line->AppendSwitch(switches::kUseGpuInTests);
#endif
command_line_ = command_line;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ std::u16string GetShareThisTabInsteadButtonLabel(
void AdjustCommandLineForZeroCopyCapture(base::CommandLine* command_line) {
CHECK(command_line);

// MSan and GL do not get along so avoid using the GPU with MSan.
// TODO(crbug.com/40260482): Remove this after fixing feature
// detection in 0c tab capture path as it'll no longer be needed.
if constexpr (!BUILDFLAG(IS_CHROMEOS)) {
command_line->AppendSwitch(switches::kUseGpuInTests);
}
#if !BUILDFLAG(IS_CHROMEOS) && !defined(MEMORY_SANITIZER)
command_line->AppendSwitch(switches::kUseGpuInTests);
#endif
}

} // namespace
Expand Down

0 comments on commit de85918

Please sign in to comment.