Re: bin/60552: /usr/bin/grep failure under AMD64

"Chavdar Ivanov via gnats" <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
The following reply was made to PR bin/60552; it has been noted by GNATS.

From: Chavdar Ivanov <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: bin/60552: /usr/bin/grep failure under AMD64
Date: Fri, 7 Aug 2026 14:37:35 +0100

 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
 >
 
 
 -- 
 ----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.