git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] valgrind: ignore SSE-based strlen invalid reads
@ 2011-03-16  9:31 Carlos Martín Nieto
  2011-03-16  9:56 ` Jonathan Nieder
  0 siblings, 1 reply; 11+ messages in thread
From: Carlos Martín Nieto @ 2011-03-16  9:31 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

The C library uses SSE instructions to make strlen (among others)
faster, loading 4 bytes at a time and reading past the end of the
allocated memory. This read is safe and when the strlen function is
inlined, it is (obviously) not replaced by valgrind, which reports a
false-possitive.

Tell valgrind to ignore this particular error, as the read is, in
fact, safe.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---
 t/valgrind/default.supp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/t/valgrind/default.supp b/t/valgrind/default.supp
index 9e013fa..327478c 100644
--- a/t/valgrind/default.supp
+++ b/t/valgrind/default.supp
@@ -43,3 +43,9 @@
 	fun:write_buffer
 	fun:write_loose_object
 }
+
+{
+	ignore-sse-strlen-invalid-read-size
+	Memcheck:Addr4
+	fun:copy_ref
+}
\ No newline at end of file
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-03-16 22:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-16  9:31 [PATCH] valgrind: ignore SSE-based strlen invalid reads Carlos Martín Nieto
2011-03-16  9:56 ` Jonathan Nieder
2011-03-16 10:41   ` Carlos Martín Nieto
2011-03-16 10:47   ` Carlos Martín Nieto
2011-03-16 10:52     ` Jonathan Nieder
2011-03-16 11:10       ` Carlos Martín Nieto
2011-03-16 11:25         ` Jonathan Nieder
2011-03-16 11:46           ` Carlos Martín Nieto
2011-03-16 20:18             ` Junio C Hamano
2011-03-16 20:44               ` Carlos Martín Nieto
2011-03-16 22:43         ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).