Chen-tao / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

vp9 unit tests produce valgrind warrnings #599

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
v1.2.0-3880-g5b30788

Mostly centered on vp9_mcomp.c / vp9_rdopt.c.

$ valgrind \
  --malloc-fill=AB \
  --track-origins=yes \
  --leak-check=full \
  --show-reachable=yes \
  --db-attach=yes \
  ./test_libvpx

And currently at least:
$ valgrind \
  --malloc-fill=AB \
  --track-origins=yes \
  --leak-check=full \
  --show-reachable=yes \
  --db-attach=yes \
  ./test_libvpx --gtest_filter=VP9/BordersTest.TestEncodeHighBitrate/0

Original issue reported on code.google.com by jz...@google.com on 9 Aug 2013 at 11:26

GoogleCodeExporter commented 8 years ago
https://gerrit.chromium.org/gerrit/#/c/65398/

Original comment by jz...@google.com on 21 Aug 2013 at 2:09

GoogleCodeExporter commented 8 years ago
After issue #605 was resolved the remaining warnings are related to the 
variance assembly (4x4, 4x8, 8x4). Most of these are likely harmless in the 
encoder due to the border padding, but either the assembly should be modified 
or the buffers in the test.

[----------] 15 tests from MMX/VP9VarianceTest
[ RUN      ] MMX/VP9VarianceTest.Zero/0
==12965== Invalid read of size 8
==12965==    at 0x5E5660: ??? (vp9_variance_impl_mmx.asm:381)
==12965==    by 0x5BD0F6: vp9_variance4x4_mmx (vp9_variance_mmx.c:45)
==12965==    by 0x4D81DC: (anonymous namespace)::VarianceTest<unsigned int 
(*)(unsigned char const*, int, unsigned char const*, int, unsigned 
int*)>::ZeroTest() (variance_test.cc:157)
==12965==    by 0x69AA2C: void 
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, 
void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x6934DF: testing::Test::Run() (gtest.cc:2162)
==12965==    by 0x6937A7: testing::TestInfo::Run() (gtest.cc:2338)
==12965==    by 0x693960: testing::TestCase::Run() (gtest.cc:2445)
==12965==    by 0x693EB9: testing::internal::UnitTestImpl::RunAllTests() 
(gtest.cc:4237)
==12965==    by 0x69A5AC: bool 
testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTe
stImpl, bool>(testing::internal::UnitTestImpl*, bool 
(testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x69338A: testing::UnitTest::Run() (gtest.cc:3874)
==12965==    by 0x40FB5C: main (test_libvpx.cc:60)
==12965==  Address 0x5e005ec is 12 bytes inside a block of size 16 alloc'd
==12965==    at 0x4C2AC27: operator new[](unsigned long) (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12965==    by 0x4D43C4: (anonymous namespace)::VarianceTest<unsigned int 
(*)(unsigned char const*, int, unsigned char const*, int, unsigned 
int*)>::SetUp() (variance_test.cc:124)
==12965==    by 0x69AA2C: void 
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, 
void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x693407: testing::Test::Run() (gtest.cc:2157)
==12965==    by 0x6937A7: testing::TestInfo::Run() (gtest.cc:2338)
==12965==    by 0x693960: testing::TestCase::Run() (gtest.cc:2445)
==12965==    by 0x693EB9: testing::internal::UnitTestImpl::RunAllTests() 
(gtest.cc:4237)
==12965==    by 0x69A5AC: bool 
testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTe
stImpl, bool>(testing::internal::UnitTestImpl*, bool 
(testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x69338A: testing::UnitTest::Run() (gtest.cc:3874)
==12965==    by 0x40FB5C: main (test_libvpx.cc:60)
==12965== 
==12965== Invalid read of size 8
==12965==    at 0x5E5666: ??? (vp9_variance_impl_mmx.asm:385)
==12965==    by 0x5BD0F6: vp9_variance4x4_mmx (vp9_variance_mmx.c:45)
==12965==    by 0x4D81DC: (anonymous namespace)::VarianceTest<unsigned int 
(*)(unsigned char const*, int, unsigned char const*, int, unsigned 
int*)>::ZeroTest() (variance_test.cc:157)
==12965==    by 0x69AA2C: void 
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, 
void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x6934DF: testing::Test::Run() (gtest.cc:2162)
==12965==    by 0x6937A7: testing::TestInfo::Run() (gtest.cc:2338)
==12965==    by 0x693960: testing::TestCase::Run() (gtest.cc:2445)
==12965==    by 0x693EB9: testing::internal::UnitTestImpl::RunAllTests() 
(gtest.cc:4237)
==12965==    by 0x69A5AC: bool 
testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTe
stImpl, bool>(testing::internal::UnitTestImpl*, bool 
(testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x69338A: testing::UnitTest::Run() (gtest.cc:3874)
==12965==    by 0x40FB5C: main (test_libvpx.cc:60)
==12965==  Address 0x5e0059c is 12 bytes inside a block of size 16 alloc'd
==12965==    at 0x4C2AC27: operator new[](unsigned long) (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12965==    by 0x4D4319: (anonymous namespace)::VarianceTest<unsigned int 
(*)(unsigned char const*, int, unsigned char const*, int, unsigned 
int*)>::SetUp() (variance_test.cc:123)
==12965==    by 0x69AA2C: void 
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, 
void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x693407: testing::Test::Run() (gtest.cc:2157)
==12965==    by 0x6937A7: testing::TestInfo::Run() (gtest.cc:2338)
==12965==    by 0x693960: testing::TestCase::Run() (gtest.cc:2445)
==12965==    by 0x693EB9: testing::internal::UnitTestImpl::RunAllTests() 
(gtest.cc:4237)
==12965==    by 0x69A5AC: bool 
testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTe
stImpl, bool>(testing::internal::UnitTestImpl*, bool 
(testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2090)
==12965==    by 0x69338A: testing::UnitTest::Run() (gtest.cc:3874)
==12965==    by 0x40FB5C: main (test_libvpx.cc:60)
==12965== 

Original comment by jz...@google.com on 25 Aug 2013 at 1:05

GoogleCodeExporter commented 8 years ago
proposed fix here: 
https://gerrit.chromium.org/gerrit/#/c/66944/

Original comment by ya...@google.com on 26 Aug 2013 at 4:25

GoogleCodeExporter commented 8 years ago
This was the bulk of them, but note there are a few other sources:

http://build.webmproject.org/jenkins/job/libvpx%20unit%20tests%20(valgrind-2)/de
fault/10/valgrindResult/?

http://build.webmproject.org/jenkins/job/libvpx%20unit%20tests%20(valgrind-2)/de
fault/10/valgrindResult/pid=4145,0x8005f/?

http://build.webmproject.org/jenkins/job/libvpx%20unit%20tests%20(valgrind-2)/de
fault/10/valgrindResult/pid=4145,0x80061/?

Original comment by jz...@google.com on 26 Aug 2013 at 8:22

GoogleCodeExporter commented 8 years ago
https://gerrit.chromium.org/gerrit/#/c/67053/

should fix all the errors reported in subpel variance functions. 

Original comment by ya...@google.com on 27 Aug 2013 at 4:08

GoogleCodeExporter commented 8 years ago
fixed as of 45125ee5

Original comment by ya...@google.com on 28 Aug 2013 at 7:39