romkatv / powerlevel10k

A Zsh theme
MIT License
46.61k stars 2.19k forks source link

gitstatus_query_p9k_:print:56: write error: broken pipe #1655

Closed patrickli closed 2 years ago

patrickli commented 2 years ago

I have this message showing up at the start up of every new shell session. gitstatusd is not running. This happens on both v1.15.0 tag and master.

I have the feeling that it is related to a DLP software that we had to run, because this message does not appear when the DLP was temporarily disabled during a period of time. But I am not sure if it is the DLP that is killing the process or not. Maybe you can point me at the right direction.

I have enabled debug mode and included some debug information according to the instructions on other issues.

+(anon):2> echo 5.8 zsh-5.8-0-g77d203f
5.8 zsh-5.8-0-g77d203f
+(anon):3> uname -a
+uname:1> /usr/local/bin/guname -a
Darwin NZ99008ML.lan.palace 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64 i386 MacBookPro16,2 Darwin
+(anon):4> ps --pid
ps: illegal option -- -
usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
          [-g grp[,grp...]] [-u [uid,uid...]]
          [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
       ps [-L]
+(anon):5> lsof -p 27002
COMMAND   PID    USER   FD   TYPE             DEVICE SIZE/OFF                NODE NAME
zsh     27002 patrick  cwd    DIR                1,7      768              283955 /Users/patrick
zsh     27002 patrick  txt    REG                1,7  1348368 1152921500312807015 /bin/zsh
zsh     27002 patrick  txt    REG                1,7     3080             1078139 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/znap.zwc
zsh     27002 patrick  txt    REG                1,7     1568             1078120 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.clone.zwc
zsh     27002 patrick  txt    REG                1,7     1040             1078130 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.multi.zwc
zsh     27002 patrick  txt    REG                1,7     2944             1078117 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/..znap.dirname.zwc
zsh     27002 patrick  txt    REG                1,7   137696 1152921500312809365 /usr/lib/zsh/5.8/zsh/langinfo.so
zsh     27002 patrick  txt    REG                1,7      808             1078126 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.function.zwc
zsh     27002 patrick  txt    REG                1,7     4384             1078124 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.eval.zwc
zsh     27002 patrick  txt    REG                1,7     2000             1078135 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.source.zwc
zsh     27002 patrick  txt    REG                1,7     1168             1078115 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/..znap.auto-compile.zwc
zsh     27002 patrick  txt    REG                1,7   138640 1152921500312809397 /usr/lib/zsh/5.8/zsh/terminfo.so
zsh     27002 patrick  txt    REG                1,7   143344 1152921500312809381 /usr/lib/zsh/5.8/zsh/param/private.so
zsh     27002 patrick  txt    REG                1,7   138880 1152921500312809391 /usr/lib/zsh/5.8/zsh/stat.so
zsh     27002 patrick  txt    REG                1,7   140096 1152921500312809393 /usr/lib/zsh/5.8/zsh/system.so
zsh     27002 patrick  txt    REG                1,7   174368 1152921500312809411 /usr/lib/zsh/5.8/zsh/zutil.so
zsh     27002 patrick  txt    REG                1,7   139088 1152921500312809357 /usr/lib/zsh/5.8/zsh/datetime.so
zsh     27002 patrick  txt    REG                1,7   341936 1152921500312809349 /usr/lib/zsh/5.8/zsh/complete.so
zsh     27002 patrick  txt    REG                1,7   579936 1152921500312809401 /usr/lib/zsh/5.8/zsh/zle.so
zsh     27002 patrick  txt    REG                1,7   139600 1152921500312809369 /usr/lib/zsh/5.8/zsh/mathfunc.so
zsh     27002 patrick  txt    REG                1,7   138048 1152921500312809403 /usr/lib/zsh/5.8/zsh/zleparameter.so
zsh     27002 patrick  txt    REG                1,7   211600 1152921500312809351 /usr/lib/zsh/5.8/zsh/complist.so
zsh     27002 patrick  txt    REG                1,7   174768 1152921500312809383 /usr/lib/zsh/5.8/zsh/parameter.so
zsh     27002 patrick  txt    REG                1,7   139888 1152921500312809363 /usr/lib/zsh/5.8/zsh/files.so
zsh     27002 patrick  txt    REG                1,7   138640 1152921500312809395 /usr/lib/zsh/5.8/zsh/termcap.so
zsh     27002 patrick  txt    REG                1,7   138544 1152921500312809374 /usr/lib/zsh/5.8/zsh/net/socket.so
zsh     27002 patrick  txt    REG                1,7   138448 1152921500312809385 /usr/lib/zsh/5.8/zsh/regex.so
zsh     27002 patrick  txt    REG                1,7  2016336 1152921500312809172 /usr/lib/dyld
zsh     27002 patrick    0u   CHR               16,0   0t2871                 695 /dev/ttys000
zsh     27002 patrick    1u   CHR               16,0   0t2871                 695 /dev/ttys000
zsh     27002 patrick    2u   CHR               16,0   0t2871                 695 /dev/ttys000
zsh     27002 patrick   10u   CHR               16,0   0t3154                 695 /dev/ttys000
zsh     27002 patrick   11r   REG                1,7     3080             1078139 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/znap.zwc
zsh     27002 patrick   12r   REG                1,7     1168             1078115 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/..znap.auto-compile.zwc
zsh     27002 patrick   15r   REG                1,7      808             1078126 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.function.zwc
zsh     27002 patrick   16w  FIFO                         0t0             1607731 /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.worker.503.27002.1638490437.fifo
zsh     27002 patrick   17r   REG                1,7     1568             1078120 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.clone.zwc
zsh     27002 patrick   19r   REG                1,7     1040             1078130 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.multi.zwc
zsh     27002 patrick   20r   REG                1,7     2944             1078117 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/..znap.dirname.zwc
zsh     27002 patrick   21r   REG                1,7     4384             1078124 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.eval.zwc
zsh     27002 patrick   22r   REG                1,7     2000             1078135 /Users/patrick/.local/share/zsh-snap/zsh-snap/functions/.znap.source.zwc
zsh     27002 patrick   24   PIPE 0x46a9c05f1b987e6c    16384                     ->0x45bc9d33d89316fb
+(anon):6> lsof -p
lsof: no process ID specified
lsof 4.91
 latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
 latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
 latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
 usage: [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]]
 [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] [-p s]
 [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]
