This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Possible globbing error in bash 2.04.7(2)?


Has anyone else been experiencing problems with how Cygwin's bash
handles command lines?  I'm seeing two intermittant problems:

1) After a command is entered, bash will block until ^C is pressed,
   at which point a Windows error dialog will pop up (I can't get the
   error to occur right now, dammit, or I'd include more details)

2) Commands will segfault and dump core if the command line is long

I'm not sure the problems are related; I saw some references to "bash
pausing" in the mailing list archives, but the posts were for an old
release and Chris Faylor indicated that the bug causing them had been
fixed.

Unfortunately, the problems seem to be intermittant, but I have
developed a test script which will demonstrate problem 2 on my
system:

#!/bin/bash

declare -i a=0

while [ $a -lt 1000 ]; do
  let a=$a+1
  echo > tt/$a
  if ls tt/* > /dev/null
  then
    echo $a OK
  else
    echo $a Failed
  fi
done

The output of this script looks like

1 OK
2 OK
3 OK
4 OK
5 OK

until ...

509 OK
510 OK
511 Failed
512 OK
513 OK

The failures become more frequent from then on.  I aborted the script
when i = 836; up to that point, I had experienced 45 failures.  At the
times when the failures were really frequent, there appeared to be a
pattern in which alternate attempts failed, but this was not always true.

I believe the problem lies with the way in which bash globs the
command line, because 'ls *' fails when 'ls' succeeds:

tmp 563 $ cd tt<cr>
tt 564 $ ls<cr>
(... file listing displayed ...)
tt 565 $ ls *
  63930 [main] bash 297 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
  65716 [main] bash 297 stackdump: Dumping stack trace to ls.exe.stackdump
Segmentation fault (core dumped)
tt 566 $

I've attached files which might be helpful (all gzipped):

ls-test.gz               My test script
ls-test.output.gz        The full output of my test script
ls.exe.stackdump.gz      The stack dump from the above 'ls *' command
cygcheck.output.gz       Output of 'cygcheck -s -v -r'

I can also send the output of an 'strace ls tt/*' that failed to
anyone who is interested, but it's too big (even gzipped) to send
to the mailing list.

On my system, 'bash --version' reports

GNU bash, version 2.04.7(2)-release (i686-pc-cygwin)
Copyright 1999 Free Software Foundation, Inc.

and 'uname -a' reports

CYGWIN_NT-4.0 ZUUL 1.3.0s(0.36/3/2) 2001-03-16 23:55 i686 unknown

My CYGWIN environment variable contains only 'binmode'.

Thanks in advance for any help anyone can offer.

-Brian Kasper
 kasper@aero.org

(See attached file: cygcheck.output.gz)(See attached file:
ls.exe.stackdump.gz)(See attached file: ls-test.gz)(See attached file:
ls-test.output.gz)

cygcheck.output.gz

ls.exe.stackdump.gz

ls-test.gz

ls-test.output.gz

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]