[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this a bug?

From: George R Goffe
Subject: Re: Is this a bug?
Date: Tue, 18 Aug 2020 21:14:38 +0000 (UTC)


Please accept my apology for not responding to your email sooner.

I have the bash source from the(?) repository. I followed Dimitris suggestion 
and found bash hung in a system call named "pselect". I did a grep on the 
source and found the only two ".c" files using "pselect":

Does this help?

Best regards and thanks for your patience.


lib/readline/input.c:#if defined (HAVE_PSELECT)
lib/readline/input.c:#if defined (HAVE_PSELECT)
lib/readline/input.c:#if defined (HAVE_PSELECT)
lib/readline/input.c:      result = pselect (fileno (stream) + 1, &readfds, 
NULL, NULL, NULL, &_rl_orig_sigset);
lib/readline/input.c:      result = pselect (fileno (stream) + 1, &readfds, 
NULL, NULL, NULL, &empty_set);
lib/sh/ufuncs.c:#if defined (HAVE_TIMEVAL) && (defined (HAVE_SELECT) || defined 
lib/sh/ufuncs.c:#if defined (HAVE_PSELECT)
lib/sh/ufuncs.c:#if defined (HAVE_PSELECT)
lib/sh/ufuncs.c:#endif /* !HAVE_PSELECT */
lib/sh/ufuncs.c:#if defined (HAVE_PSELECT)
lib/sh/ufuncs.c:      r = pselect(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, 
&ts, &blocked_sigs);Chet,

On Thursday, August 6, 2020, 1:10:42 PM PDT, Chet Ramey <chet.ramey@case.edu> 

On 8/6/20 1:53 PM, George R Goffe wrote:
> Hi,
> I apologize for bothering you with this question.
> I have several directories on a system with > 300k files. When I use filename 
> completion bash freezes for over a minute depending on the number of files. 
> I'm pretty sure that bash has to read the directory to do the completion but 
> the read appears to be uninterruptible. Is this a bug?

Can you tell what system call bash is executing? Some file systems make
the system call underlying readdir() uninterruptible.

In general, the readline filename completion function that calls readdir
only reads a single directory entry at a time, and returns it to a caller.
If the SIGINT causes readdir to return NULL, the function returns normally.
If readdir returns a valid entry, the caller (e.g., rl_completion_matches)
checks for receipt of a signal. That should be enough to terminate the
directory read.

> Again, I apologize for bothering you with this.

No bother.


``The lyf so short, the craft so long to lerne.'' - Chaucer
        ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]