Description of problem: used-uninitialized bug inhibits utf8-optimization in
Version-Release number of selected component (if applicable): glibc-2.7-2
How reproducible: always
Steps to Reproduce: valgrind -q /usr/bin/ptx
$ valgrind -q /usr/bin/ptx
==15740== Conditional jump or move depends on uninitialised value(s)
==15740== at 0x410C67: (within /usr/bin/ptx)
==15740== by 0x41118A: (within /usr/bin/ptx)
==15740== by 0x401E4F: (within /usr/bin/ptx)
==15740== by 0x40481A: (within /usr/bin/ptx)
==15740== by 0x3C5081E073: (below main) (libc-start.c:220)
$ valgrind ./ptx -S 'a$'
==15467== Conditional jump or move depends on uninitialised value(s)
==15467== at 0x40C800: optimize_utf8 (regcomp.c:1054)
==15467== by 0x40BF7B: re_compile_internal (regcomp.c:807)
==15467== by 0x40AF52: rpl_re_compile_pattern (regcomp.c:236)
==15467== by 0x401B86: compile_regex (ptx.c:419)
==15467== by 0x401C77: initialize_regex (ptx.c:464)
==15467== by 0x405149: main (ptx.c:2160)
Created attachment 274691 [details]
FYI, I went back and did exactly the same things as before, but now, everything
works fine. So I suspect that valgrind was lying (it was rawhide, after all).
Actually, there is a minor code difference, one uses signed comparison, one
unsigned, similarly to e.g.:
unsigned int x;
void foo (void)
with -O2 vs. -O2 -Dunsigned=
That doesn't make any difference though, the comparison is there only to divide
the range for positive matches into two halves.
Anyway, Uli checked the change in and it will be in glibc-2.7.90-1.