Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFS='*' freezes bash #52

Closed
imgx64 opened this issue Jul 1, 2016 · 5 comments
Closed

IFS='*' freezes bash #52

imgx64 opened this issue Jul 1, 2016 · 5 comments

Comments

@imgx64
Copy link

imgx64 commented Jul 1, 2016

If you set IFS='*' then try tab completion, bash freezes and uses 100% CPU. The only way to stop it is kill -9.

I'm using Fedora 24 and bash-completion 2.3.

@scop
Copy link
Owner

scop commented Jul 2, 2016

Reproduced, but I'm not sure why you'd do that?

@imgx64
Copy link
Author

imgx64 commented Jul 2, 2016

To be honest, no reason at all. I was just thinking of ways to break my own scripts (and making them fool-proof in the process), and ended up with a frozen shell..

But I can think of a hypothetical reason, splitting a *-delimited string:

$ foo='a*b*c'
$ set -f
$ IFS='*'
$ bar=($foo)
$ declare -p bar
declare -a bar='([0]="a" [1]="b" [2]="c")'

@imgx64
Copy link
Author

imgx64 commented Jul 2, 2016

This seems to be a bug in bash ( https://lists.gnu.org/archive/html/bug-bash/2016-07/msg00004.html ), but I think bash-completion could at least print an error instead of looping infinitely. The long-term solution would be implementing cleanly controllable completion environment.

@scop
Copy link
Owner

scop commented Jul 3, 2016

If someone wants to submit a clean, minimal patch that works around this, I can have a look, but honestly I'm not too keen on spending much time at all for such a corner case especially if it's caused by a bash bug.

@imgx64
Copy link
Author

imgx64 commented Sep 16, 2021

This was fixed in Bash. Closing.

@imgx64 imgx64 closed this as completed Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants