Skip to content

Commit

Permalink
valgrind: ignore SSE-based strlen invalid reads
Browse files Browse the repository at this point in the history
Some versions of strlen use SSE to speed up the calculation and load 4
bytes at a time, even if it means reading past the end of the
allocated memory. This read is safe and when the strlen function is
inlined, it is not replaced by valgrind, which reports a
false-possitive.

Tell valgrind to ignore this particular error, as the read is, in
fact, safe. Current upstream-released version 3.6.1 is affected. Some
distributions have this fixed in their latest versions.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Carlos Martín Nieto authored and Junio C Hamano committed Mar 16, 2011
1 parent 808a95d commit b406a2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions t/valgrind/default.supp
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@
fun:write_buffer
fun:write_loose_object
}

{
ignore-sse-strlen-invalid-read-size
Memcheck:Addr4
fun:copy_ref
}

0 comments on commit b406a2d

Please sign in to comment.