From b5bc098e204c8ad3122e2de9ac2f89f99f9b1ee0 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Mon, 25 Nov 2013 09:06:33 +0000 Subject: [PATCH] Clear empty video frames in unittest so DrMemory will allow them to be read without an uninitialized read error. BUG=libyuv:263 TESTED=drmemory out\Debug\modules_unittests.exe --gtest_filter=*PreprocessorLogic R=kjellander@webrtc.org, mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/4319004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5168 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../valgrind-webrtc/drmemory/suppressions.txt | 166 ++++++++---------- .../unit_test/video_processing_unittest.cc | 5 +- 2 files changed, 80 insertions(+), 91 deletions(-) diff --git a/tools/valgrind-webrtc/drmemory/suppressions.txt b/tools/valgrind-webrtc/drmemory/suppressions.txt index b4f6168be5..98ddd5381e 100644 --- a/tools/valgrind-webrtc/drmemory/suppressions.txt +++ b/tools/valgrind-webrtc/drmemory/suppressions.txt @@ -1,90 +1,76 @@ -# This file is used in addition to the one already maintained in Chrome. -# It acts as a place holder for future additions for WebRTC. -# It must exist for the Python wrapper script to work properly. - - -INVALID HEAP ARGUMENT -name=https://code.google.com/p/webrtc/issues/detail?id=2321 (1) -drmemorylib.dll!replace_operator_delete_array -*!webrtc::scoped_array::~scoped_array -*!webrtc::PushResampler::~PushResampler -... -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -INVALID HEAP ARGUMENT -name=https://code.google.com/p/webrtc/issues/detail?id=2321 (2) -drmemorylib.dll!replace_operator_delete_array -*!webrtc::scoped_array::~scoped_array -*!webrtc::PushSincResampler::~PushSincResampler -... -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -GDI USAGE ERROR -name=https://code.google.com/p/webrtc/issues/detail?id=2323 (1) -system call NtGdiDeleteObjectApp -GDI32.dll!DeleteDC -GDI32.dll!DeleteDC -*!webrtc::`anonymous namespace'::WindowCapturerWin::Capture -... -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -UNINITIALIZED READ -name=https://code.google.com/p/webrtc/issues/detail?id=2323 (2) -system call NtUserGetThreadDesktop parameter value #1 -*!webrtc::Desktop::GetThreadDesktop -*!webrtc::ScopedThreadDesktop::ScopedThreadDesktop -*!webrtc::`anonymous namespace'::ScreenCapturerWin::ScreenCapturerWin -*!webrtc::ScreenCapturer::CreateWithDisableAero -*!webrtc::ScreenCapturer::Create -... -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -UNINITIALIZED READ -name=https://code.google.com/p/libyuv/issues/detail?id=263 -*!ScaleAddRows_SSE2 -... -*!ScalePlaneDown -*!ScalePlane -*!I420Scale -*!webrtc::Scaler::Scale -*!webrtc::VPMSimpleSpatialResampler::ResampleFrame -*!webrtc::VPMFramePreprocessor::PreprocessFrame -*!webrtc::VideoProcessingModuleImpl::PreprocessFrame -*!webrtc::VideoProcessingModuleTest_PreprocessorLogic_Test::TestBody -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -LEAK -name=https://code.google.com/p/webrtc/issues/detail?id=2333 -drmemorylib.dll!replace_operator_new -*!webrtc::test::UdpSocketWrapper::CreateSocket -*!webrtc::test::UdpSocketManager_AddAndRemoveSocketDoesNotLeakMemory_Test::TestBody -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -INVALID HEAP ARGUMENT -name=https://code.google.com/p/webrtc/issues/detail?id=2515 (1) -drmemorylib.dll!replace_operator_delete_nothrow -*!webrtc::scoped_array::~scoped_array -*!webrtc::NetEqImpl::~NetEqImpl -*!webrtc::NetEqImpl::`scalar deleting destructor' -... -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -INVALID HEAP ARGUMENT -name=https://code.google.com/p/webrtc/issues/detail?id=2515 (2) -drmemorylib.dll!replace_operator_delete_nothrow -*!webrtc::scoped_array::reset -*!webrtc::NetEqImpl::SetSampleRateAndChannels -*!webrtc::NetEqImpl::InsertPacketInternal -*!webrtc::NetEqImpl::InsertPacket -... -*!testing::internal::HandleSehExceptionsInMethodIfSupported - -UNINITIALIZED READ -name=https://code.google.com/p/webrtc/issues/detail?id=2516 -system call NtUserGetThreadDesktop parameter value #1 -*!webrtc::Desktop::GetThreadDesktop -*!webrtc::ScopedThreadDesktop::ScopedThreadDesktop -*!webrtc::`anonymous namespace'::ScreenCapturerWin::ScreenCapturerWin -*!webrtc::ScreenCapturer::Create -*!webrtc::ScreenCapturerTest::SetUp -*!testing::internal::HandleSehExceptionsInMethodIfSupported +# This file is used in addition to the one already maintained in Chrome. +# It acts as a place holder for future additions for WebRTC. +# It must exist for the Python wrapper script to work properly. + + +INVALID HEAP ARGUMENT +name=https://code.google.com/p/webrtc/issues/detail?id=2321 (1) +drmemorylib.dll!replace_operator_delete_array +*!webrtc::scoped_array::~scoped_array +*!webrtc::PushResampler::~PushResampler +... +*!testing::internal::HandleSehExceptionsInMethodIfSupported + +INVALID HEAP ARGUMENT +name=https://code.google.com/p/webrtc/issues/detail?id=2321 (2) +drmemorylib.dll!replace_operator_delete_array +*!webrtc::scoped_array::~scoped_array +*!webrtc::PushSincResampler::~PushSincResampler +... +*!testing::internal::HandleSehExceptionsInMethodIfSupported + +GDI USAGE ERROR +name=https://code.google.com/p/webrtc/issues/detail?id=2323 (1) +system call NtGdiDeleteObjectApp +GDI32.dll!DeleteDC +GDI32.dll!DeleteDC +*!webrtc::`anonymous namespace'::WindowCapturerWin::Capture +... +*!testing::internal::HandleSehExceptionsInMethodIfSupported + +UNINITIALIZED READ +name=https://code.google.com/p/webrtc/issues/detail?id=2323 (2) +system call NtUserGetThreadDesktop parameter value #1 +*!webrtc::Desktop::GetThreadDesktop +*!webrtc::ScopedThreadDesktop::ScopedThreadDesktop +*!webrtc::`anonymous namespace'::ScreenCapturerWin::ScreenCapturerWin +*!webrtc::ScreenCapturer::CreateWithDisableAero +*!webrtc::ScreenCapturer::Create +... +*!testing::internal::HandleSehExceptionsInMethodIfSupported + +LEAK +name=https://code.google.com/p/webrtc/issues/detail?id=2333 +drmemorylib.dll!replace_operator_new +*!webrtc::test::UdpSocketWrapper::CreateSocket +*!webrtc::test::UdpSocketManager_AddAndRemoveSocketDoesNotLeakMemory_Test::TestBody +*!testing::internal::HandleSehExceptionsInMethodIfSupported + +INVALID HEAP ARGUMENT +name=https://code.google.com/p/webrtc/issues/detail?id=2515 (1) +drmemorylib.dll!replace_operator_delete_nothrow +*!webrtc::scoped_array::~scoped_array +*!webrtc::NetEqImpl::~NetEqImpl +*!webrtc::NetEqImpl::`scalar deleting destructor' +... +*!testing::internal::HandleSehExceptionsInMethodIfSupported + +INVALID HEAP ARGUMENT +name=https://code.google.com/p/webrtc/issues/detail?id=2515 (2) +drmemorylib.dll!replace_operator_delete_nothrow +*!webrtc::scoped_array::reset +*!webrtc::NetEqImpl::SetSampleRateAndChannels +*!webrtc::NetEqImpl::InsertPacketInternal +*!webrtc::NetEqImpl::InsertPacket +... +*!testing::internal::HandleSehExceptionsInMethodIfSupported + +UNINITIALIZED READ +name=https://code.google.com/p/webrtc/issues/detail?id=2516 +system call NtUserGetThreadDesktop parameter value #1 +*!webrtc::Desktop::GetThreadDesktop +*!webrtc::ScopedThreadDesktop::ScopedThreadDesktop +*!webrtc::`anonymous namespace'::ScreenCapturerWin::ScreenCapturerWin +*!webrtc::ScreenCapturer::Create +*!webrtc::ScreenCapturerTest::SetUp +*!testing::internal::HandleSehExceptionsInMethodIfSupported diff --git a/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc b/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc index 89c59ec8b1..6e54923063 100644 --- a/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc +++ b/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc @@ -45,7 +45,10 @@ void VideoProcessingModuleTest::SetUp() { ASSERT_EQ(0, video_frame_.CreateEmptyFrame(width_, height_, width_, half_width_, half_width_)); - + // Clear video frame so DrMemory/Valgrind will allow reads of the buffer. + memset(video_frame_.buffer(kYPlane), 0, video_frame_.allocated_size(kYPlane)); + memset(video_frame_.buffer(kUPlane), 0, video_frame_.allocated_size(kUPlane)); + memset(video_frame_.buffer(kVPlane), 0, video_frame_.allocated_size(kVPlane)); const std::string video_file = webrtc::test::ResourcePath("foreman_cif", "yuv"); source_file_ = fopen(video_file.c_str(),"rb");