Processes get defunct on Cygwin #13
Comments
|
Can you reproduce it with Bash instead of Go and give me the script please? |
|
Also please tell me the libevent versions you are using with tmux 1.9 and 2.0? Are they the same? |
|
|
A very easy reproducer, run cmd.exe in one window, and tmux goes to defunct state soon and gets really really slow. |
|
Can you try this please and see if the problem goes away? |
|
If it does, please try moving the returns you added down below the tcgetpgrp lines like this: And see if the problem comes back. |
|
In both cases bug is gone and tmux is really responsive as expected. |
|
If you remove the return from osdep_get_cwd but not osdep_get_name, does the problem come back? |
|
Yes the problem comes back. |
|
Ok, it sounds like there is a problem with /proc/*/cmdline with native processes, I suspect either Cygwin has a bug which is making tmux have to read a lot of data from the cmdline file, or Cygwin is having to go off and do a lot of slow, extra work that it doesn't have to do for Cygwin processes. I expect you would have mentioned if tmux did not actually rename the window to cmd.exe so I suspect the second idea is true. I suggest you report this to Cygwin. If they can't or won't fix it, I would be fine with making tmux disable automatic-rename for native processes, but I need to know if there is a way to detect them (is there something in /proc to look at?). As a workaround, you can just turn off automatic-rename either globally with -g or just for the window where you are running the native process. |
|
Thanks but I can't reproduce it with usual tools, I run cmd.exe under bash and
So thats where the defunct title is coming. It takes 1s to get that output (quite slow compared to the native cygwin procs.) I'll try to find out if there is a way to find if a program is native-cygwin or not. |
|
Btw with "set -g automatic-rename off" there is a noticable slowdown. |
|
A second is too long, tmux does this for every window twice a second. -------- Original message -------- Thanks but I can't reproduce it with usual tools, I run cmd.exe under bash and cat /proc/6784/cmdline — |
|
Well, if it reads on Cygwin then it can decide its non-cygwin program and stop. |
|
Is there a way to also stop cwd reading for current process? Thats also very slow for non-Cygwin apps. |
|
No because then when you stop the program it wouldn't know to start again. It needs something fast it can check to tell it not to open cmdline at all. Or better it needs it not to be so ridiculously slow, ask the Cgywin ML. |
|
Any way to detect native processes can be used for both cmd and cwd. But there is no point in adding workarounds if they could fix it in Cgywin :-). |
|
I am writing to cygwin list, hopefully this can be fixed. Thanks a lot for insight! |
|
Ok what does automatic-rename rename the windows with native processes in to now? |
|
For native Windows processes it shows "" now. |
|
Alright well I guess that will do. Thanks for getting this fixed. |
|
Thanks for the clues :) |
|
Just an update, with https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=commitdiff;h=575ec00a43ae3bbc84d5dab1233c3f95fdad18d0 Cygwin now shows real cmdline and cwd for non-native cygwin processes. |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is originally reported at https://cygwin.com/ml/cygwin/2015-05/msg00314.html , how to reproduce. Build and compile the following Go program
package main
import (
"fmt"
"time"
)
func main() {
for i := 0; ; i++ {
fmt.Println(i)
time.Sleep(500*time.Millisecond)
}
}
Run it in one window and try to switch, it will eventually switch but will take a lot of time. And if you wait long enough it'll put title on the window. I have this semi-regularly happening with ssh running under a tmux window.
The text was updated successfully, but these errors were encountered: