GNU bug report logs - #17506
[PATCH] grep: port mb_next_wc to RHEL 6.5 x86-64

Previous Next

Package: grep;

Reported by: Paul Eggert <eggert <at> CS.UCLA.EDU>

Date: Fri, 16 May 2014 01:49:01 UTC

Severity: normal

Tags: easy, fixed, patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17506 in the body.
You can then email your comments to 17506 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#17506; Package grep. (Fri, 16 May 2014 01:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> CS.UCLA.EDU>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Fri, 16 May 2014 01:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> CS.UCLA.EDU>
To: bug-grep <at> gnu.org
Subject: [PATCH] grep: port mb_next_wc to RHEL 6.5 x86-64
Date: Thu, 15 May 2014 18:46:51 -0700
* src/searchutils.c (mb_next_wc): Work around glibc bug 16950; see:
https://sourceware.org/bugzilla/show_bug.cgi?id=16950
This bug was masked in the other GNU/Linux tests I made.  It was
exposed on RHEL 6.5 x86-64, where the compiler (GCC Red Hat 4.4.7-4)
happened to use temporaries in a different way.
Also see recent changes to the Gnulib documentation in this area:
http://lists.gnu.org/archive/html/bug-gnulib/2014-05/msg00013.html
---
 src/searchutils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/searchutils.c b/src/searchutils.c
index 5eb9a12..18dd584 100644
--- a/src/searchutils.c
+++ b/src/searchutils.c
@@ -285,5 +285,6 @@ mb_next_wc (char const *cur, char const *end)
 {
   wchar_t wc;
   mbstate_t mbs = { 0 };
-  return mbrtowc (&wc, cur, end - cur, &mbs) < (size_t) -2 ? wc : WEOF;
+  return (end - cur != 0 && mbrtowc (&wc, cur, end - cur, &mbs) < (size_t) -2
+          ? wc : WEOF);
 }
-- 
1.9.0





bug closed, send any further explanations to 17506 <at> debbugs.gnu.org and Paul Eggert <eggert <at> CS.UCLA.EDU> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Fri, 16 May 2014 01:51:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-grep <at> gnu.org:
bug#17506; Package grep. (Sat, 17 May 2014 06:09:02 GMT) Full text and rfc822 format available.

Message #10 received at 17506 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 17506 <at> debbugs.gnu.org
Subject: Re: [PATCH] grep: port mb_next_wc to RHEL 6.5 x86-64
Date: Fri, 16 May 2014 23:08:29 -0700
By the way, I verified that this patch is not needed if grep updates to 
the latest version of gnulib, because of this gnulib fix:

http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=2a045bc38f853c02f682c710b8d69bd465719b26

So, after grep syncs to the latest gnulib, this patch should be reverted.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 May 2014 06:12:01 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 17 May 2014 06:12:01 GMT) Full text and rfc822 format available.

Added tag(s) easy and fixed. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 17 May 2014 06:12:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-grep <at> gnu.org:
bug#17506; Package grep. (Sat, 24 May 2014 03:24:02 GMT) Full text and rfc822 format available.

Message #19 received at 17506 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 17506 <at> debbugs.gnu.org
Subject: Re: bug#17506: [PATCH] grep: port mb_next_wc to RHEL 6.5 x86-64
Date: Fri, 23 May 2014 20:23:14 -0700
[Message part 1 (text/plain, inline)]
On Fri, May 16, 2014 at 11:08 PM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> By the way, I verified that this patch is not needed if grep updates to the
> latest version of gnulib, because of this gnulib fix:
>
> http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=2a045bc38f853c02f682c710b8d69bd465719b26
>
> So, after grep syncs to the latest gnulib, this patch should be reverted.

Thanks.  I've done that.  First, update to latest gnulib, then revert
the now-unnecessary commit:
[0001-gnulib-update-for-mbrlen-mbrtowc-empty-input-bug-fix.patch (application/octet-stream, attachment)]
[0002-maint-revert-grep-port-mb_next_wc-to-RHEL-6.5-x86-64.patch (application/octet-stream, attachment)]

bug closed, send any further explanations to 17506 <at> debbugs.gnu.org and Paul Eggert <eggert <at> CS.UCLA.EDU> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 24 May 2014 04:35:03 GMT) Full text and rfc822 format available.

Severity set to 'normal' from 'minor' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 24 May 2014 21:16:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 22 Jun 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.