watery01 / libyuv

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

DrMemory reports uninitialized reads in row_win.cc #262

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. On Windows, setup a libyuv checkout using this .gclient contents:
solutions = [
  { "name"        : "src",
    "url"         : "http://libyuv.googlecode.com/svn/trunk",
    "deps_file"   : "DEPS",
    "managed"     : True,
    "custom_vars" : {
      "root_dir": "src",
    },
    "safesync_url": "",
  },
  { "name":"drmemory.DEPS",
    "url":"svn://svn.chromium.org/chrome/trunk/deps/third_party/drmemory/drmemory.DEPS",
  },
]

2. Run:
set GYP_DEFINES=build_for_tool=drmemory
gclient sync
3. Compile:
ninja -C out\Debug
4. Run libyuv_unittest with Dr Memory (standing in the src/ dir):
tools\valgrind-libyuv\libyuv_tests.bat --build_dir out\Debug --test 
libyuv_unittest --tool drmemory_full ""

What is the expected output? What do you see instead?
All tests should pass without errors. Dr Memory reports a couple of of 
UNINITIALIZED READ errors:

09:31:44 drmemory_analyze.py [INFO] Found 4 error reports
09:31:44 drmemory_analyze.py [INFO] Report #1
UNINITIALIZED READ: reading 0x015251f8-0x015251fa 2 byte(s) within 
0x015251f6-0x015251fa
#0 I411ToARGBRow_SSSE3                                                        
[e:\src\libyuv\trunk\source\row_win.cc:2589]
#1 I411ToARGB                                                                 
[e:\src\libyuv\trunk\source\convert_argb.cc:219]
#2 libyuv::libyuvTest_I411ToARGB_Any_Test::TestBody                           
[e:\src\libyuv\trunk\unit_test\convert_test.cc:483]
#3 
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void> 
[e:\src\libyuv\trunk\testing\gtest\src\gtest.cc:1981]
Note: @0:00:13.011 in thread 5392
Note: instruction: data16 movd   (%esi) -> %xmm0
Suppression (error hash=#5B0993F01B48E4D2#):
  For more info on using suppressions see http://dev.chromium.org/developers/how-tos/using-drmemory#TOC-Suppressing-error-reports-from-the-
{
UNINITIALIZED READ
name=<insert_a_suppression_name_here>
*!I411ToARGBRow_SSSE3
*!I411ToARGB
*!libyuv::libyuvTest_I411ToARGB_Any_Test::TestBody
*!testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void>
}

09:31:44 drmemory_analyze.py [INFO] Report #2
UNINITIALIZED READ: reading 0x01530241-0x01530243 2 byte(s) within 
0x0153023f-0x01530243
#0 I411ToARGBRow_SSSE3                                                        
[e:\src\libyuv\trunk\source\row_win.cc:2589]
#1 I411ToARGB                                                                 
[e:\src\libyuv\trunk\source\convert_argb.cc:219]
#2 libyuv::libyuvTest_I411ToARGB_Unaligned_Test::TestBody                     
[e:\src\libyuv\trunk\unit_test\convert_test.cc:483]
#3 
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void> 
[e:\src\libyuv\trunk\testing\gtest\src\gtest.cc:1981]
Note: @0:00:13.089 in thread 5392
Note: instruction: data16 movd   (%esi) -> %xmm0
Suppression (error hash=#36E21F49086E703E#):
  For more info on using suppressions see http://dev.chromium.org/developers/how-tos/using-drmemory#TOC-Suppressing-error-reports-from-the-
{
UNINITIALIZED READ
name=<insert_a_suppression_name_here>
*!I411ToARGBRow_SSSE3
*!I411ToARGB
*!libyuv::libyuvTest_I411ToARGB_Unaligned_Test::TestBody
*!testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void>
}

09:31:44 drmemory_analyze.py [INFO] Report #3
UNINITIALIZED READ: reading 0x01552b80-0x01552b82 2 byte(s) within 
0x01552b7e-0x01552b82
#0 I411ToARGBRow_SSSE3                                                        
[e:\src\libyuv\trunk\source\row_win.cc:2589]
#1 libyuv::libyuvTest_I411ToARGB_Invert_Test::TestBody                        
[e:\src\libyuv\trunk\unit_test\convert_test.cc:483]
#2 
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void> 
[e:\src\libyuv\trunk\testing\gtest\src\gtest.cc:1981]
Note: @0:00:13.167 in thread 5392
Note: instruction: data16 movd   (%esi) -> %xmm0
Suppression (error hash=#0BDD6D9758CFEA8A#):
  For more info on using suppressions see http://dev.chromium.org/developers/how-tos/using-drmemory#TOC-Suppressing-error-reports-from-the-
{
UNINITIALIZED READ
name=<insert_a_suppression_name_here>
*!I411ToARGBRow_SSSE3
*!libyuv::libyuvTest_I411ToARGB_Invert_Test::TestBody
*!testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void>
}

09:31:44 drmemory_analyze.py [INFO] Report #4
UNINITIALIZED READ: reading 0x0156b800-0x0156b802 2 byte(s) within 
0x0156b7fe-0x0156b802
#0 I411ToARGBRow_SSSE3                                                        
[e:\src\libyuv\trunk\source\row_win.cc:2589]
#1 I411ToARGB                                                                 
[e:\src\libyuv\trunk\source\convert_argb.cc:219]
#2 libyuv::libyuvTest_I411ToARGB_Opt_Test::TestBody                           
[e:\src\libyuv\trunk\unit_test\convert_test.cc:483]
#3 
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void> 
[e:\src\libyuv\trunk\testing\gtest\src\gtest.cc:1981]
Note: @0:00:13.245 in thread 5392
Note: instruction: data16 movd   (%esi) -> %xmm0
Suppression (error hash=#D15F712F1AE6716E#):
  For more info on using suppressions see http://dev.chromium.org/developers/how-tos/using-drmemory#TOC-Suppressing-error-reports-from-the-
{
UNINITIALIZED READ
name=<insert_a_suppression_name_here>
*!I411ToARGBRow_SSSE3
*!I411ToARGB
*!libyuv::libyuvTest_I411ToARGB_Opt_Test::TestBody
*!testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void>
}

Please use labels and text to provide additional information.

Original issue reported on code.google.com by kjellan...@google.com on 30 Aug 2013 at 7:48

GoogleCodeExporter commented 9 years ago

Original comment by kjellan...@google.com on 30 Aug 2013 at 7:51

GoogleCodeExporter commented 9 years ago
I411 is a format with 1/4 width and full height chrominance subsampling.
Its the only format with 1/4 width - most are 1/2 width.
The issue is likely in the unittest not the code itself.

This being SSSE3 failing, the first thing I would try is disabling SSSE3
export LIBYUV_DISABLE_SSSE3=1
and then run the test.  If it fails in C as well, the issue is more likely in 
the test itself.

Original comment by fbarch...@google.com on 12 Sep 2013 at 1:24

GoogleCodeExporter commented 9 years ago
Right, if I set LIBYUV_DISABLE_SSSE3=1 the test passes without errors. Does 
that help you to fix this?

Original comment by kjellan...@google.com on 17 Sep 2013 at 9:56

GoogleCodeExporter commented 9 years ago
Yes that does help.  That tells me its an SSSE3 overread.
Either the calling code did it on purpose, since its an optimization.
Or the low level did it, most likely by accident.  But SIMD can only read as 
little as 4 bytes (movd), so it may be for technical reasons.

Really I should repro the issue, but first step is failing:

d:\src\libyuv\trunk>ninja -C out\Debug
ninja: Entering directory `out\Debug'
[80/150] CXX obj\source\libyuv.row_win.obj
FAILED: ninja -t msvc -o obj\source\libyuv.row_win.obj -e environment.x86 -- 
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC
\bin\cl.exe" /nologo /showIncludes /FC @obj\source\libyuv.row_win.obj.rsp /c 
..\..\source\row_win.cc /Foobj\source\libyuv.row_win.ob
j /Fdobj\libyuv.pdb
d:\src\libyuv\trunk\source\row_win.cc(5114) : error C2400: inline assembler 
syntax error in 'opcode'; found 'SHL'
d:\src\libyuv\trunk\source\row_win.cc(5118) : error C2400: inline assembler 
syntax error in 'opcode'; found 'EQ'
d:\src\libyuv\trunk\source\row_win.cc(5123) : error C2400: inline assembler 
syntax error in 'opcode'; found 'SHR'
d:\src\libyuv\trunk\source\row_win.cc(5125) : error C2400: inline assembler 
syntax error in 'opcode'; found 'SHL'
d:\src\libyuv\trunk\source\row_win.cc(5144) : error C2400: inline assembler 
syntax error in 'opcode'; found 'EQ'
d:\src\libyuv\trunk\source\row_win.cc(5145) : error C2412: 'convertloop' : 
case-insensitive label redefined
d:\src\libyuv\trunk\source\row_win.cc(5147) : error C2400: inline assembler 
syntax error in 'opcode'; found 'SHR'
d:\src\libyuv\trunk\source\row_win.cc(5162) : error C2400: inline assembler 
syntax error in 'opcode'; found 'SHL'
d:\src\libyuv\trunk\source\row_win.cc(5163) : error C2400: inline assembler 
syntax error in 'opcode'; found 'EQ'
d:\src\libyuv\trunk\source\row_win.cc(5165) : error C2400: inline assembler 
syntax error in 'opcode'; found 'SHR'
[80/150] CXX obj\testing\gtest\src\gtest.gtest.obj
ninja: build stopped: subcommand failed.

Original comment by fbarch...@google.com on 17 Sep 2013 at 5:55

GoogleCodeExporter commented 9 years ago
Some documentation
http://www.chromium.org/developers/how-tos/using-drmemory

Original comment by fbarch...@google.com on 17 Sep 2013 at 7:36

GoogleCodeExporter commented 9 years ago
r798 should pass all drmemory tests.
2 tests disabled and need further investigation: I411ToARGB and Sobel

Original comment by fbarch...@google.com on 24 Sep 2013 at 7:56

GoogleCodeExporter commented 9 years ago
r799 fixes I411ToARGB.
r800 fixes Sobel.
All errors resolved.
Performance is a little slow on large scale factors.
Warnings on memory allocations.

Original comment by fbarch...@google.com on 24 Sep 2013 at 11:20

GoogleCodeExporter commented 9 years ago
Yes, sobel is fixed and we've rolled libyuv to r874 for webrtc.

Original comment by fbarch...@google.com on 26 Nov 2013 at 11:01