GNU bug report logs - #71470
test failure on CentOS 7

Previous Next

Package: grep;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Mon, 10 Jun 2024 12:33:03 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Bruno Haible <bruno <at> clisp.org>
Subject: bug#71470: closed (Re: bug#71470: test failure on CentOS 7)
Date: Tue, 11 Jun 2024 16:04:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#71470: test failure on CentOS 7

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 71470 <at> debbugs.gnu.org.

-- 
71470: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71470
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 71470-done <at> debbugs.gnu.org
Subject: Re: bug#71470: test failure on CentOS 7
Date: Tue, 11 Jun 2024 09:03:37 -0700
Thanks for the report and fixes. Close call, but since CentOS 7 is still 
officially alive I installed the 2nd patch. (A plus is that 'configure' 
is a bit faster....)

[Message part 3 (message/rfc822, inline)]
From: Bruno Haible <bruno <at> clisp.org>
To: bug-grep <at> gnu.org
Subject: test failure on CentOS 7
Date: Mon, 10 Jun 2024 13:56:07 +0200
[Message part 4 (text/plain, inline)]
Building the current grep (git master) with the current Gnulib, I see a test
failure on CentOS 7:


FAIL: test-mbrlen-1.sh
======================

../../gnulib-tests/test-mbrlen.c:47: assertion 'ret == (size_t)(-2)' failed
../../gnulib-tests/test-mbrlen-1.sh: line 5: 31796 Aborted                 (core dumped) LC_ALL=C ${CHECKER} ./test-mbrlen${EXEEXT} 1
FAIL test-mbrlen-1.sh (exit status: 1)


The background is that mbrlen, on glibc systems <= 2.19, has a bug [1]:
This function returns 0 instead of @code{(size_t) -2} when the input
is empty.
This affects old distros:
  - CentOS 7 (glibc 2.17),
  - Slackware 14 (glibc 2.15),
  - openSUSE 12.1 (glibc 2.14.1),
  - etc.

mbrtowc has the same bug.

Gnulib has workarounds against this bug both in mbrlen and mbrtowc.

But grep deactivates the workaround for mbrtowc, in order not to
slow down 'grep' [2]. When this commit was created, Gnulib had a
mbrtowc-tests module. Now, since 2023-03-30, it also has an mbrlen-tests
module, and it is not deactivated. It fails because
  - mbrlen.m4 detects that mbrlen has the bug.
  - So it activates the replacement REPLACE_MBRLEN=1.
  - The replacement invokes mbrtowc.
  - But mbrtowc is not fixed, due to [2].

I see two reasonable fixes:

a) Remove the special optimization for CentOS 7. This distro will become
unsupported in less than a month [3], therefore it is no longer necessary
to carry complexity to optimize it.
-> patch 0001-maint-Remove-special-optimization-for-CentOS-7.patch

b) Extend the special optimization also to the mbrlen function and tests.
-> 0001-maint-Avoid-test-mbrlen-1.sh-failure-on-CentOS-7.patch

For each of the fixes, find a proposed patch (untested) attached.

Bruno

[1] https://www.gnu.org/software/gnulib/manual/html_node/mbrlen.html
[2] https://git.savannah.gnu.org/gitweb/?p=grep.git;a=commitdiff;h=6e319a818ed7b15b452ed2baab2f6a38d42fd1fe
[3] https://git.savannah.gnu.org/gitweb/?p=gnulib/maint-tools.git;a=blob;f=end-of-life.txt;h=5b7ff5559f3ddc9ea753f7837c35e8efbe0a8100;hb=HEAD
[0001-maint-Remove-special-optimization-for-CentOS-7.patch (text/x-patch, attachment)]
[0001-maint-Avoid-test-mbrlen-1.sh-failure-on-CentOS-7.patch (text/x-patch, attachment)]

This bug report was last modified 335 days ago.

Previous Next


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