git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] valgrind: ignore SSE-based strlen invalid reads

From
Carlos Martín Nieto <cmn@elego.de>
Date
Mar 16, 2011, 11:46 UTC
Message-ID
<1300275961-5798-1-git-send-email-cmn@elego.de>
In-Reply-To
<20110316112547.GA15739@elie>

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 2.6.1 is affected. Some distributions have this fixed in their latest versions.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---
Show 5 quoted lines
>>  I think 3.6.1 doesn't need it, as Debian's 1:3.5.0+3.6.0svn20100609-1
>> version is reportedly fixed.
>
>Ah, nice.  A phrase like "some versions of valgrind before 3.6.1"
>would be fine with me fwiw. :)

I just downloaded and compiled the upstream release 2.6.1 and it's still affected (it does fix some other related false-positives). Fedorea rawhide has the fix in, according to their bug tracker. I haven't tested the reportedly-fixed version in Debian yet.

 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
Previous: Jonathan NiederNext: Junio C Hamano
Message 8 of 11 in “valgrind: ignore SSE-based strlen invalid reads”
  1. valgrind: ignore SSE-based strlen invalid readsCarlos Martín Nieto, Mar 16, 2011
  2. Jonathan NiederMar 16, 2011
  3. Carlos Martín NietoMar 16, 2011
  4. valgrind: ignore SSE-based strlen invalid readsCarlos Martín Nieto, Mar 16, 2011
  5. Jonathan NiederMar 16, 2011
  6. Carlos Martín NietoMar 16, 2011
  7. Jonathan NiederMar 16, 2011
  8. valgrind: ignore SSE-based strlen invalid readsCarlos Martín Nieto, Mar 16, 2011
  9. Junio C HamanoMar 16, 2011
  10. Carlos Martín NietoMar 16, 2011
  11. Andreas SchwabMar 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.