Skip to contentSkip to conversation

current state of sid (unstable)

DISCUSSION Michael Cree 1 participant 2 messages Sep 20, 2010 – Sep 27, 2010 2 messages not in the archive Alpha port

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 7 lines · Michael Cree
Quoted 3 lines · Bob Tracy

(5) Some long-standing compiler and libc issues have been fixed upstream and in Debian, but recently, a build of libc in Debian Unstable failed.

I see the memchr seg fault bug (521737) is still open. I have a hunch that it may be a false-positive,

Darn, it's a true-positive.

Quoted 4 lines

It's a standard ldq_u for loading a byte within a
quadword that is failing. If the correct quadword is being loaded then that shouldn't trip a seg fault no matter what byte in it is being loaded, even if the byte is pass the end of the string, right?

If there are fewer than eight bytes to search it loads a quadword (via ldq_u) encompassing the address one byte before the start address plus the length to search. If the start address is quadword aligned then that will always be safe, but it appears to me that the author forgot about the possibility that the start address may not be quadword aligned, and then adding on the length-1 may step across the next quadword boundary, and whoops, we've gone past the valid end of buffer.

The problem is in both the Alpha generic and the Alpha ev6 code for memchr in libc.

Ohh, the kernel code (arch/alpha/lib/memchr.S) has the same problem!

Cheers
Michael.

#3 lore raw
Quoted 10 lines · Michael Cree
Quoted 7 lines · Michael Cree
Quoted 3 lines · Bob Tracy

(5) Some long-standing compiler and libc issues have been fixed upstream and in Debian, but recently, a build of libc in Debian Unstable failed.

I see the memchr seg fault bug (521737) is still open. I have a hunch that it may be a false-positive,

Darn, it's a true-positive.

A new version of memchr is now upstream in the glibc ports repository (many thanks to RTH). In addition to fixing the seg fault it is more than twice as fast as the old version when searching through large memory buffers.

Cheers
Michael.