On Jul 25 2021, Greg Wooledge wrote: > On Sun, Jul 25, 2021 at 07:09:50PM +0200, andrej--- via Bug reports for the > GNU Bourne Again SHell wrote: >> Description: >> An extglob like +(!(x))y causes Bash to freeze with a 100% CPU >> utilization. >> At the first glance the freeze doesn't seem to depend on the >> (non-)existence of matching paths. > > The files do seem to matter. > > unicorn:~/tmp$ echo +(!(x))y > servers-to-try > unicorn:~/tmp$ cd /tmp > unicorn:/tmp$ echo +(!(x))y > ^C^C^ZKilled
It depends on the length of the existing file names. That pattern has quadratic complexity. > It's a really bad runaway, requiring SIGKILL from another terminal to > stop it. Not really. It's just that an interactive shell ignores or postpones a lot of signals during command execution. In a non-interactive shell, a simple SIGINT will stop it. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."