Skip to content

Commit

Permalink
README.md: Document memory debugger pitfalls
Browse files Browse the repository at this point in the history
(more specifically, the need to disable libjpeg-turbo's SIMD extensions
when testing with valgrind, MSan, etc.)

Addresses a concern expressed in libjpeg-turbo#365
  • Loading branch information
dcommander committed Aug 30, 2019
1 parent f448279 commit 5db6a68
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,15 @@ quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
function in those cases. This causes performance to drop by as much as 40%.
It is therefore strongly advised that you use the slow integer forward DCT
whenever encoding images with a JPEG quality of 98 or higher.


Memory Debugger Pitfalls
========================

Valgrind and Memory Sanitizer (MSan) can generate false positives
(specifically, incorrect reports of uninitialized memory accesses) when used
with libjpeg-turbo's SIMD extensions. It is generally recommended that the
SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
to `cmake` when configuring the build or by setting the environment variable
`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
MSan, or other memory debuggers.

0 comments on commit 5db6a68

Please sign in to comment.