NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

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



The following reply was made to PR bin/60552; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
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, ci4ic4%gmail.com@localhost 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:
 
 ```
 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
 



Home | Main Index | Thread Index | Old Index