Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Livelock if attaching a session in a circular way #6

Open
whisperity opened this issue Oct 25, 2022 · 0 comments
Open

Livelock if attaching a session in a circular way #6

whisperity opened this issue Oct 25, 2022 · 0 comments
Labels
Kind: Bug 🐞 Something isn't working Target: Core 💥 Core architectural support library Target: Reference implementation 📃 The "official" Client & Server implementations

Comments

@whisperity
Copy link
Owner

whisperity commented Oct 25, 2022

  1. Create and attach to session A
  2. From within A, create and attach to session B
  3. From within B, attach to session A

Both clients' and the server's CPU use will spike once it starts communicating data between the sessions recursively, resulting in a livelock of the affected sessions. On powerful enough systems, it seems that scheduling and queueing allow for other sessions to survive this ordeal.

Note: It is enough if session A recursively attaches to session A.

It is not trivial to detect and keep track of what session is attached to what other session, and while it could technically be possible, it is not worth the effort. A blanket denial of recursive Monomux attaches should be implemented instead. (This is how tmux does it, by the way: "[...] sessions should be nested with care, unset TMUX and try again [...]".)

@whisperity whisperity added Kind: Bug 🐞 Something isn't working Target: Core 💥 Core architectural support library Target: Reference implementation 📃 The "official" Client & Server implementations labels Oct 25, 2022
@whisperity whisperity changed the title Livelock is attaching a session in a circular way Livelock if attaching a session in a circular way Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Bug 🐞 Something isn't working Target: Core 💥 Core architectural support library Target: Reference implementation 📃 The "official" Client & Server implementations
Projects
None yet
Development

No branches or pull requests

1 participant