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

Re: git-diff-tree rename detection bug

From
Junio C Hamano <junkio@cox.net>
Date
Sep 15, 2005, 08:17 UTC
Message-ID
<7vll1y9243.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<17192.65054.520959.454610@cargo.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> writes:
Show 6 quoted lines
> The strlen() in glibc for ppc is unbearably clever hand-coded
> assembly, which loads up 8 bytes at a time (once it has the address
> 8-byte aligned), and does various ANDs and ORs and ADDs and
> conditional branches.  If some of the 8 bytes aren't defined, it will
> in many cases branch one way or the other based on the undefined
> bytes, but end up computing the same result on either branch.

This reminds me of what I did in my previous life, writing a memory allocation checker -- this was before Valgrind -- and found out that strcpy in the C library that came with Solaris had a similar clever trick. What was interesting was that copying a string starting at the (PAGESIZE-3)th byte on a page and NUL terminated at the end of the same page ended up prefetching the first word from the next page (please do not ask me about the details -- I do not remember the disassembly of that part of the code anymore). It was not an inconvenience for our memory checker but was a real bug -- the next page could very well be unaccessible.

The bug was fixed in the next version of the C library when we updated our Solaris box.

Previous: Paul MackerrasNext: Josef Weidendorfer
Message 10 of 23 in “git-diff-tree rename detection bug”
  1. Wayne ScottSep 14, 2005
  2. Junio C HamanoSep 14, 2005
  3. Wayne ScottSep 14, 2005
  4. Linus TorvaldsSep 14, 2005
  5. Fix alloc_filespec() initializationLinus Torvalds, Sep 14, 2005
  6. Paul MackerrasSep 15, 2005
  7. Paul MackerrasSep 15, 2005
  8. Linus TorvaldsSep 15, 2005
  9. Paul MackerrasSep 15, 2005
  10. Junio C HamanoSep 15, 2005
  11. Josef WeidendorferSep 15, 2005
  12. Paul MackerrasSep 20, 2005
  13. Linus TorvaldsSep 15, 2005
  14. Junio C HamanoSep 16, 2005
  15. H. Peter AnvinSep 15, 2005
  16. Junio C HamanoSep 15, 2005
  17. Linus TorvaldsSep 15, 2005
  18. Matthias UrlichsSep 16, 2005
  19. Nicolas PitreSep 15, 2005
  20. Junio C HamanoSep 14, 2005
  21. Junio C HamanoSep 14, 2005
  22. Linus TorvaldsSep 14, 2005
  23. Junio C HamanoSep 14, 2005

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.