romkatv / gitstatus

Git status for Bash and Zsh prompt
GNU General Public License v3.0
1.68k stars 106 forks source link

[ERROR]: gitstatus failed to initialize. #425

Closed Xqing-hup closed 6 months ago

Xqing-hup commented 6 months ago

[ERROR]: gitstatus failed to initialize. Zsh log (/data/data/com.termux/files/usr/tmp/gitstatus.POWERLEVEL9K.10229.11271.1710142447.1.xtrace.log):
+(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 /data/data/com.termux/files/usr/tmp/gitstatus.POWERLEVEL9K.10229.11271.1710142447.1.lock +(anon):15> [[ 15 == <1-> ]] +(anon):18> typeset -gi '_GITSTATUS_LOCK_FD_POWERLEVEL9K=lock_fd' +(anon):20> [[ linux-android == cygwin* ]] +(anon):41> sysopen -r -o cloexec -u resp_fd /proc/self/fd/14 +(anon):44> typeset -gi 'GITSTATUS_DAEMON_PID_POWERLEVEL9K=23578' +(anon):46> [[ 17 == <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_daemonp9k +_gitstatus_daemonp9k: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 17 ]] +(anon):57> sysread -s 20 -t 10.0000000000 -i 17 'pgid[$#pgid+1]' +(anon):57> return

Daemon log (/data/data/com.termux/files/usr/tmp/gitstatus.POWERLEVEL9K.10229.11271.1710142447.1.daemon.log):

+_gitstatus_daemon_p9k_:3> local pgid=23578
+_gitstatus_daemon_p9k_:4> [[ 23578 == <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_:12> uname_sm=+_gitstatus_daemon_p9k_:12> uname -sm
+_gitstatus_daemon_p9k_:93> zsystem flock -- /data/data/com.termux/files/usr/tmp/gitstatus.POWERLEVEL9K.10229.11271.1710142447.1.lock

System information:

zsh:      5.9
uname -a: Linux localhost 5.15.94-android13-8-g8adda06e6c92-ab1704772536 #1 SMP PREEMPT Thu Feb 22 13:07:18 CST 2024 aarch64 Android
romkatv commented 6 months ago

Looks like flock hangs. What happens if you run the following command?

touch ~/lock && zmodload zsh/system && zsystem flock ~/lock && print success
Xqing-hup commented 6 months ago

Looks like flock hangs. What happens if you run the following command?

touch ~/lock && zmodload zsh/system && zsystem flock ~/lock && print success

touch ~/lock && zmodload zsh/system && zsystem flock ~/lock && print successS40311-16252434_com.termux.png

S40311-16270187_com.android.settings.png

My Android version is 14, but uname -a is 13

romkatv commented 6 months ago

You had to kill it with Ctrl-C when you ran it the first time, right? This confirms that flock is broken on your system. If you choose to report it to Termux, here's how you can describe the issue:

You don't need to mention powerlevel10k. In fact, if you mention powerlevel10k, it will be more difficult for the developers to understand what's going on.

romkatv commented 6 months ago

As a workaround you can disable vcs prompt segment in powerlevel10k. To do that:

  1. Open ~/.p10k.zsh in a text editor.
  2. Search for "vcs".
  3. Comment out the first match.
  4. Save the file and restart zsh with exec zsh.

Note that you won't see git status in prompt anymore.

Xqing-hup commented 6 months ago

As a workaround you can disable vcs prompt segment in powerlevel10k. To do that:

  1. Open ~/.p10k.zsh in a text editor.
  2. Search for "vcs".
  3. Comment out the first match.
  4. Save the file and restart zsh with exec zsh.

Note that you won't see git status in prompt anymore. thank S40311-16404373_com.termux.png

romkatv commented 6 months ago

You are welcome. If you file an issue against Termux, please post a link here.

Xqing-hup commented 6 months ago

You had to kill it with Ctrl-C when you ran it the first time, right? This confirms that flock is broken on your system. If you choose to report it to Termux, here's how you can describe the issue:

  • What I do:
    zsh -fc 'touch ~/lock && zmodload zsh/system && zsystem flock ~/lock && print success'
  • What I expect: The command prints "success".
  • What actually happens: The command hangs and I have to kill it with Ctrl-C.

You don't need to mention powerlevel10k. In fact, if you mention powerlevel10k, it will be more difficult for the developers to understand what's going on.

termux does not support Android 14 and cannot be installed, so I choose the third-party version of termux (tel)

Xqing-hup commented 6 months ago

You had to kill it with Ctrl-C when you ran it the first time, right? This confirms that flock is broken on your system. If you choose to report it to Termux, here's how you can describe the issue:

  • What I do:
    zsh -fc 'touch ~/lock && zmodload zsh/system && zsystem flock ~/lock && print success'
  • What I expect: The command prints "success".
  • What actually happens: The command hangs and I have to kill it with Ctrl-C.

You don't need to mention powerlevel10k. In fact, if you mention powerlevel10k, it will be more difficult for the developers to understand what's going on.

termux does not support Android 14 and cannot be installed, so I choose the third-party version of termux (tel) https://github.com/t-e-l/tel

romkatv commented 6 months ago

If you file an issue against tel, please post a link here.

Xqing-hup commented 6 months ago

If you file an issue against tel, please post a link here. Some software cannot be used (sshd, docker daemon), and the background does not seem to be running. S40311-16510931_com.termux.png

Xqing-hup commented 6 months ago

If you file an issue against tel, please post a link here. Some software cannot be used (sshd, docker daemon), and the background does not seem to be running. S40311-16510931_com.termux.png

romkatv commented 6 months ago

All these issues are unrelated to powerlevel10k.