Bug#635885: libc6: strchr() behavior changed
Hi Michal,
Michal Kiedrowicz wrote:
> static const char s[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0};
[...]
> When running this application on Debian with libc6 2.7-18lenny2 and on my
> Gentoo machine I get:
>
> $ ./test_strchr
> strchr(228 [-28]) = [0]
[...]
> When running it on Debian with libc6 2.11.2-10:
>
> strchr(228 [-28]) = [255]
This sounded to me like PR12159, which was fixed by glibc-2.13~64 (Fix
x86-64 strchr propagation of search byte into all bytes of SSE
register, 2010-10-25), but I am not able to reproduce it. I get all
[0] values (pointers to the end of string), the correct behavior.
I tried to reproduce first using strchr.S directly on Debian sid, then
using plain libc6 in a squeeze Debian live system running through kvm.
I compiled with -O0 so I don't think gcc optimized out the strchr
calls. Any idea what I'm doing wrong? What machine architecture do
you use?
Reply to: