X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=r7P gzRQlq2r9MPZwF7Jq6mYNRrj9bPVJ+ybxz6i7Af+KzIAv70WllTaDQvA5LvunGRK dMy/p/nJEUBWmS8kV5oiqWHAzLUEcXep45UfzVfg/Ot9vrWCS04SPud6d925lz2g +HcLfRoTaZrTtsOxr979MfdvQAAaZC5GenVgQvvI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=L/NHmXfrs tGAfY5kMKsEa6CdGKo=; b=HUAIHlE3sj2nOsJFZMf0kQtGLoIKK7RAr0dNsB1AT mf1T4p2S8IDL73O6f8XWzbQP8BkdsDZNcXfthAEDdXBU0DQxOS+MGCgloBT62XfI 7SuTvsZL4hXPw0meg5mWx8170tJEQE7ggPf0/9xhjuLS849s0YEtobKQDqvgqytM fI= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Spam-SWARE-Status: No, score=3.5 required=5.0 tests=AWL,BAYES_50,BOTNET,RDNS_NONE autolearn=no version=3.3.1 From: Devin Nate To: "cygwin AT cygwin DOT com" Subject: ssh.exe on cygwin: Write error / odd problem, any hints welcome Date: Sat, 13 Jul 2013 18:19:19 +0000 Message-ID: <19F61B611B92744EAB1F9B19D0A0E2B1812E09DC@EXCHANGE1.QuadrantHR.com> Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r6DIJhiH023057 Dear cygwin list; I'm having a problem, which appears related to Cygwin / ssh / Windows. It's evidenced by 'Write failed: Connection reset by peer". Others have reported it when using rsync with Cygwin, but it's actually an error that comes from ssh.exe, and I've duplicated the error by pasting a large amount of data into a ssh window. 1. With respect to rsync, it might be because of select() determining that the pipe file handle to ssh is writable when it isn't. I understand this has been a problem in the past, and may still be. This is not the avenue I'm even chasing right now, so please don't evenyone note that select + pipe writeability + Cygwin is a persistent problem. 2. I suspect ssh.exe + Cygwin is deadlocking somewhere. It's especially likely that the client and server keepalive mechanism is involved as I'm able to consistently reproduce errors and just prior to getting the Write failed message, I get a keepalive packet. This is the problem I started out actually trying to solve. 3. My reason for writing this list, however, is that there appears to be some sort of a global resource that I managed to bugger up, and only a reboot corrected. Having been experimenting with overflowing ssh.exe by pasting a great deal of info into it while connected to a server and putting various debug statements into ssh.exe to track down the issue, I decided to give plink.exe a try. I was thinking maybe the problem was with windows itself somehow, so give a different program NOT using ssh.exe or Cygwin a try. I did that, and having done that...the outcome was that a number of ssh.exe processes that we normally run for maintenance jobs all started failing intermittently to the test server. I then shut down 100% of all software using Cygwin, and all the ssh.exe processes. we gave it 5 minutes or so, and then started up the maintenance ssh.exe processes again (they do various port forwardings). They continued to exhibit problems moving port forwarded data. the ssh.exe processes don't use stdin/stdout or pipes, they're all network based.... I don't think they use any of stdin/stdout/stderr or pipes for pure network forward channels. I completely appreciate this isn't entirely a Cygwin problem. That said, is anyone aware of any static buffers or other resources built within cgywin, or used by Cygwin but that are static in Windows, that could have been filled or exhausted - I don't even know an avenue to chase now, and soliciting hints. i.e. something whereby if I paste "too much" data into plink.exe on stdin that somehow some cgywin ssh.exe processes start having problems, and moreover would not recover by stopping all Cygwin processes and restarting. Any hints or pointers to any code within openssh, Cygwin, etc, that might be worth poking around in and adding debug statements. The good news is this is the first time we've seen anything remotely like this, and have a fairly extensive install base. We seem to be able to duplicate on our test setup consistently, which is good. It happens to be win 2008 R2. We've never seen any evidence of fork() or other problems that more typically get reported. Thanks, Devin -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple