Re: bin/60552: /usr/bin/grep failure under AMD64
Chavdar Ivanov <[email protected]>
| Newsgroups | gmane.os.netbsd.bugs |
|---|---|
| Message-ID | <CAG0OUxhTeMR-wwdOJzgdLSw6EWtD9FmdROJL9Ok3RMZ2KrMnVg@mail.gmail.com> |
On Fri, 7 Aug 2026 at 14:25, RVP via gnats <[email protected]> wrote: > > The following reply was made to PR bin/60552; it has been noted by GNATS. > > From: RVP <[email protected]> > To: [email protected] > Cc: > Subject: Re: bin/60552: /usr/bin/grep failure under AMD64 > Date: Fri, 7 Aug 2026 13:21:39 +0000 (UTC) > > On Fri, 7 Aug 2026, [email protected] via gnats wrote: > > > '/usr/bin/grep -i' dumps core going through a file containing UTF16 characters, apparently when one has both -i and --color=auto specified. > > > > Observed on NetBSD-current from the end of June and on NetBSD-11 Release, only AMD64. > > > > The failure does not occur on NetBSD-current AARCH64. > > > > That's the clue: Correct, thanks. Tested. > > ``` > diff -urN src/external/gpl2/grep.orig/dist/src/grep.c src/external/gpl2/grep/dist/src/grep.c > --- src/external/gpl2/grep.orig/dist/src/grep.c 2022-09-09 22:14:29.000000000 +0000 > +++ src/external/gpl2/grep/dist/src/grep.c 2026-08-07 13:13:39.605001274 +0000 > @@ -582,7 +582,7 @@ > char *ilim = ibeg + (lim - beg); > int i; > for (i = 0; i < lim - beg; i++) > - ibeg[i] = tolower (beg[i]); > + ibeg[i] = tolower ((unsigned char)beg[i]); > while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1)) > != (size_t) -1) > { > ``` > > -RVP > -- ----