Bug 1758 - client hangs when closing a multiplexed session with \n~.
Summary: client hangs when closing a multiplexed session with \n~.
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 5.4p1
Hardware: Other Mac OS X
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_6
  Show dependency treegraph
 
Reported: 2010-04-16 19:35 AEST by Maarten Billemont
Modified: 2011-01-24 12:34 AEDT (History)
1 user (show)

See Also:


Attachments
send-close-on-mux-session-close.diff (1.74 KB, patch)
2010-04-17 17:02 AEST, Damien Miller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten Billemont 2010-04-16 19:35:26 AEST
Initiate a ControlMaster session:

ssh -M foo

In a new terminal, start a new session that uses the ControlMaster connection:

ssh foo

Terminate the second by using the standard sequence "\n~.", the client will hang.  It will still respond to signals, but cannot be terminated from its terminal.  Eg. hitting ^C or ^Z has no effect (which, I recon, is not that surprizing as they don't affect the client process either while the connection is still active; they just get sent to the remote shell- that makes loosing the terminal no less annoying, though).

The only way to escape this situation and regain control over the controlling terminal is by opening another and signaling the ssh client or terminating the ControlMaster connection.
Comment 1 Damien Miller 2010-04-17 17:02:46 AEST
Created attachment 1839 [details]
send-close-on-mux-session-close.diff

Unblock sending of SSH2_MSG_CHANNEL_CLOSE on mux sessions
Comment 2 Damien Miller 2010-04-17 17:03:26 AEST
I think this patch should fix it, but I need to test a few corner cases.
Comment 3 Damien Miller 2010-04-24 08:28:09 AEST
patch applied, this will be in OpenSSH-5.6. Thanks for the report.
Comment 4 Damien Miller 2011-01-24 12:34:06 AEDT
Move resolved bugs to CLOSED after 5.7 release