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

Re: [PATCH] cache-tree: reject entries with null sha1

From
René Scharfe <l.s.r@web.de>
Date
May 1, 2017, 11:23 UTC
Message-ID
<12c3312c-30a1-2cb1-8f05-63bb663bd0a0@web.de>
In-Reply-To
<CACsJy8AAtV5KJHBqWvnYb3Mw9CVzEdG3M-UJA+jd5MR5e-UMsA@mail.gmail.com>
Am 24.04.2017 um 12:39 schrieb Duy Nguyen:
Show 17 quoted lines
> BTW, I ran t7009 with valgrind and it reported this. Is it something
> we should be worried about? I vaguely recall you're doing something
> with prio-queue...
> 
> ==4246== Source and destination overlap in memcpy(0x5952990, 0x5952990, 16)
> ==4246==    at 0x4C2EACD: memcpy@@GLIBC_2.14 (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==4246==    by 0x545D05: swap (prio-queue.c:15)
> ==4246==    by 0x545D72: prio_queue_reverse (prio-queue.c:25)
> ==4246==    by 0x4CBC0C: sort_in_topological_order (commit.c:723)
> ==4246==    by 0x574C97: prepare_revision_walk (revision.c:2858)
> ==4246==    by 0x48A2BA: cmd_rev_list (rev-list.c:385)
> ==4246==    by 0x405A6F: run_builtin (git.c:371)
> ==4246==    by 0x405CDC: handle_builtin (git.c:572)
> ==4246==    by 0x405E51: run_argv (git.c:624)
> ==4246==    by 0x405FF3: cmd_main (git.c:701)
> ==4246==    by 0x4A48CE: main (common-main.c:43)

I can only get gcc and clang to call memcpy instead of inlining it by specifying -fno-builtin. Do you use that option? If yes, why? (Just curious.)

But I can't get Valgrind to report overlapping (nicely explained in http://valgrind.org/docs/manual/mc-manual.html#mc-manual.overlap, by the way), not for t7009 and not for the short test program at the bottom. Do you set flags in GIT_VALGRIND_OPTIONS or use a special version of Valgrind? I use valgrind-3.12.0.SVN from Debian testing.

Thanks, René

/* Compile with -fno-builtin. */ #include <string.h> int main(void) {int i = 1; memcpy(&i, &i, sizeof(i)); return i;}

Previous: Jeff KingNext: René Scharfe
Message 4 of 10 in “cache-tree: reject entries with null sha1”
  1. cache-tree: reject entries with null sha1Jeff King, Apr 21, 2017
  2. Duy NguyenApr 24, 2017
  3. Jeff KingApr 24, 2017
  4. René ScharfeMay 1, 2017
  5. René ScharfeMay 1, 2017
  6. Jeff KingMay 1, 2017
  7. René ScharfeMay 1, 2017
  8. Jeff KingMay 1, 2017
  9. Duy NguyenMay 3, 2017
  10. René ScharfeMay 3, 2017

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.