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

"[email protected] via gnats" <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
>Number:         60552
>Category:       bin
>Synopsis:       /usr/bin/grep failure under AMD64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 07 12:35:00 +0000 2026
>Originator:     Chavdar Ivanov
>Release:        NetBSD 11 Release
>Organization:
CI4 Consulting Ltd
>Environment:
uname -a
NetBSD netbsd11.lorien.lan 11.0 NetBSD 11.0 (GENERIC) #0: Thu Jul 30 15:23:12 UTC 2026  [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
'/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.

Initial trace:

#0  0x0000000000e5b468 in prline ()
(gdb) bt
#0  0x0000000000e5b468 in prline ()
#1  0x0000000000e5b8cb in grepbuf ()
#2  0x0000000000e5b988 in grepbuf ()
#3  0x0000000000e5bfff in grepfile ()
#4  0x0000000000e71985 in main ()
>How-To-Repeat:
netbsd11$ echo $LS_COLORS $LSCOLORS

netbsd11$ cat file-with-utf16
Test='&#8721;'
netbsd11$ /usr/bin/grep  -i est file-with-utf16
Test='&#8721;'
netbsd11$ /usr/bin/grep --color=auto   est file-with-utf16
Test='&#8721;'
netbsd11$ /usr/bin/grep --color=auto  -i est file-with-utf16
[1]   Segmentation fault (core dumped) /usr/bin/grep --color=auto -i est file-with-utf16
>Fix:
N/A
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.