Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 407301 - Fix a bug that inhibited utf8-optimization in regcomp.c.
Fix a bug that inhibited utf8-optimization in regcomp.c.
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-12-01 09:56 EST by Jim Meyering
Modified: 2016-11-24 11:05 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-12-12 15:08:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
s/idx/ctx_type/ (800 bytes, patch)
2007-12-01 09:56 EST, Jim Meyering
no flags Details | Diff

  None (edit)
Description Jim Meyering 2007-12-01 09:56:15 EST
Description of problem: used-uninitialized bug inhibits utf8-optimization in
regex-compilation code

Version-Release number of selected component (if applicable): glibc-2.7-2

How reproducible: always

Steps to Reproduce: valgrind -q /usr/bin/ptx
Actual results:
    $ 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)

Expected results:

no error

Additional info:
Comment 1 Jim Meyering 2007-12-01 09:56:15 EST
Created attachment 274691 [details]
Comment 2 Jim Meyering 2007-12-12 14:53:32 EST
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).
Comment 3 Jakub Jelinek 2007-12-12 15:08:33 EST
Actually, there is a minor code difference, one uses signed comparison, one
unsigned, similarly to e.g.:
unsigned int x;
void foo (void)
  switch (x)
    case 16:
      foo1 ();
    case 32:
      foo2 ();
    case 64:
      foo3 ();
    case 128:
      foo4 ();
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.

Note You need to log in before you can comment on or make changes to this bug.