Use the ``-h'' option to get more help information.
+(anon):7> cat /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.daemon.log
+cat:1> /usr/local/bin/gcat /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.daemon.log
+_gitstatus_daemon_p9k_:3> local pgid=27005
+_gitstatus_daemon_p9k_:4> [[ 27005 == <1-> ]]
+_gitstatus_daemon_p9k_:5> cd -q /
+_gitstatus_daemon_p9k_:90> ((  lock_fd == -1  ))
+_gitstatus_daemon_p9k_:9> trap '' PIPE
+_gitstatus_daemon_p9k_:11> local uname_sm
+_gitstatus_daemon_p9k_:93> zsystem flock -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.lock
+_gitstatus_daemon_p9k_:12> uname_sm=+_gitstatus_daemon_p9k_:12> uname -sm
+_gitstatus_daemon_p9k_:12> uname_sm='darwin x86_64'
+_gitstatus_daemon_p9k_:13> [[ 'darwin x86_64' == [^\ ]##\ [^\ ]## ]]
+_gitstatus_daemon_p9k_:14> local uname_s=darwin
+_gitstatus_daemon_p9k_:15> local uname_m=x86_64
+_gitstatus_daemon_p9k_:17> [[ '' == <1-> ]]
+_gitstatus_daemon_p9k_:20> local cpus
+_gitstatus_daemon_p9k_:21> ((  ! 1  ))
+_gitstatus_daemon_p9k_:21> [[ darwin == linux ]]
+_gitstatus_daemon_p9k_:22> cpus=+_gitstatus_daemon_p9k_:22> sysctl -n hw.ncpu
+_gitstatus_daemon_p9k_:22> cpus=8
+_gitstatus_daemon_p9k_:27> args+=( -t 16 )
+_gitstatus_daemon_p9k_:30> mkfifo -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.fifo
+_gitstatus_daemon_p9k_:31> print -rnu 17 -- '               27005'
+_gitstatus_daemon_p9k_:33> zf_rm -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.fifo
+_gitstatus_daemon_p9k_:35> local _gitstatus_zsh_daemon _gitstatus_zsh_version _gitstatus_zsh_downloaded
+_gitstatus_daemon_p9k_:43> local gitstatus_plugin_dir_var=_gitstatus_plugin_dir_p9k_
+_gitstatus_daemon_p9k_:44> local gitstatus_plugin_dir=/Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus
+_gitstatus_daemon_p9k_:45> set -- -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_daemon_p9k_:47> [[ 1 == (|-|+)<1-> ]]
+_gitstatus_daemon_p9k_:48> source /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus/install
+/Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus/install:467> [ -z '' ']'
+/Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus/install:468> _gitstatus_install_main /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:1> [ -n 5.8 ']'
+_gitstatus_install_main:2> emulate -L sh -o no_unset
+_gitstatus_install_main:7> local argv1=/Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus
+_gitstatus_install_main:8> shift
+_gitstatus_install_main:10> local no_check='' no_install='' uname_s='' uname_m='' gitstatus_dir='' dl_status='' e=''
+_gitstatus_install_main:11> local opt='' OPTARG='' OPTIND=1
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case d (h)
+_gitstatus_install_main:14> case d (n)
+_gitstatus_install_main:14> case d (f)
+_gitstatus_install_main:14> case d (d)
+_gitstatus_install_main:55> [ -n '' ']'
+_gitstatus_install_main:59> [ -z /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus ']'
+_gitstatus_install_main:63> gitstatus_dir=/Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case s (h)
+_gitstatus_install_main:14> case s (n)
+_gitstatus_install_main:14> case s (f)
+_gitstatus_install_main:14> case s (d)
+_gitstatus_install_main:14> case s (p)
+_gitstatus_install_main:14> case s (e)
+_gitstatus_install_main:14> case s (m)
+_gitstatus_install_main:14> case s (s)
+_gitstatus_install_main:99> [ -n '' ']'
+_gitstatus_install_main:103> [ -z darwin ']'
+_gitstatus_install_main:107> uname_s=darwin
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case m (h)
+_gitstatus_install_main:14> case m (n)
+_gitstatus_install_main:14> case m (f)
+_gitstatus_install_main:14> case m (d)
+_gitstatus_install_main:14> case m (p)
+_gitstatus_install_main:14> case m (e)
+_gitstatus_install_main:14> case m (m)
+_gitstatus_install_main:88> [ -n '' ']'
+_gitstatus_install_main:92> [ -z x86_64 ']'
+_gitstatus_install_main:96> uname_m=x86_64
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case p (h)
+_gitstatus_install_main:14> case p (n)
+_gitstatus_install_main:14> case p (f)
+_gitstatus_install_main:14> case p (d)
+_gitstatus_install_main:14> case p (p)
+_gitstatus_install_main:66> [ -n '' ']'
+_gitstatus_install_main:70> [ -z 'printf '\''\001'\'' >&17' ']'
+_gitstatus_install_main:74> dl_status='printf '\''\001'\'' >&17'
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case e (h)
+_gitstatus_install_main:14> case e (n)
+_gitstatus_install_main:14> case e (f)
+_gitstatus_install_main:14> case e (d)
+_gitstatus_install_main:14> case e (p)
+_gitstatus_install_main:14> case e (e)
+_gitstatus_install_main:77> [ -n '' ']'
+_gitstatus_install_main:81> [ -z 17 ']'
+_gitstatus_install_main:85> e=17
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&17' -e 17 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:115> shift 11
+_gitstatus_install_main:117> : 17
+_gitstatus_install_main:118> : /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus
+_gitstatus_install_main:120> [ -n '' -a -n '' ']'
+_gitstatus_install_main:125> [ -z darwin ']'
+_gitstatus_install_main:129> [ -z x86_64 ']'
+_gitstatus_install_main:134> local daemon=''
+_gitstatus_install_main:135> local cache_dir=/Users/patrick/.cache/gitstatus
+_gitstatus_install_main:137> [ -z '' ']'
+_gitstatus_install_main:138> [ -n '' ']'
+_gitstatus_install_main:142> [ -z '' -a -e /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus/usrbin/gitstatusd ']'
+_gitstatus_install_main:145> [ -n '' ']'
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686";    file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686";    file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686";    file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";'
+_gitstatus_install_main:166> uname_s_glob=cygwin_nt-10.0
+_gitstatus_install_main:166> uname_m_glob=i686
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42
+_gitstatus_install_main:168> [ -z cygwin_nt-10.0 -o -z i686 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42 ']'
+_gitstatus_install_main:177> case darwin (cygwin_nt-10.0)
+_gitstatus_install_main:177> case darwin (*)
+_gitstatus_install_main:179> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";'
+_gitstatus_install_main:166> uname_s_glob=cygwin_nt-10.0
+_gitstatus_install_main:166> uname_m_glob=x86_64
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f
+_gitstatus_install_main:168> [ -z cygwin_nt-10.0 -o -z x86_64 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f ']'
+_gitstatus_install_main:177> case darwin (cygwin_nt-10.0)
+_gitstatus_install_main:177> case darwin (*)
+_gitstatus_install_main:179> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="darwin";         uname_m_glob="arm64";   file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="darwin";         uname_m_glob="arm64";   file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="darwin";         uname_m_glob="arm64";   file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe";'
+_gitstatus_install_main:166> uname_s_glob=darwin
+_gitstatus_install_main:166> uname_m_glob=arm64
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe
+_gitstatus_install_main:168> [ -z darwin -o -z arm64 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe ']'
+_gitstatus_install_main:177> case darwin (darwin)
+_gitstatus_install_main:181> case x86_64 (arm64)
+_gitstatus_install_main:181> case x86_64 (*)
+_gitstatus_install_main:183> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="darwin";         uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="darwin";         uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="darwin";         uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160";'
+_gitstatus_install_main:166> uname_s_glob=darwin
+_gitstatus_install_main:166> uname_m_glob=x86_64
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160
+_gitstatus_install_main:168> [ -z darwin -o -z x86_64 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160 ']'
+_gitstatus_install_main:177> case darwin (darwin)
+_gitstatus_install_main:181> case x86_64 (x86_64)
+_gitstatus_install_main:188> [ -z '' ']'
+_gitstatus_install_main:190> local daemon=/Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus/usrbin/gitstatusd-darwin-x86_64
+_gitstatus_install_main:191> [ ! -e /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/gitstatus/usrbin/gitstatusd-darwin-x86_64 ']'
+_gitstatus_install_main:192> daemon=/Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64
+_gitstatus_install_main:193> [ -e /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ']'
+_gitstatus_install_main:195> [ -n /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ']'
+_gitstatus_install_main:196> _gitstatus_install_daemon_found 0 _gitstatus_set_daemon_p9k_
+_gitstatus_install_daemon_found:1> local installed=0
+_gitstatus_install_daemon_found:2> shift
+_gitstatus_install_daemon_found:3> [ 1 '=' 0 ']'
+_gitstatus_install_daemon_found:3> _gitstatus_set_daemon_p9k_ /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 v1.5.1 0
+_gitstatus_set_daemon_p9k_:1> _gitstatus_zsh_daemon=/Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64
+_gitstatus_set_daemon_p9k_:2> _gitstatus_zsh_version=v1.5.1
+_gitstatus_set_daemon_p9k_:3> _gitstatus_zsh_downloaded=0
+_gitstatus_install_main:197> return
+_gitstatus_daemon_p9k_:49> [[ -n /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ]]
+_gitstatus_daemon_p9k_:50> [[ -n v1.5.1 ]]
+_gitstatus_daemon_p9k_:51> [[ 0 == [01] ]]
+_gitstatus_daemon_p9k_:53> ((  UID == EUID  ))
+_gitstatus_daemon_p9k_:54> local home=/Users/patrick
+_gitstatus_daemon_p9k_:62> [[ -x /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ]]
+_gitstatus_daemon_p9k_:63> HOME=/Users/patrick /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 -G v1.5.1 -s -1 -u -1 -d -1 -c -1 -m -1 -v DEBUG -t 16
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[0]: "/Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[1]: "-G"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[2]: "v1.5.1"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[3]: "-s"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[4]: "-1"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[5]: "-u"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[6]: "-1"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[7]: "-d"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[8]: "-1"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[9]: "-c"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[10]: "-1"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[11]: "-m"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[12]: "-1"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[13]: "-v"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[14]: "DEBUG"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[15]: "-t"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:186] argv[16]: "16"
[2021-12-03 13:13:57 0000000109e4b600 INFO src/thread_pool.cc:81] Spawning 16 thread(s)
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:201] Processing request: "}hello" for ""
[2021-12-03 13:13:57 0000000109e4b600 INFO src/response.cc:69] Replying without git status
[2021-12-03 13:13:57 0000000109e4b600 INFO src/timer.cc:64] Timing for: request: 0.031ms cpu
[2021-12-03 13:13:57 0000000109e4b600 INFO src/gitstatus.cc:204] Successfully processed request: "}hello" for ""
+_gitstatus_daemon_p9k_:93> [[ -e /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.lock ]]
+_gitstatus_daemon_p9k_:94> zf_rm -f -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.lock /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.fifo
+_gitstatus_daemon_p9k_:95> kill -- -27005

I 've also included the output from xtrace.log here.

+(anon):7> setopt monitor
+(anon):9> ((  ! _GITSTATUS_STATE_POWERLEVEL9K  ))
+(anon):10> [[ -r /proc/version ]]
+(anon):13> print -rn
+(anon):14> zsystem flock -f lock_fd /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.lock
+(anon):15> [[ 16 == <1-> ]]
+(anon):18> typeset -gi '_GITSTATUS_LOCK_FD_POWERLEVEL9K=lock_fd'
+(anon):20> [[ darwin21.0 == cygwin* ]]
+(anon):41> sysopen -r -o cloexec -u resp_fd /dev/fd/15
+(anon):44> typeset -gi 'GITSTATUS_DAEMON_PID_POWERLEVEL9K=27005'
+(anon):46> [[ 18 == <1-> ]]
+(anon):47> typeset -gi '_GITSTATUS_RESP_FD_POWERLEVEL9K=resp_fd'
+(anon):48> typeset -gi '_GITSTATUS_STATE_POWERLEVEL9K=1'
+(anon):51> ((  ! async  ))
+(anon):41> _gitstatus_daemon_p9k_
+_gitstatus_daemon_p9k_:1> local -i pipe_fd
+(anon):7> setopt monitor
+(anon):9> ((  ! _GITSTATUS_STATE_POWERLEVEL9K  ))
+(anon):51> ((  ! async  ))
+(anon):52> ((  _GITSTATUS_CLIENT_PID_POWERLEVEL9K == sysparams[pid]  ))
+(anon):54> local pgid
+(anon):55> ((  0 < 20  ))
+(anon):56> [[ -t 18 ]]
+(anon):57> sysread -s 20 -t 5.0000000000 -i 18 'pgid[$#pgid+1]'
+(anon):55> ((  20 < 20  ))
+(anon):59> [[ '               27005' == \ #<1-> ]]
+(anon):60> typeset -gi 'GITSTATUS_DAEMON_PID_POWERLEVEL9K=pgid'
+(anon):62> sysopen -w -o cloexec -u req_fd -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.fifo
+(anon):63> [[ 26 == <1-> ]]
+(anon):64> typeset -gi '_GITSTATUS_REQ_FD_POWERLEVEL9K=req_fd'
+(anon):66> print -nru 26 -- $'}hello\C-_\C-^'
+(anon):67> local expected=$'}hello\C-_0\C-^' actual
+(anon):68> ((  1  ))
+(anon):68> [[ ! -t 1 && ! -t 0 ]]
+(anon):69> local -F deadline='EPOCHREALTIME + 4'
+(anon):73> true
+(anon):74> [[ -t 18 ]]
+(anon):75> sysread -s 1 -t 5.0000000000 -i 18 actual
+(anon):76> [[ $'}hello\C-_0\C-^' == }* ]]
+(anon):76> break
+(anon):113> ((  deadline == 0  ))
+(anon):126> ((  1 < 9  ))
+(anon):127> [[ -t 18 ]]
+(anon):128> sysread -s 8 -t 5.0000000000 -i 18 'actual[$#actual+1]'
+(anon):126> ((  9 < 9  ))
+(anon):130> [[ $'}hello\C-_0\C-^' == }hello0 ]]
+(anon):144> zle -F 18 _gitstatus_process_response_POWERLEVEL9K-_p9k_
+(anon):157> add-zsh-hook zshexit _gitstatus_cleanup_POWERLEVEL9K-_p9k_
+add-zsh-hook:15> emulate -L zsh
+add-zsh-hook:17> local -a hooktypes
+add-zsh-hook:18> hooktypes=( chpwd precmd preexec periodic zshaddhistory zshexit zsh_directory_name ) 
+add-zsh-hook:22> local usage='Usage: add-zsh-hook hook function\nValid hooks are:\n  chpwd precmd preexec periodic zshaddhistory zshexit zsh_directory_name'
+add-zsh-hook:24> local opt
+add-zsh-hook:25> local -a autoopts
+add-zsh-hook:26> integer del list help
+add-zsh-hook:28> getopts dDhLUzk opt
+add-zsh-hook:55> shift 0
+add-zsh-hook:57> ((  list  ))
+add-zsh-hook:60> ((  help || 2 != 2 || 6 == 0  ))
+add-zsh-hook:65> local hook=zshexit_functions
+add-zsh-hook:66> local fn=_gitstatus_cleanup_POWERLEVEL9K-_p9k_
+add-zsh-hook:68> ((  del  ))
+add-zsh-hook:83> ((  1  ))
+add-zsh-hook:84> ((  0 == 0  ))
+add-zsh-hook:85> typeset -ga zshexit_functions
+add-zsh-hook:86> set -A zshexit_functions _p9k_instant_prompt_cleanup _p9k_worker_cleanup _gitstatus_cleanup_POWERLEVEL9K-_p9k_
+add-zsh-hook:92> autoload -- _gitstatus_cleanup_POWERLEVEL9K-_p9k_
+(anon):162> ((  lock_fd != -1  ))
+(anon):163> zf_rm -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.27002.1638490436.1.lock
+(anon):164> zsystem flock -u 16
+(anon):166> unset _GITSTATUS_LOCK_FD_POWERLEVEL9K
+(anon):168> typeset -gi '_GITSTATUS_STATE_POWERLEVEL9K=2'
romkatv commented 2 years ago

Can you reproduce this problem if you replace your entire ~/.zshrc with this?

source ~/.p10k.zsh
source /Users/patrick/.local/share/zsh-snap/prezto/modules/prompt/external/powerlevel10k/powerlevel10k.zsh-theme
patrickli commented 2 years ago

Yes. Same problem.

romkatv commented 2 years ago

How about this? Do you get the same problem in this shell?

() (
  emulate -L zsh -o err_return
  local tmp
  tmp="$(mktemp -d ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
  {
    builtin cd -q -- $tmp
    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git
    >.zshrc <<\END
source ~/.p10k.zsh
source $ZDOTDIR/powerlevel10k/powerlevel10k.zsh-theme
END
    builtin cd -q
    ZDOTDIR=$tmp zsh --no-global-rcs
  } always {
    cd /
    command rm -rf -- $tmp
  }
)
patrickli commented 2 years ago
Cloning into 'powerlevel10k'...
remote: Enumerating objects: 92, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 92 (delta 13), reused 63 (delta 10), pack-reused 0
Receiving objects: 100% (92/92), 424.95 KiB | 3.32 MiB/s, done.
Resolving deltas: 100% (13/13), done.
/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.nKyWWZGqMj/.zshrc:source:1: no such file or directory: /Users/patrick/.p10k.zsh

New config: /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.nKyWWZGqMj/.p10k.zsh.
Backup of /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.nKyWWZGqMj/.zshrc: $TMPDIR/.zshrc.pFPBXZOuQJ.

See /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.nKyWWZGqMj/.zshrc changes:

  diff $TMPDIR/.zshrc.pFPBXZOuQJ /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.nKyWWZGqMj/.zshrc

File feature requests and bug reports at https://github.com/romkatv/powerlevel10k/issues

gitstatus_query_p9k_:print:56: write error: broken pipe
romkatv commented 2 years ago

no such file or directory: /Users/patrick/.p10k.zsh

You didn't mention this error in your previous comment. Did you see it there too?

patrickli commented 2 years ago

This file in a different path, which I have changed in the first clean zshrc you asked me to try. Fixed this in the clean shell version and still the same problem.

Cloning into 'powerlevel10k'...
remote: Enumerating objects: 92, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 92 (delta 13), reused 64 (delta 10), pack-reused 0
Receiving objects: 100% (92/92), 424.95 KiB | 3.40 MiB/s, done.
Resolving deltas: 100% (13/13), done.
gitstatus_query_p9k_:print:56: write error: broken pipe
romkatv commented 2 years ago

This file in a different path, which I have changed in the first clean zsh you asked me to try.

Got it. If you change anything in the commands you are running, say so. Otherwise it's bound to cause confusion.

Let's try one more thing:

() (
  emulate -L zsh -o err_return
  local tmp
  tmp="$(mktemp -d ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
  {
    builtin cd -q -- $tmp
    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git
    >.zshrc <<\END
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
source $ZDOTDIR/powerlevel10k/powerlevel10k.zsh-theme
END
    builtin cd -q
    ZDOTDIR=$tmp zsh --no-global-rcs
  } always {
    cd /
    command rm -rf -- $tmp
  }
)

If you get an error again, run this and post the output here:

ps o pid,ppid,pgid,state,comm | grep gitstatus
patrickli commented 2 years ago
Cloning into 'powerlevel10k'...
remote: Enumerating objects: 92, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 92 (delta 13), reused 64 (delta 10), pack-reused 0
Receiving objects: 100% (92/92), 424.95 KiB | 2.46 MiB/s, done.
Resolving deltas: 100% (13/13), done.
gitstatus_query_p9k_:print:56: write error: broken pipe
 patrick@NZ99008ML  ~  ps o pid,ppid,pgid,state,comm | grep gitstatus                                                                                                                  ✔  1  22:03:01
 patrick@NZ99008ML  ~ 

Looks like the gitstatusd is killed. You can see that from the original log I posted.

romkatv commented 2 years ago

Looks like the gitstatusd is killed.

Indeed.

You can see that from the original log I posted.

The original post captures logs from zsh that uses your configs which have a lot more than powerlevel10k. They aren't very useful.

Let's try this:

() (
  emulate -L zsh -o err_return -o xtrace
  zmodload zsh/system
  local tmp
  tmp="$(mktemp ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
  {
    local fd
    zsystem flock -f fd -- $tmp
    if ( zsystem flock -t 1 -- $tmp ); then
      unsetopt xtrace
      print -ru2 -- "flock is broken"
    fi
  } always {
    command rm -rf -- $tmp
  }
)

What's the output?

patrickli commented 2 years ago
+(anon):2> zmodload zsh/system
+(anon):3> local tmp
+(anon):4> tmp=+(anon):4> mktemp /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.XXXXXXXXXX
+mktemp:1> /usr/local/bin/gmktemp /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.XXXXXXXXXX
+(anon):4> tmp=/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.OUYEtjk2z8
+(anon):6> local fd
+(anon):7> zsystem flock -f fd -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.OUYEtjk2z8
+(anon):8> zsystem flock -t 1 -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.OUYEtjk2z8
+(anon):13> rm -rf -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.OUYEtjk2z8
romkatv commented 2 years ago

So flock works. That's good. Let's see the logs then. Run this:

() (
  emulate -L zsh -o err_return
  local tmp
  tmp="$(mktemp -d ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
  {
    builtin cd -q -- $tmp
    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git
    >.zshrc <<\END
GITSTATUS_LOG_LEVEL=DEBUG
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
source $ZDOTDIR/powerlevel10k/powerlevel10k.zsh-theme
END
    builtin cd -q
    ZDOTDIR=$tmp zsh --no-global-rcs
  } always {
    cd /
    command rm -rf -- $tmp
  }
)

When you get prompt, run this:

print '=== xtrace ===' && cat -- $GITSTATUS_XTRACE_POWERLEVEL9K && print '=== daemon ===' && cat -- $GITSTATUS_DAEMON_LOG_POWERLEVEL9K
patrickli commented 2 years ago
Cloning into 'powerlevel10k'...
remote: Enumerating objects: 92, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 92 (delta 13), reused 64 (delta 10), pack-reused 0
Receiving objects: 100% (92/92), 424.95 KiB | 778.00 KiB/s, done.
Resolving deltas: 100% (13/13), done.
gitstatus_query_p9k_:print:56: write error: broken pipe
 patrick@NZ99008ML  ~  print '=== xtrace ===' && cat -- $GITSTATUS_XTRACE_POWERLEVEL9K && print '=== daemon ===' && cat -- $GITSTATUS_DAEMON_LOG_POWERLEVEL9K                          ✔  1  22:24:21

=== xtrace ===
+(anon):7> setopt monitor
+(anon):9> ((  ! _GITSTATUS_STATE_POWERLEVEL9K  ))
+(anon):10> [[ -r /proc/version ]]
+(anon):13> print -rn
+(anon):14> zsystem flock -f lock_fd /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.lock
+(anon):15> [[ 13 == <1-> ]]
+(anon):18> typeset -gi '_GITSTATUS_LOCK_FD_POWERLEVEL9K=lock_fd'
+(anon):20> [[ darwin21.0 == cygwin* ]]
+(anon):41> sysopen -r -o cloexec -u resp_fd /dev/fd/12
+(anon):44> typeset -gi 'GITSTATUS_DAEMON_PID_POWERLEVEL9K=86478'
+(anon):46> [[ 15 == <1-> ]]
+(anon):47> typeset -gi '_GITSTATUS_RESP_FD_POWERLEVEL9K=resp_fd'
+(anon):48> typeset -gi '_GITSTATUS_STATE_POWERLEVEL9K=1'
+(anon):51> ((  ! async  ))
+(anon):52> ((  _GITSTATUS_CLIENT_PID_POWERLEVEL9K == sysparams[pid]  ))
+(anon):54> local pgid
+(anon):55> ((  0 < 20  ))
+(anon):56> [[ -t 15 ]]
+(anon):41> _gitstatus_daemon_p9k_
+(anon):57> sysread -s 20 -t 5.0000000000 -i 15 'pgid[$#pgid+1]'
+_gitstatus_daemon_p9k_:1> local -i pipe_fd
+(anon):55> ((  20 < 20  ))
+(anon):59> [[ '               86478' == \ #<1-> ]]
+(anon):60> typeset -gi 'GITSTATUS_DAEMON_PID_POWERLEVEL9K=pgid'
+(anon):62> sysopen -w -o cloexec -u req_fd -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.fifo
+(anon):63> [[ 14 == <1-> ]]
+(anon):64> typeset -gi '_GITSTATUS_REQ_FD_POWERLEVEL9K=req_fd'
+(anon):66> print -nru 14 -- $'}hello\C-_\C-^'
+(anon):67> local expected=$'}hello\C-_0\C-^' actual
+(anon):68> ((  1  ))
+(anon):68> [[ ! -t 1 ]]
+(anon):71> local -F deadline=1
+(anon):73> true
+(anon):74> [[ -t 15 ]]
+(anon):75> sysread -s 1 -t 5.0000000000 -i 15 actual
+(anon):76> [[ $'}hello\C-_0\C-^' == }* ]]
+(anon):76> break
+(anon):113> ((  deadline == 0  ))
+(anon):126> ((  1 < 9  ))
+(anon):127> [[ -t 15 ]]
+(anon):128> sysread -s 8 -t 5.0000000000 -i 15 'actual[$#actual+1]'
+(anon):126> ((  9 < 9  ))
+(anon):130> [[ $'}hello\C-_0\C-^' == }hello0 ]]
+(anon):144> zle -F 15 _gitstatus_process_response_POWERLEVEL9K-_p9k_
+(anon):157> add-zsh-hook zshexit _gitstatus_cleanup_POWERLEVEL9K-_p9k_
+add-zsh-hook:15> emulate -L zsh
+add-zsh-hook:17> local -a hooktypes
+add-zsh-hook:18> hooktypes=( chpwd precmd preexec periodic zshaddhistory zshexit zsh_directory_name )
+add-zsh-hook:22> local usage='Usage: add-zsh-hook hook function\nValid hooks are:\n  chpwd precmd preexec periodic zshaddhistory zshexit zsh_directory_name'
+add-zsh-hook:24> local opt
+add-zsh-hook:25> local -a autoopts
+add-zsh-hook:26> integer del list help
+add-zsh-hook:28> getopts dDhLUzk opt
+add-zsh-hook:55> shift 0
+add-zsh-hook:57> ((  list  ))
+add-zsh-hook:60> ((  help || 2 != 2 || 6 == 0  ))
+add-zsh-hook:65> local hook=zshexit_functions
+add-zsh-hook:66> local fn=_gitstatus_cleanup_POWERLEVEL9K-_p9k_
+add-zsh-hook:68> ((  del  ))
+add-zsh-hook:83> ((  0  ))
+add-zsh-hook:89> typeset -ga zshexit_functions
+add-zsh-hook:90> set -A zshexit_functions _gitstatus_cleanup_POWERLEVEL9K-_p9k_
+add-zsh-hook:92> autoload -- _gitstatus_cleanup_POWERLEVEL9K-_p9k_
+(anon):162> ((  lock_fd != -1  ))
+(anon):163> zf_rm -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.lock
+(anon):164> zsystem flock -u 13
+(anon):166> unset _GITSTATUS_LOCK_FD_POWERLEVEL9K
+(anon):168> typeset -gi '_GITSTATUS_STATE_POWERLEVEL9K=2'
=== daemon ===
+_gitstatus_daemon_p9k_:3> local pgid=86478
+_gitstatus_daemon_p9k_:4> [[ 86478 == <1-> ]]
+_gitstatus_daemon_p9k_:5> cd -q /
+_gitstatus_daemon_p9k_:90> ((  lock_fd == -1  ))
+_gitstatus_daemon_p9k_:9> trap '' PIPE
+_gitstatus_daemon_p9k_:11> local uname_sm
+_gitstatus_daemon_p9k_:93> zsystem flock -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.lock
+_gitstatus_daemon_p9k_:12> uname_sm=+_gitstatus_daemon_p9k_:12> uname -sm
+_gitstatus_daemon_p9k_:12> uname_sm='darwin x86_64'
+_gitstatus_daemon_p9k_:13> [[ 'darwin x86_64' == [^\ ]##\ [^\ ]## ]]
+_gitstatus_daemon_p9k_:14> local uname_s=darwin
+_gitstatus_daemon_p9k_:15> local uname_m=x86_64
+_gitstatus_daemon_p9k_:17> [[ '' == <1-> ]]
+_gitstatus_daemon_p9k_:20> local cpus
+_gitstatus_daemon_p9k_:21> ((  ! 1  ))
+_gitstatus_daemon_p9k_:21> [[ darwin == linux ]]
+_gitstatus_daemon_p9k_:22> cpus=+_gitstatus_daemon_p9k_:22> sysctl -n hw.ncpu
+_gitstatus_daemon_p9k_:22> cpus=8
+_gitstatus_daemon_p9k_:27> args+=( -t 16 )
+_gitstatus_daemon_p9k_:30> mkfifo -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.fifo
+_gitstatus_daemon_p9k_:31> print -rnu 14 -- '               86478'
+_gitstatus_daemon_p9k_:33> zf_rm -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.fifo
+_gitstatus_daemon_p9k_:35> local _gitstatus_zsh_daemon _gitstatus_zsh_version _gitstatus_zsh_downloaded
+_gitstatus_daemon_p9k_:43> local gitstatus_plugin_dir_var=_gitstatus_plugin_dir_p9k_
+_gitstatus_daemon_p9k_:44> local gitstatus_plugin_dir=/private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus
+_gitstatus_daemon_p9k_:45> set -- -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_daemon_p9k_:47> [[ 1 == (|-|+)<1-> ]]
+_gitstatus_daemon_p9k_:48> source /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus/install
+/private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus/install:469> [ -z '' ']'
+/private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus/install:470> _gitstatus_install_main /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:1> [ -n 5.8 ']'
+_gitstatus_install_main:2> emulate -L sh -o no_unset
+_gitstatus_install_main:7> local argv1=/private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus
+_gitstatus_install_main:8> shift
+_gitstatus_install_main:10> local no_check='' no_install='' uname_s='' uname_m='' gitstatus_dir='' dl_status='' e=''
+_gitstatus_install_main:11> local opt='' OPTARG='' OPTIND=1
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case d (h)
+_gitstatus_install_main:14> case d (n)
+_gitstatus_install_main:14> case d (f)
+_gitstatus_install_main:14> case d (d)
+_gitstatus_install_main:55> [ -n '' ']'
+_gitstatus_install_main:59> [ -z /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus ']'
+_gitstatus_install_main:63> gitstatus_dir=/private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case s (h)
+_gitstatus_install_main:14> case s (n)
+_gitstatus_install_main:14> case s (f)
+_gitstatus_install_main:14> case s (d)
+_gitstatus_install_main:14> case s (p)
+_gitstatus_install_main:14> case s (e)
+_gitstatus_install_main:14> case s (m)
+_gitstatus_install_main:14> case s (s)
+_gitstatus_install_main:99> [ -n '' ']'
+_gitstatus_install_main:103> [ -z darwin ']'
+_gitstatus_install_main:107> uname_s=darwin
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case m (h)
+_gitstatus_install_main:14> case m (n)
+_gitstatus_install_main:14> case m (f)
+_gitstatus_install_main:14> case m (d)
+_gitstatus_install_main:14> case m (p)
+_gitstatus_install_main:14> case m (e)
+_gitstatus_install_main:14> case m (m)
+_gitstatus_install_main:88> [ -n '' ']'
+_gitstatus_install_main:92> [ -z x86_64 ']'
+_gitstatus_install_main:96> uname_m=x86_64
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case p (h)
+_gitstatus_install_main:14> case p (n)
+_gitstatus_install_main:14> case p (f)
+_gitstatus_install_main:14> case p (d)
+_gitstatus_install_main:14> case p (p)
+_gitstatus_install_main:66> [ -n '' ']'
+_gitstatus_install_main:70> [ -z 'printf '\''\001'\'' >&14' ']'
+_gitstatus_install_main:74> dl_status='printf '\''\001'\'' >&14'
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:14> case e (h)
+_gitstatus_install_main:14> case e (n)
+_gitstatus_install_main:14> case e (f)
+_gitstatus_install_main:14> case e (d)
+_gitstatus_install_main:14> case e (p)
+_gitstatus_install_main:14> case e (e)
+_gitstatus_install_main:77> [ -n '' ']'
+_gitstatus_install_main:81> [ -z 14 ']'
+_gitstatus_install_main:85> e=14
+_gitstatus_install_main:13> getopts :s:m:d:p:e:fnh opt -d /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus -s darwin -m x86_64 -p 'printf '\''\001'\'' >&14' -e 14 -- _gitstatus_set_daemon_p9k_
+_gitstatus_install_main:115> shift 11
+_gitstatus_install_main:117> : 14
+_gitstatus_install_main:118> : /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus
+_gitstatus_install_main:120> [ -n '' -a -n '' ']'
+_gitstatus_install_main:125> [ -z darwin ']'
+_gitstatus_install_main:129> [ -z x86_64 ']'
+_gitstatus_install_main:134> local daemon=''
+_gitstatus_install_main:135> local cache_dir=/Users/patrick/.cache/gitstatus
+_gitstatus_install_main:137> [ -z '' ']'
+_gitstatus_install_main:138> [ -n '' ']'
+_gitstatus_install_main:142> [ -z '' -a -e /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus/usrbin/gitstatusd ']'
+_gitstatus_install_main:145> [ -n '' ']'
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line=''
+_gitstatus_install_main:163> [ -n '' ']'
+_gitstatus_install_main:163> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686";    file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686";    file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686";    file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";'
+_gitstatus_install_main:166> uname_s_glob=cygwin_nt-10.0
+_gitstatus_install_main:166> uname_m_glob=i686
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42
+_gitstatus_install_main:168> [ -z cygwin_nt-10.0 -o -z i686 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42 ']'
+_gitstatus_install_main:177> case darwin (cygwin_nt-10.0)
+_gitstatus_install_main:177> case darwin (*)
+_gitstatus_install_main:179> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";'
+_gitstatus_install_main:166> uname_s_glob=cygwin_nt-10.0
+_gitstatus_install_main:166> uname_m_glob=x86_64
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f
+_gitstatus_install_main:168> [ -z cygwin_nt-10.0 -o -z x86_64 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f ']'
+_gitstatus_install_main:177> case darwin (cygwin_nt-10.0)
+_gitstatus_install_main:177> case darwin (*)
+_gitstatus_install_main:179> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="darwin";         uname_m_glob="arm64";   file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="darwin";         uname_m_glob="arm64";   file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="darwin";         uname_m_glob="arm64";   file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe";'
+_gitstatus_install_main:166> uname_s_glob=darwin
+_gitstatus_install_main:166> uname_m_glob=arm64
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe
+_gitstatus_install_main:168> [ -z darwin -o -z arm64 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe ']'
+_gitstatus_install_main:177> case darwin (darwin)
+_gitstatus_install_main:181> case x86_64 (arm64)
+_gitstatus_install_main:181> case x86_64 (*)
+_gitstatus_install_main:183> continue
+_gitstatus_install_main:161> IFS='' +_gitstatus_install_main:161> read -r line
+_gitstatus_install_main:162> line='uname_s_glob="darwin";         uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160";'
+_gitstatus_install_main:163> [ -n 'uname_s_glob="darwin";         uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160";' ']'
+_gitstatus_install_main:165> local uname_s_glob='' uname_m_glob='' file='' version='' sha256=''
+_gitstatus_install_main:166> eval 'uname_s_glob="darwin";         uname_m_glob="x86_64";  file="gitstatusd-${uname_s}-${uname_m}";     version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160";'
+_gitstatus_install_main:166> uname_s_glob=darwin
+_gitstatus_install_main:166> uname_m_glob=x86_64
+_gitstatus_install_main:166> file=gitstatusd-darwin-x86_64
+_gitstatus_install_main:166> version=v1.5.1
+_gitstatus_install_main:166> sha256=b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160
+_gitstatus_install_main:168> [ -z darwin -o -z x86_64 -o -z gitstatusd-darwin-x86_64 -o -z v1.5.1 -o -z b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160 ']'
+_gitstatus_install_main:177> case darwin (darwin)
+_gitstatus_install_main:181> case x86_64 (x86_64)
+_gitstatus_install_main:188> [ -z '' ']'
+_gitstatus_install_main:190> local daemon=/private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus/usrbin/gitstatusd-darwin-x86_64
+_gitstatus_install_main:191> [ ! -e /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/p10k.JcK2PzN7Db/powerlevel10k/gitstatus/usrbin/gitstatusd-darwin-x86_64 ']'
+_gitstatus_install_main:192> daemon=/Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64
+_gitstatus_install_main:193> [ -e /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ']'
+_gitstatus_install_main:195> [ -n /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ']'
+_gitstatus_install_main:196> _gitstatus_install_daemon_found 0 _gitstatus_set_daemon_p9k_
+_gitstatus_install_daemon_found:1> local installed=0
+_gitstatus_install_daemon_found:2> shift
+_gitstatus_install_daemon_found:3> [ 1 '=' 0 ']'
+_gitstatus_install_daemon_found:3> _gitstatus_set_daemon_p9k_ /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 v1.5.1 0
+_gitstatus_set_daemon_p9k_:1> _gitstatus_zsh_daemon=/Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64
+_gitstatus_set_daemon_p9k_:2> _gitstatus_zsh_version=v1.5.1
+_gitstatus_set_daemon_p9k_:3> _gitstatus_zsh_downloaded=0
+_gitstatus_install_main:197> return
+_gitstatus_daemon_p9k_:49> [[ -n /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ]]
+_gitstatus_daemon_p9k_:50> [[ -n v1.5.1 ]]
+_gitstatus_daemon_p9k_:51> [[ 0 == [01] ]]
+_gitstatus_daemon_p9k_:53> ((  UID == EUID  ))
+_gitstatus_daemon_p9k_:54> local home=/Users/patrick
+_gitstatus_daemon_p9k_:62> [[ -x /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 ]]
+_gitstatus_daemon_p9k_:63> HOME=/Users/patrick /Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64 -G v1.5.1 -s 1 -u 1 -d 1 -c 1 -m -1 -v DEBUG -t 16
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[0]: "/Users/patrick/.cache/gitstatus/gitstatusd-darwin-x86_64"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[1]: "-G"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[2]: "v1.5.1"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[3]: "-s"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[4]: "1"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[5]: "-u"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[6]: "1"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[7]: "-d"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[8]: "1"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[9]: "-c"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[10]: "1"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[11]: "-m"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[12]: "-1"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[13]: "-v"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[14]: "DEBUG"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[15]: "-t"
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:186] argv[16]: "16"
[2021-12-03 22:24:21 0000000110945600 INFO src/thread_pool.cc:81] Spawning 16 thread(s)
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:201] Processing request: "}hello" for ""
[2021-12-03 22:24:21 0000000110945600 INFO src/response.cc:69] Replying without git status
[2021-12-03 22:24:21 0000000110945600 INFO src/timer.cc:64] Timing for: request: 0.031ms cpu
[2021-12-03 22:24:21 0000000110945600 INFO src/gitstatus.cc:204] Successfully processed request: "}hello" for ""
+_gitstatus_daemon_p9k_:93> [[ -e /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.lock ]]
+_gitstatus_daemon_p9k_:94> zf_rm -f -- /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.lock /private/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T/gitstatus.POWERLEVEL9K.503.86453.1638523461.1.fifo
+_gitstatus_daemon_p9k_:95> kill -- -86478
 patrick@NZ99008ML  ~ 
romkatv commented 2 years ago

That's intriguing. Let's try this:

() {
  emulate -L zsh -o err_return
  zmodload zsh/system
  zmodload -F zsh/files b:zf_rm
  local tmp fd
  {
    tmp="$(mktemp ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
    zsystem flock -f fd -- $tmp
    {
      zsystem flock -- $tmp
      [[ ! -e $tmp ]]
    } &
    command sleep 1
    zf_rm -- $tmp
    zsystem flock -u $fd
    fd=
    if ! wait %; then
      print -ru2 -- "filesystem is broken"
      return 1
    fi
  } always {
    unsetopt err_return
    [[ -z $tmp ]] || command rm -f -- $tmp
    [[ -z $fd  ]] || zsystem flock -u $fd
  }
}

I have a good feeling about this one.

patrickli commented 2 years ago
+(anon):2> zmodload zsh/system
+(anon):3> zmodload -F zsh/files b:zf_rm
+(anon):4> local tmp fd
+(anon):6> tmp=+(anon):6> mktemp /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.XXXXXXXXXX
+mktemp:1> /usr/local/bin/gmktemp /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.XXXXXXXXXX
+(anon):6> tmp=/var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.ugNJ6JXEjr
+(anon):8> local fd
fd=''
+(anon):9> zsystem flock -f fd -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.ugNJ6JXEjr
[2] 87713
+(anon):11> zsystem flock -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.ugNJ6JXEjr
+(anon):14> sleep 1
+(anon):15> zf_rm -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.ugNJ6JXEjr
+(anon):12> [[ ! -e /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.ugNJ6JXEjr ]]
+(anon):16> zsystem flock -u 14
+(anon):17> fd=''
[2]  + 87713 exit 1     { zsystem flock -- $tmp; [[ ! -e $tmp ]]; }
+(anon):18> wait %
(anon):wait:18: %: no such job
+(anon):19> unsetopt xtrace
filesystem is broken
romkatv commented 2 years ago

That's amazing! Let's try to narrow it down.

() {
  emulate -L zsh -o err_return
  zmodload zsh/datetime
  zmodload -F zsh/files b:zf_rm
  local tmp
  {
    tmp="$(mktemp ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
    local -i iters
    local -F start=EPOCHREALTIME
    zf_rm -- $tmp
    while [[ -e $tmp ]]; do
      (( ++iters ))
    done
    if (( iters )); then
      local -F took_ms='1e3 * (EPOCHREALTIME - start)'
      print -r -- "filesystem is broken"
      typeset -p iters took_ms
    else
      print -r -- "filesystem works fine"
    fi
  } always {
    unsetopt err_return
    [[ -z $tmp ]] || command rm -f -- $tmp
  }
}
patrickli commented 2 years ago

filesystem works fine

romkatv commented 2 years ago

Fascinating. Your filesystem has a bug, which is likely caused by the DLP software you are using. Basically, the script I posted in https://github.com/romkatv/powerlevel10k/issues/1655#issuecomment-985368364 shouldn't print "filesystem is broken" on a working filesystem.

Which DLP software are you using?

It's probably possible to work around this bug in gitstatus but I cannot promise to implement it.

patrickli commented 2 years ago

Yeah. This DLP software does quite a few things. Including but not limited to, screen recording, file level encryption and maybe remote control?

It is this thing: http://ip-guard.com/en/

patrickli commented 2 years ago

I could try to report this to the vendor, as we already have a reproducible example here. Do you mind explain what should be the correct behavior and how you manage to cause it? I can see you are trying to aquire a lock file but how does it different from creating a normal file?

romkatv commented 2 years ago

I sent IP-guard a bug report.

Date: Fri, 3 Dec 2021 11:02:36 +0100 Subject: BUG: IP-guard breaks filesystem on Darwin 21.1.0 x86_64 From: Roman Perepelitsa roman.perepelitsa@gmail.com To: techsupport@ip-guard.com

To reproduce:

  1. Install IP-guard on Darwin 21.1.0 x86_64.
  2. Open Terminal.
  3. Start zsh if not already started.
  4. Run this command:
    () {
    emulate -L zsh -o err_return
    zmodload zsh/system
    zmodload -F zsh/files b:zf_rm
    local tmp fd
    {
      tmp="$(mktemp ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
      zsystem flock -f fd -- $tmp
      {
        zsystem flock -- $tmp
        [[ ! -e $tmp ]]
      } &
      command sleep 1
      zf_rm -- $tmp
      zsystem flock -u $fd
      fd=
      if ! wait %; then
        print -ru2 -- "filesystem is broken"
        return 1
      fi
    } always {
      unsetopt err_return
      [[ -z $tmp ]] || command rm -f -- $tmp
      [[ -z $fd  ]] || zsystem flock -u $fd
    }
    }
  • Expected behavior: the command does NOT print "filesystem is broken".
  • Actual behavior: the command prints "filesystem is broken".

Disabling IP-guard fixes the issue.

Roman.

romkatv commented 2 years ago

zsystem flock is documented in man zshmodules (search for "flock").

romkatv commented 2 years ago

I could try to report this to the vendor, as we already have a reproducible example here.

That probably wouldn't hurt. There is a fair chance my bug report will be ignored.

patrickli commented 2 years ago

I think it is important to understand (and thus explain) what exactly is broken.

I've added some comments to the test code. Can you explain the questions for me please?

() {
  # initialization
  emulate -L zsh -o err_return
  zmodload zsh/system
  zmodload -F zsh/files b:zf_rm
  local tmp fd
  {
    # make a temp file to lock
    tmp="$(mktemp ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
    local fd
    # lock the temp file
    zsystem flock -f fd -- $tmp
    {
      # start a background process trying to acquire the lock
      zsystem flock -- $tmp # this will block because file is locked
      [[ ! -e $tmp ]]
    } & # send to the background
    command sleep 1
    zf_rm -- $tmp # delete the temp file, thus releasing the lock?
    zsystem flock -u $fd # explicitly release the lock.
    # At this stage the background process should fail? because the lock is released but the file to lock is no longer exist.
    # or would it succeed because it can now acquire a lock?
    fd=
    if ! wait %; then # wait for all background jobs? At this point there should be no jobs running because the background lock process has exited. So wouldn't it be the correct behaviour that this block is executed? 
      print -ru2 -- "filesystem is broken"
      return 1
    fi
  } always {
    # always clean up
    unsetopt err_return
    [[ -z $tmp ]] || command rm -f -- $tmp
    [[ -z $fd  ]] || zsystem flock -u $fd
  }
}
romkatv commented 2 years ago

Here's a better test case. I've also added comments to it.

() {
  emulate -L zsh -o err_return -o no_notify -o prompt_percent
  zmodload zsh/system
  zmodload -F zsh/files b:zf_rm
  local tmp fd

  {
    tmp="$(mktemp ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
    zsystem flock -f fd -- $tmp

    # This block runs in a background process.
    {
      local PS4='%F{3}background process:%f '
      setopt xtrace

      # On a working system this will block until the line
      # marked "B" is executed. On a system with IP-guard
      # this will block only until the line marked "A" is
      # executed.
      zsystem flock -- $tmp

      # On a working system the following test succeeds. On
      # a system with IP-guard it fails. This is a direct
      # consequence of `zsystem flock -- $tmp` behaving
      # differently when the file is unlinked (see the comment
      # above).
      [[ ! -e $tmp ]]
    } &

    local PS4='%F{5}foreground process:%f '

    # This block runs in the foreground process concurrently
    # with the background process.
    () {
      setopt xtrace

      command sleep 1
      zf_rm -- $tmp         # A

      command sleep 1
      zsystem flock -u $fd  # B

      command sleep 1
    }

    # Wait for the background process to finish.
    if wait $!; then
      print -P -- '\nFilesystem %F{2}works%f!'
    else
      print -Pu2 -- '\nFilesystem is %F{1}broken%f!'
      return 1
    fi
  } always {
    unsetopt err_return
    [[ -z $tmp ]] || command rm -f -- $tmp
  }
}

Try running it on a system with IP-guard and without and compare the traces.

romkatv commented 2 years ago

Let's try a workaround. If it works, I'll apply it to gitstatus and you won't get errors even with IP-guard.

Please run this code on a system with IP-guard and post the output here:

() {
  emulate -L zsh -o err_return -o no_notify -o prompt_percent
  zmodload zsh/system
  zmodload -F zsh/files b:zf_rm
  local tmp fd

  {
    tmp="$(mktemp ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
    zsystem flock -f fd -- $tmp

    {
      local PS4='%F{3}background process:%f '
      setopt xtrace

      zsystem flock -- $tmp
      command sleep 2
      [[ ! -e $tmp ]]
    } &

    local PS4='%F{5}foreground process:%f '

    () {
      setopt xtrace
      command sleep 3
      zf_rm -- $tmp
      command sleep 1
      zsystem flock -u $fd
      command sleep 1
    }

    if wait $!; then
      print -P -- '\nFilesystem %F{2}works%f!'
    else
      print -Pu2 -- '\nFilesystem is %F{1}broken%f!'
      return 1
    fi
  } always {
    unsetopt err_return
    [[ -z $tmp ]] || command rm -f -- $tmp
  }
}
patrickli commented 2 years ago
[2] 41665
background process: zsystem flock -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.Vj2lACvc6w
foreground process: sleep 3
foreground process: zf_rm -- /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.Vj2lACvc6w
background process: sleep 2
foreground process: sleep 1
foreground process: zsystem flock -u 20
foreground process: sleep 1
background process: [[ ! -e /var/folders/km/8ygsr3lj0yn_14whfnj5gnpw0000gq/T//p10k.Vj2lACvc6w ]]
[2]  + 41665 done       { local PS4='%F{3}background process:%f ' ; setopt xtrace; zsystem flock -- ;}

Filesystem works!
patrickli commented 2 years ago

So essentially, when IP guard kext is loaded, when unlinking a file, the related lock will be released immediately. In normal circumstances the lock will still hold and only be released if done so explicitly. Is that a correct understanding?

romkatv commented 2 years ago

So essentially, when IP guard kext is loaded, when unlinking a file, the related lock will be released immediately. In normal circumstances the lock will still hold and only be released if done so explicitly. Is that a correct understanding?

That's exactly my understanding of the bug in IP-guard.

romkatv commented 2 years ago

I've implemented a workaround in https://github.com/romkatv/gitstatus/commit/f1cf61b241a2a34514a8ff5f71dfb79a99d85c7c and merged it into powerlevel10k. Please update powerlevel10k and let me know if it works for you.

patrickli commented 2 years ago

Works perfectly. Also you don't even need to sleep for 5. Just 1 second will fix it.

romkatv commented 2 years ago

It's a race condition. If one of the processes doesn't get scheduled within 1 second, you'll get the same error as before. Normally this won't happen but under high load it might. With a 5s delay this becomes significantly less likely.

romkatv commented 2 years ago

Thanks for your assistance in debugging this.

patrickli commented 2 years ago

I've got an updated package from the vendor. I will give it a go later and see if it is fixed.

romkatv commented 2 years ago

Wow, that was fast. I'm impressed.