Summary: | =app-shells/bash-completion to 2.1-r1 - Causes ‘bash’ to loop on startup (^C cancels execution of that script) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Tom Wijsman (TomWij) (RETIRED) <tomwij> |
Component: | Current packages | Assignee: | Gentoo Shell Tools project <shell-tools> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | alexander, gentoo, Martin.vGagern |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
An excerpt of `strace -f -p PID`. Compressed because it grows huge despite only running for about a second.
/etc/bash_completion.d/bash_completion New output of strace -f |
Description
Tom Wijsman (TomWij) (RETIRED)
2013-08-27 22:19:08 UTC
Can you provide steps for reproducing? I'm afraid this bug won't get otherwise attention, since I have no idea howto proceed with information of "it doesn't work" when it does here. Nothing special was done, he has upgraded and it broke the next time he opened up bash. He did do dispatch-conf / etc-update which didn't show the file as he has never modified it; so, he is using the right file that came with the last bash. He will try to upgrade from the downgraded version again later. He also still has a copy around of the file he obtained after the upgrade, will attach later. Any other debugging steps that could be taken to reproduce this or gain info? (In reply to Tom Wijsman (TomWij) from comment #2) > Any other debugging steps that could be taken to [...] gain info? Use "pstree -p" to see what processes were spawned by that shell. Use "strace -f -p" to see what syscall activity there is for these. Use "gdb -p" to attach a debugger to it. rebukd with debug symbols as needed. Created attachment 357486 [details]
An excerpt of `strace -f -p PID`. Compressed because it grows huge despite only running for about a second.
Created attachment 357488 [details]
/etc/bash_completion.d/bash_completion
It seems to be looking at /etc/bash_completion.d/bash_completion (I assume this is a script), then /etc/init.d/* (expansion) and then `ls /etc/bash_completion.d` (an actual call); after all that, it just repeats those steps. So, either something in bash itself or in /etc/bash_completion.d/bash_completion is looping here; as there is a mention of init.d, I assume that this happens in the script. This code runs over /etc/bash_completion.d and sources the files: for i in $(LC_ALL=C command ls "$BASH_COMPLETION_COMPAT_DIR"); do i=$BASH_COMPLETION_COMPAT_DIR/$i [[ ${i##*/} != @($_backup_glob|Makefile*|$_blacklist_glob) \ && -f $i && -r $i ]] && . "$i" done Now, because /etc/bash_completion.d/bash_completion is in /etc/bash_completion.d it will source itself over and over again; so, it will keep doing the steps I described above. (In reply to gentoo from comment #5) > Created attachment 357488 [details] > /etc/bash_completion.d/bash_completion I don't have this file O_o `equery b /etc/bash_completion.d/bash_completion` says it belongs to app-shells/bash-completion-2.1-r1. (In reply to gentoo from comment #9) > `equery b /etc/bash_completion.d/bash_completion` says it belongs to > app-shells/bash-completion-2.1-r1. I gues it is a symlink to /usr/share/bash-completion/bash_completion. You probably enabled completion 'bash_completion' globally via eselect. Am I right? $ eselect bashcomp list Available completions: [1] bash_completion [2] dbus [3] udisks (In reply to Alexander Tsoy from comment #10) > (In reply to gentoo from comment #9) > > `equery b /etc/bash_completion.d/bash_completion` says it belongs to > > app-shells/bash-completion-2.1-r1. > > I gues it is a symlink to /usr/share/bash-completion/bash_completion. You > probably enabled completion 'bash_completion' globally via eselect. Am I > right? > > $ eselect bashcomp list > Available completions: > [1] bash_completion > [2] dbus > [3] udisks No, it's a file. `eselect bashcomp --list` shows no enabled rules, and enabling or disabling bash_completion has no visible effect, neither on that directory nor any others I've seen. $ qlist -ICv bash-completion app-shells/bash-completion-2.1-r1 $ qlist bash-completion | egrep '/etc/' /etc/profile.d/bash_completion.sh (In reply to gentoo from comment #11) > No, it's a file. Please attach build.log Also check that /etc/bash_completion.d is not a symlink to /usr/share/bash-completion on your system. (In reply to Alexander Tsoy from comment #14) > Also check that /etc/bash_completion.d is not a symlink to > /usr/share/bash-completion on your system. Sorry for the late response, I was using the downgraded version in the meantime. I upgraded back to the problematic versions. It's a symlink now, and no longer a separate directory. I'm not sure what caused that the first time round, but whatever it seems to have been, it hasn't reproduced itself. I re-emerged all of the packages that installed bash completions and now my /etc/bash_completion.d looks probably a lot more like it should, with bash_completion at the top level and most of my scripts in the ‘completions’ subdirectory. It still doesn't work, however. Some scripts were still in the top level, of packages that I think the advised ‘auto-rebuild’ left out, and moving those into ‘completions’ manually does not affect the issue. I've attached a new strace. Tell me if you still want a build.log. Created attachment 358414 [details]
New output of strace -f
(In reply to gentoo from comment #15) /etc/bash_completion.d should not be a symlink. Most likely, you have created it yourself (e.g. to enable all completions globally for bash-completion-1.x). (In reply to Alexander Tsoy from comment #17) > (In reply to gentoo from comment #15) > > /etc/bash_completion.d should not be a symlink. Most likely, you have > created it yourself (e.g. to enable all completions globally for > bash-completion-1.x). That seems probable. I've removed the symlink, and now bash works fine but I don't have any completion. `eselect bashcomp` no longer exists, apparently. What should I be doing to re-enable everything? (In reply to gentoo from comment #18) > What should I be doing to re-enable everything? Read elog and ewarn messages. You should run the following command: emerge -av1 $(qfile -q -S -C /usr/share/bash-completion) And you should source /usr/share/bash-completion/bash_completion in your ~/.bashrc. (In reply to Alexander Tsoy from comment #19) > (In reply to gentoo from comment #18) > > > What should I be doing to re-enable everything? > > Read elog and ewarn messages. You should run the following command: > > emerge -av1 $(qfile -q -S -C /usr/share/bash-completion) > > And you should source /usr/share/bash-completion/bash_completion in your > ~/.bashrc. Thanks, that resolves my issues. I didn't get any ewarn/elog messages when emerging it, at least not this time - I still have the output of ‘emerge -1u bash-completion gentoo-bashcomp’ in my terminal and there's nothing to suggest anything needs to be done on my side, it's only when I looked at the build.log upon your request that I realized I had to re-emerge all of the packages that provided bash completions. Just a heads up. (In reply to gentoo from comment #20) > (In reply to Alexander Tsoy from comment #19) > > Read elog and ewarn messages. You should run the following command: > > > > emerge -av1 $(qfile -q -S -C /usr/share/bash-completion) > > > > And you should source /usr/share/bash-completion/bash_completion in your > > ~/.bashrc. > > Thanks, that resolves my issues. |