[64-bit] egrep core dumps when it opens binary files

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Aug 12 12:49:00 GMT 2013

On Aug 11 15:07, Jim Burwell wrote:
> 64 bit egrep gets a segfault and dumps core when it opens binary files:

Confirmed.  This isn't exactly about binary files, but rather grep
stumbles over Cygwin/Newlib's UTF-16 surrogate pair handling here.

To trigger this problem, three circumstances must conincide:

- you have to use a UTF-8 locale like en_US.UTF-8,
- you have to use grep's -i option,
- and you have to hit a file with a UTF-8 sequence which translates to
  a surrogate.

I'm looking into a patch to handle this uncommon situation and try to
send it upstream.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130812/d040cae4/attachment.sig>

More information about the Cygwin mailing list