Installed FreeBSD 12 on a fresh server for testing, noticed something really odd - intermittently tcsh takes a couple of seconds to start up, far more than it should. The system is not cpu or io bound. I even tried running tcsh with the "-f" switch, which makes tcsh "not load any resource or startup files, or perform any command hashing" assuming maybe there was something off in the various startup files, but it still does it. As a test I ran bash and zsh on the system in question, and they start up quickly, no delay. Oddly tcsh even does it when simply asking for the version:
Thinking maybe I somehow had a corrupt version of tcsh, I set about getting the source and compiling a clean copy. Got the newest source, compiled and ran my fresh executable, same problem:
Finally I tried tracing tcsh with truss (
Anyone have any idea what might be causing this?
Code:
[cramey@quill ~]# time tcsh --version
tcsh 6.20.00 (Astron) 2016-11-24 (x86_64-amd-FreeBSD) options wide,nls,dl,al,kan,sm,rh,color,filec
real 0m2.039s
user 0m0.008s
sys 0m0.001s
Thinking maybe I somehow had a corrupt version of tcsh, I set about getting the source and compiling a clean copy. Got the newest source, compiled and ran my fresh executable, same problem:
Code:
[cramey@quill ~/tcsh/tcsh-6.21.00]$ time ./tcsh --version
tcsh 6.21.00 (Astron) 2019-05-08 (x86_64-amd-FreeBSD) options wide,nls,dl,al,kan,rh,color,filec
real 0m2.097s
user 0m0.003s
sys 0m0.015s
Finally I tried tracing tcsh with truss (
truss -D -o csh.truss tcsh --version
) just to see if something jumped out at me, and I noticed this:
Code:
0.000036734 open("/etc/group",O_RDONLY|O_CLOEXEC,0666) = 3 (0x3)
0.000026210 fstat(3,{ mode=-rw-r--r-- ,inode=15760,size=507,blksize=4096 }) = 0
(0x0)
0.000039960 read(3,"# $FreeBSD: releng/12.0/etc/grou"...,4096) = 507 (0x1fb)
0.000025042 close(3) = 0 (0x0)
0.000025917 __sysctl(0x7fffffffe530,0x2,0x7fffffffe640,0x7fffffffe528,0x0,0x0) =
0 (0x0)
0.000023129 sigaction(SIGCHLD,{ SIG_DFL 0x0 ss_t },0x0) = 0 (0x0)
0.000032588 pipe2(0x7fffffffe508,0) = 0 (0x0)
0.000020420 dup(3) = 5 (0x5)
0.000018606 dup(5) = 6 (0x6)
0.000019262 close(5) = 0 (0x0)
0.000018661 close(3) = 0 (0x0)
0.000019202 fcntl(6,F_SETFD,FD_CLOEXEC) = 0 (0x0)
0.000018800 dup(4) = 3 (0x3)
0.000022162 dup(3) = 5 (0x5)
0.000019721 dup(5) = 7 (0x7)
0.000021148 close(5) = 0 (0x0)
0.000019755 close(3) = 0 (0x0)
0.000019503 close(4) = 0 (0x0)
0.000019636 fcntl(7,F_SETFD,FD_CLOEXEC) = 0 (0x0)
0.000366862 fork() = 48750 (0xbe6e)
0.000020046 close(7) = 0 (0x0)
2.042416266 read(6,0x7fffffffc500,8192) = 0 (0x0)
Anyone have any idea what might be causing this?