Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hanging processes on windows #857

Closed
kaddkaka opened this issue Jun 7, 2021 · 9 comments
Closed

Hanging processes on windows #857

kaddkaka opened this issue Jun 7, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@kaddkaka
Copy link

kaddkaka commented Jun 7, 2021

Describe the bug

Some times when wezterm stops with ~"process terminated" and after closing the window with alt-f4, there is still some process running on window.

Environment (please complete the following information):

  • OS: Windows 10 - version 1809
  • Version: wezterm 20210531-223926-20c4dcdc

To Reproduce

  1. Start wezterm in ssh mode: wezterm-gui.exe --ssh user@remote
  2. Start a tmux session (not sure if needed)
  3. Let the connection drop (for example disconnecting wifi) (I had this triggered by power saving options)
    • Wait until the wezterm window is unresponsive
  4. Close the window with alt-f4

After this, the processes are still alive in task manager (2 for each instance closed this way). See picture.

Configuration

No custom config file

Expected behavior

The process should be killed completely and no longer take up system resources.

Screenshots

wez_hanged

@kaddkaka kaddkaka added the bug Something isn't working label Jun 7, 2021
@wez
Copy link
Owner

wez commented Jun 7, 2021

I couldn't trivially reproduce this.
Are you sure that those are wezterm-gui.exe processes?
Task Manager does some aggregation that can be misleading; make sure that you've expanded any chevron to the left, and then right click on the item(s) to call up the properties to confirm which process it is.

@wez wez added the waiting-on-op Waiting for more information from the original poster label Jun 7, 2021
@kaddkaka
Copy link
Author

kaddkaka commented Jun 7, 2021

Yes it seems to be wezterm-gui:

image

@no-response no-response bot removed the waiting-on-op Waiting for more information from the original poster label Jun 7, 2021
@kaddkaka
Copy link
Author

kaddkaka commented Jul 2, 2021

This still happens for me regularly. I added a sub-step under 3. in the description.

Is there some log or similar I can try to collect?

wez added a commit that referenced this issue Jul 17, 2021
I saw this in the stderr logs when the connection was offline:

```
 2021-07-17T01:54:28.036Z ERROR wezterm_ssh::session           > Failed to write data to channel: Failure while draining incoming flow. Now
what?
 2021-07-17T01:54:28.036Z ERROR wezterm_ssh::session           > Failed to write data to channel: Failure while draining incoming flow. Now
what?
 2021-07-17T01:54:28.142Z ERROR wezterm_ssh::session           > Failed to write data to channel: Failure while draining incoming flow. Now
what?
```

This commit propagates the error rather than logging and ignoring it.

In addition, remove a couple of sources of blocking or panicking
that are now unmasked by this.

Possibly the root cause of #857
@wez
Copy link
Owner

wez commented Jul 17, 2021

I don't know if this was what you were seeing, but I pushed a fix for something I've seen a bit this past week. Let me know if the next nightly build works for you (in ~30 mins from now).

@wez wez added the waiting-on-op Waiting for more information from the original poster label Jul 17, 2021
@kaddkaka
Copy link
Author

Tried once now, and I immediately noticed that I got a reply when I tried to interact with the window (After point 3 in original post):
[Process didn't exit cleanly. (exit_behavior="CloseOnCleanExit")]

I did not see any process in Task manager after this. Hopefully it has been solved :)

@no-response no-response bot removed the waiting-on-op Waiting for more information from the original poster label Jul 20, 2021
wez added a commit that referenced this issue Jul 22, 2021
@kaddkaka
Copy link
Author

Today I found a hanged process again after the scenario described in this thread. I'm currently still running version wezterm 20210718-221318-5904140a however.

Has there been any updates in this area the last month? I will update version and get back with an update.

@kaddkaka
Copy link
Author

kaddkaka commented Sep 8, 2021

I thought I saw some comment from someone regarding a fix for this, but I don't see it now.

I updated my wezterm version yesterday, but I have seen hanging processes again, unfortunately. I currently don't have any ideas on how to troubleshoot it though. The amount of memory that the ghost processes use are in the 30- 170MB

wez_hanged_2021_09_08

@bew
Copy link
Contributor

bew commented Oct 12, 2021

I'm exclusively using a nightly version (currently at WezTerm-windows-20211003-221001-68418b89) and I still see hanging wezterm-gui processes, eating ~12% of CPU continuously.
I can ~reproduce it from one day to another, where the laptop goes to sleep and wezterm ssh is frozen. On resume, the window is unresponsive, first key press shows the [Process didn't exit cleanly. (exit_behavior="CloseOnCleanExit")] message and closing the window manually doesn't kill the wezterm-gui process.
(for some reason, putting the laptop to sleep myself doesn't seem to reproduce the issue for now)

I'll try to get logs with WEZTERM_LOG=wezterm_ssh=trace,info, we'll see..
Edit (2 days after): I don't have any logs showing a problem, even though the process finally hang and eats CPU..
@wez What else can I log? (without logging everything if possible, as it'll probably run for a day or two before the problem is visible..)

note: No logs through MSYS2, but works in cmd.exe

For some reason I can't get any logs.. I even tried with WEZTERM_LOG=trace but the process doesn't output anything.. (I'm trying to run it from a bash shell in MSYS2, in another wezterm window.
Running it from a cmd.exe prompt does work though, maybe some incompatibility between msys2 and the windows build of wezterm)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants