Thread (16 messages) flat view 16 messages, 8 authors, 2016-06-15

Re: git-diff-tree rename detection bug

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:06

Possibly related (same subject, not in this thread)

Paul Mackerras [off-list ref] writes:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help