Subject: bug#64773: closed (Re: bug#64773: grep 3.11 -r on 100000+ files fails with "Operation not supported")

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 21 Jul 2023 23:38:01 +0000

Your bug report

#64773: grep 3.11 -r on 100000+ files fails with "Operation not supported"

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 [email-masked].

-- 
64773: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64773
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#64773: grep 3.11 -r on 100000+ files fails with "Operation not supported"
From: Paul Eggert <[email-masked]>
To: Santiago Ruano Rincón <[email-masked]>, [email-masked], [email-masked], [email-masked]
Date: Fri, 21 Jul 2023 16:37:22 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

To fix just this bug (as opposed to the other Gnulib-related bugs that 
may be lurking) try applying the attached Gnulib patch to a grep 3.11 
tarball.

Closing the debbugs.gnu.org bug report, as the bug has been fixed upstream.

From d4d8abb39eb02c555f062b1f83ffcfac999c582f Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email-masked]>
Date: Fri, 5 May 2023 12:02:49 +0200
Subject: [PATCH] dirfd: Fix bogus override (regression 2023-04-26).

Reported by Bjarni Ingi Gislason <[email-masked]> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00040.html>.

* m4/dirfd.m4 (gl_FUNC_DIRFD): Fix mistake in last change.
---
 ChangeLog   | 7 +++++++
 m4/dirfd.m4 | 6 +-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index aaffe12fc1..5f01a52535 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-05-05  Bruno Haible  <[email-masked]>
+
+	dirfd: Fix bogus override (regression 2023-04-26).
+	Reported by Bjarni Ingi Gislason <[email-masked]> in
+	<https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00040.html>.
+	* m4/dirfd.m4 (gl_FUNC_DIRFD): Fix mistake in last change.
+
 2023-05-04  Bruno Haible  <[email-masked]>
 
 	c32swidth: Add tests.
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index d1ee2c7f61..7968b1287c 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -1,4 +1,4 @@
-# serial 27   -*- Autoconf -*-
+# serial 28   -*- Autoconf -*-
 
 dnl Find out how to get the file descriptor associated with an open DIR*.
 
@@ -40,10 +40,6 @@ AC_DEFUN([gl_FUNC_DIRFD],
     HAVE_DIRFD=0
   else
     HAVE_DIRFD=1
-    dnl Replace only if the system declares dirfd already.
-    if test $ac_cv_have_decl_dirfd = yes; then
-      REPLACE_DIRFD=1
-    fi
     dnl Replace dirfd() on native Windows, to support fdopendir().
     AC_REQUIRE([gl_DIRENT_DIR])
     if test $DIR_HAS_FD_MEMBER = 0; then
-- 
2.39.2

Subject: grep 3.11 -r on 100000+ files fails with "Operation not supported"
From: Santiago Ruano Rincón <[email-masked]>
To: Vincent Lefevre <[email-masked]>, [email-masked], [email-masked]
Date: Fri, 21 Jul 2023 14:10:07 -0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Dear grep developers,

I am forwarding this gnulib bug that affects grep 3.11. Full bug report
can be found at https://bugs.debian.org/1041588

El 21/07/23 a las 10:39, Vincent Lefevre escribió:
> Control: severity -1 grave
> Control: tags -1 - moreinfo
> Control: retitle -1 grep -r on 100000+ files fails with "Operation not supported"
> 
> On 2023-07-20 23:43:45 -0300, Santiago Ruano Rincón wrote:
> > El 21/07/23 a las 04:06, Vincent Lefevre escribió:
> > > On 2023-07-21 03:30:12 +0200, Vincent Lefevre wrote:
> > > > There is a major regression in grep 3.11-1: I now get an error
> > > > 
> > > > cventin:~/Mail> grep -r xxxyyyzzz oldarc
> > > > grep: oldarc/cur: Operation not supported
> > > 
> > > And no such issue with grep from the upstream git.
> > 
> > How are you compiling it?
> 
> $ ./bootstrap
> $ ./configure --prefix=$HOME/opt/grep
> $ make
> $ make install
> 
> > My intuition is this comes from gnulib.
> 
> Yes, as in my next message, I said that the error disappeared
> with the commit that updated gnulib (and did nothing else).

Indeed. Our mails crossed.

> 
> > But a reproducer is needed to confirm.
> > 
> > Tagging with moreinfo, and downgrading the severity since I cannot
> > reproduce it myself:
> [...]
> > Please, feel free to bump the severity back again if you are able to
> > find out a way to reproduce it.
> 
> One needs at least 100000 files in the directory (99999 is not enough).
> With 100000 empty files:
> 
> $ mkdir test-dir && for i in `seq 100000` ; do : > test-dir/$i ; done
> $ grep -r x test-dir
> grep: test-dir: Operation not supported

Thank you, Vincent. I confirm with 99999 files grep works as expected.

Cheers,

 -- Santiago