Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-15-2017, 09:21 AM   #1
LQ Newbie
Registered: Sep 2014
Distribution: Fedora 26
Posts: 5

Rep: Reputation: Disabled
Shell autocompletion very slow after partial disk formatting

I upgraded to Fedora 26 the day of the official public release earlier this week and, long story short, ended up screwing up my installation, so I did a partial reformatting . My disk layout is the following:

    # df -h | grep dev
    /dev/sdb3        40G  5.6G   32G  15% /
    /dev/sdb2       477M  138M  311M  31% /boot
    /dev/sdb1       200M   34M  167M  17% /boot/efi
    /dev/sda2       9.8G  940M  8.4G  10% /var
    /dev/sda1       493G  441G   27G  95% /home
`/dev/sdb` is the SSD where root is mounted and `/dev/sda` is a normal HDD where I have my `/home` partition. I decided to do a clean install of Fedora 26 instead of trying to repair my botched upgrade via `dnf`, so I reformatted all partitions in `/dev/sdb`, the SSD and re-installed Fedora 26, keeping the `/home` partition intact. The installation went fine and everything seems to be working normally again except for one thing: Zhs autocompletion is now dog slow with larger directories.

Zsh is my default shell and I have a plethora of plugins installed (Oh My Zsh, FZF, etc.) so I figured one of these might've gone out of whack during/after the upgrade so I switched to Bash: same thing, autocomplete takes a good 10-30 seconds (depending on dir size) to come up. I installed some more shells to troubleshoot the cause and, to my surprise, `tcsh` and `fish` work absolutely fine. Under the same setting, these two perform perfectly fine where Bash and Zsh would hang for a good +10 seconds.

I've done the usual diagnostics with Bash, whose config is pretty vanilla compared to my Zsh install: `strace`, `set -x`, etc., but couldn't find much of interest. Also ruled out FZF as the problem as the slowness persisted after uninstalling it... Still my gut tells me this must be some sort of weird hashing/caching problem of the completion engine that somehow affects both Zsh and Bash, but I don't really have any evidence to support that. Autocompletion with smaller folders (few files, few subdirectories) works fine across all shells I've tried. Other things I've tried is to run `fsck -A -y` to make sure I don't have any corrupt partitions and also re-installed `bash-completion` and `zsh` just in case some metadata or cache had corrupted.

I think what's really intriguing here is the fact that `tcsh` and `fish` have 0 problem autocompleting anything I throw at them, but Bash and Zsh don't. Does anybody know what's going on here? Big thanks to whomever sheds some light into the matter!

Last edited by LiamMayfair; 07-16-2017 at 11:56 AM. Reason: Problem solved
Old 07-15-2017, 01:26 PM   #2
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,500

Rep: Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536Reputation: 5536
I do not think bash and zsh uses the same cache for this.
You can try to create a new user and test if that works as expected.
I would try to reset those caches, probably they remember a non-existent directory (or more).
Old 07-15-2017, 03:46 PM   #3
Registered: Mar 2008
Posts: 20,848

Rep: Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383
Just for grin's maybe install clean fedora 26 to a flash drive and see what it does.

So many things going on I can guess. I've never trusted upgrades.

Guess you could run top or other performance tests to see if you can find issue. Look at logs?
1 members found this post helpful.
Old 07-15-2017, 05:56 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,712

Rep: Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549Reputation: 3549
For bash, you (royal plural, not you in particular) have to set up completion.
In my F25, /etc/profile.d/ checks for the existence of .config/bash_completion and sources that if so; else it sources /usr/share/bash-completion/bash_completion. Might be worth deleting the .config version if it exists.
Never used zsh that I can remember, so can't offer an opinion there.

FWIW I usually let new releases of Fedora "settle" for 4-6 weeks so all the kinks can be ironed out. Maybe this is one such.

Last edited by syg00; 07-15-2017 at 05:59 PM. Reason: FWIW
Old 07-16-2017, 11:56 AM   #5
LQ Newbie
Registered: Sep 2014
Distribution: Fedora 26
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thumbs up Solved

Problem solved! I was toying around with `perf trace` following jefro's advice and as lines and lines of output scrolled past I caught a glimpse of a few weird calls to libnotify from Konsole, my default terminal. That seemed weird since after the reformat I no longer had any desktop notification daemon installed (I use i3, which doesn't come with one, you see). That gave me the idea to try a different terminal emulator. So I tried `urxvt` and lo and behold, the issue disappeared. I also tried with `gnome-terminal` and no probs at all! Could it be then that Konsole was trying to fire off a desktop notification via dbus/systemd but timing out because there was no libnotify daemon installed to respond to the request? So I installed `dunst`, which is the daemon I was using before the upgrade and, as I suspected, autocomplete slowness in Konsole is gone!

So I have no idea what the heck Konsole tries to do when autocomplete is invoked because I never see any notifications pop up, not even after installing the daemon, but, at any rate, the issue seems to be fixed now.

I think I'll be taking this one to the KDE team and see what their thoughts are because, even though it was kind of my fault for not having a notification daemon installed, the other terminals I tried handled the problem just fine.

Anyway, thank you all for your help!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
/var/lib/apt/list/partial eating all of the disk space. replica9000 Debian 1 06-16-2014 03:47 PM
[SOLVED] Quick partial disk wipe utility for Hitachi HDs rusty2 Linux - Software 3 06-10-2011 02:10 PM
shell script for a partial control over inputs to an external program njain Linux - Software 1 05-19-2010 07:57 PM
commandline autocompletion for my shell script mmn357157 Linux - General 5 09-11-2008 11:29 AM
Partial/Corrupt Files in Disk Cache Crito Linux - Software 0 03-11-2004 02:13 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration