On 2022-11-27 00:07, David Wright wrote:
On Sat 26 Nov 2022 at 23:00:07 (+0100), email.list...@gmail.com wrote:
On 2022-11-26 19:58, to...@tuxteam.de wrote:
On Sat, Nov 26, 2022 at 09:55:49AM -0600, David Wright wrote:
On Sat 26 Nov 2022 at 14:00:39 (+0100), email.list...@gmail.com wrote:
Doing tab completion in my user account is quite sluggish, it takes
about half a second before anything happens after pressing tab.
I've done an strace on the shell and it turns out that when I press
tab bash does a select() on stdout that times out after half a second.
When I'm logged in as root and do the same thing bash does not do
that, so I presume it has something to do with how tab completion is
configured when I'm logged in to my regular user account. I'm not sure
how to investigate this further, any help would be appreciated. I'm
still on debian 10 and my version of bash is 5.0.3(1)
Do you have a networked filesystem in your PATH? Or a directory on
a slow device, like a stick or caddy? Remember to check symlinks.
Hm. The select() seems to suggest that the bash is waiting on a
socket. Can you see in the trace how the fd select is waiting
on was opened? Perhaps that gives a clue.
No the only two calls in the trace before select are to pselect6() and
read()
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <4.400862>
read(0, "\t", 1) = 1 <0.000081>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=500000}) = 0
Where does this number come from? →→→→→→→→→→→→→↑↑↑↑↑↑
I did another couple of traces doing tab completion on basen to get
basename. The first one is as my user account, the second is as root.
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <2.270965>
read(0, "b", 1) = 1 <0.000075>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000135>
write(2, "b", 1) = 1 <0.000037>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.226770>
read(0, "a", 1) = 1 <0.000071>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000121>
write(2, "a", 1) = 1 <0.000038>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.717091>
read(0, "s", 1) = 1 <0.000072>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000083>
write(2, "s", 1) = 1 <0.000089>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.242770>
read(0, "e", 1) = 1 <0.000072>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000123>
write(2, "e", 1) = 1 <0.000036>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.252988>
read(0, "n", 1) = 1 <0.000069>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000118>
write(2, "n", 1) = 1 <0.000036>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.869281>
read(0, "\t", 1) = 1 <0.000082>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=500000}) = 0 (Timeout)
<0.500672>
stat("basen", 0x7ffc42a6ccf0) = -1 ENOENT (No such file or directory)
<0.000079>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <3.445024>
read(0, "b", 1) = 1 <0.000115>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000114>
write(2, "b", 1) = 1 <0.000069>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.299317>
read(0, "a", 1) = 1 <0.000099>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000017>
write(2, "a", 1) = 1 <0.000019>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.370548>
read(0, "s", 1) = 1 <0.000114>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000106>
write(2, "s", 1) = 1 <0.000059>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.288960>
read(0, "e", 1) = 1 <0.000110>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000107>
write(2, "e", 1) = 1 <0.000072>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.728979>
read(0, "n", 1) = 1 <0.000122>
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000098>
write(2, "n", 1) = 1 <0.000069>
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) <0.980830>
read(0, "\t", 1) = 1 <0.000116>
stat("basen", 0x7ffcfa903ff0) = -1 ENOENT (No such file or directory)
<0.000127>
There's a select on stdout after each read(), as root there is no
select() after reading tab from stdin, but as a user there is. For some
reason the select() after tab is given a timeout period of 500000
microseconds, no other select() does. This seems to be the crux of the
problem.
I see zero here.
(Timeout)<0.500679>
Cheers,
David.