Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: From: "Willis, Matthew" To: "'cygwin AT cygwin DOT com'" Subject: 1.3.13 bug with arguments for "ls *" etc. where * is >900 chars Date: Thu, 7 Nov 2002 09:57:26 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" I reported a strange hang with nt4 yesterday and have more information on how to replicate. Basically, long command line globs seem to cause the system to get locked up at 100%. The following can replicate mkdir tmp; cd tmp for k in 0 1 2 3 4 5 6 7 8 9 a b c d e f do for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f do touch $j.$k done done Now, when I do ls * - this hangs (ctrl-c to get out) ls [0-9a-f].[0-9a-f] - this hangs too ls [0-9a-e].[0-9a-e] - but this works fine It appears related to the absolute length of the arguments rather than the number of them (above, 225). If I change the inner loop to "touch foo_$j.$k" then experiment, ls foo_* - this hangs (256 files) ls foo_[0-9].[0-9a-b] - this hangs (120 files) ls foo_[0-9].[0-9a] - this works fine (110 files) It appears that if the arg list is over something like 900 bytes (incl spaces, e.g. echo [0-9a-e].[0-9a-e] | wc), the program gets confused, which is consistent with the prior experiment. I created a small stub program to test if it was something special about "ls". #include #include using namespace std; int main(int argc, char * argv[]) { for (int i=0;i