Comment 7 for bug 384017

Revision history for this message
Jason Gunthorpe (jgunthorpe) wrote :

There is more going on here than just loading a lot of completion. Something is weird inside bash, look at the strace of completion loading and you see it is doing a wack of busy work crap like this. The fiddling with FDs looks like it is probably some kind of errant debug feature? This is from maverick with bash 4.1-2ubuntu4. It is annoying that

16:58:30 access("/etc/bash_completion.d/mutt", R_OK) = 0
16:58:30 open("/etc/bash_completion.d/mutt", O_RDONLY) = 3
16:58:30 fstat(3, {st_mode=S_IFREG|0644, st_size=4527, ...}) = 0
16:58:30 read(3, "# mutt completion\n#\n# Mutt doesn"..., 4527) = 4527
16:58:30 close(3) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
16:58:30 open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
16:58:30 fcntl(1, F_GETFD) = 0
16:58:30 fcntl(1, F_DUPFD, 10) = 10
16:58:30 fcntl(1, F_GETFD) = 0
16:58:30 fcntl(10, F_SETFD, FD_CLOEXEC) = 0
16:58:30 dup2(3, 1) = 1
16:58:30 close(3) = 0
16:58:30 fcntl(2, F_DUPFD, 10) = 11
16:58:30 fcntl(2, F_GETFD) = 0
16:58:30 fcntl(11, F_SETFD, FD_CLOEXEC) = 0
16:58:30 dup2(1, 2) = 2
16:58:30 stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
16:58:30 stat("/usr/sbin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or dir
16:58:30 stat("/usr/bin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or dire
16:58:30 stat("/sbin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or directo
16:58:30 stat("/bin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or director
16:58:30 stat("/usr/bin/X11/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or
16:58:30 stat("/usr/bin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or dire
16:58:30 stat("/usr/local/bin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file o
16:58:30 stat("/usr/games/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or di
16:58:30 stat("/home/jgg/bin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or
16:58:30 stat("/sbin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or directo
16:58:30 stat("/usr/sbin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file or dir
16:58:30 stat("/usr/local/sbin/mutt", 0x7fff6d9e1230) = -1 ENOENT (No such file
16:58:30 write(2, "bash: type: mutt: not found\n", 28) = 28
16:58:30 dup2(11, 2) = 2
16:58:30 fcntl(11, F_GETFD) = 0x1 (flags FD_CLOEXEC)
16:58:30 close(11) = 0
16:58:30 dup2(10, 1) = 1
16:58:30 fcntl(10, F_GETFD) = 0x1 (flags FD_CLOEXEC)
16:58:30 close(10) = 0
16:58:30 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0