Gamaru / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Feature Request: Add MSan Support #575

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
MemorySanitizer (MSan) is a tool that detects use of uninitialized memory.

https://www.chromium.org/developers/testing/memorysanitizer

What steps will reproduce the problem?
1. Write a simple image conversion using libyuv with the destination buffer 
uninitialized.
2. Compile and run the program with MSan.

What is the expected output? What do you see instead?

Expected: No error.
Actual: use-of-uninitialized-value error reported by MSan which is a false 
positive because it doesn't understand libyuv's inline assembly with SSSE3 
instructions.

What version of the product are you using? On what operating system?

Version 1563 on Ubuntu 14.04 Linux x86_64 with G++ 4.8.4

Please provide any additional information below.

I think there are several choices such as:
1. Setting -DLIBYUV_DISABLE_X86 when MSan is running.  This potentially uses a 
different code path than the production code, but has the benefit of not adding 
additional overhead and not depending on MSan.
2. Explicit initialization of the destination buffer when MSan is running.  
This will add additional overhead and running with MSan is already slow.
3. Annotate that the memory is indeed initialized using MSan directives.  This 
may required dependency on MSan.
4...n. Some other ways I haven't through of.

Original issue reported on code.google.com by imp...@google.com on 15 Mar 2016 at 11:56

GoogleCodeExporter commented 8 years ago
The following revision refers to this bug:
  https://chromium.googlesource.com/libyuv/libyuv.git/+/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38

commit 837aa1e2af6c3e7c9e1d6bc240052139c71d2b38
Author: Frank Barchard <fbarchard@google.com>
Date: Wed Mar 16 01:45:38 2016

disable assembly in header for msan=1

GYP_DEFINES="target_arch=x64 msan=1" ./gyp_libyuv
ninja -j7 -C out/Release

R=impjdi@google.com
BUG=libyuv:575

Review URL: https://codereview.chromium.org/1805683003 .

[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/README.chromium
[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/include/libyuv/compar
e_row.h
[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/include/libyuv/planar
_functions.h
[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/include/libyuv/rotate
_row.h
[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/include/libyuv/row.h
[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/include/libyuv/scale_
row.h
[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/include/libyuv/versio
n.h
[modify] https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/libyuv.gyp
[modify] 
https://crrev.com/837aa1e2af6c3e7c9e1d6bc240052139c71d2b38/libyuv_test.gyp

Original comment by bugdroid1@chromium.org on 16 Mar 2016 at 1:46

GoogleCodeExporter commented 8 years ago

Original comment by fbarch...@google.com on 16 Mar 2016 at 1:46