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

putty cygwin closes when large flood comes from terminal #39

Closed
GoogleCodeExporter opened this issue Apr 15, 2015 · 11 comments
Closed

putty cygwin closes when large flood comes from terminal #39

GoogleCodeExporter opened this issue Apr 15, 2015 · 11 comments

Comments

@GoogleCodeExporter
Copy link

Run a program that produces a bunch of output, and cygwin putty dies.

I think this is due to the cthelper buffers running out of room, or 
something like that.  It looks like the putty side of things just gets an 
FD_CLOSE from the socket, so I think the problem has to be in cthelper.

Repro:
Compile this and run it:
 #include <iostream>
 int main() { for (int i = 0;;) { std::cout << i++ << '\n'; } }
%./a.exe
[prints a bunch of growing numbers and then putty closes at around 16k]

PutTTYcyg version: 0.60
Cygwin version: 1.7.2
Windows version: windows 7

Original issue reported on code.google.com by jordan.d...@gmail.com on 6 May 2010 at 4:18

@GoogleCodeExporter
Copy link
Author

Another way to reproduce this is just making a loop that produces enough 
flooding, such as "yes"

Original comment by sergtz....@gmail.com on 16 Jun 2010 at 3:37

@GoogleCodeExporter
Copy link
Author

cthelper maintains non-blocking pipes to PuTTY and Cygwin and asks the select() 
function whether it can write to them without blocking. Alas, it seems that 
select() sometimes says "yes" even when the pipes are full. This may be a 
Cygwin limitation:

<blockquote 
cite="http://www.cygwin.com/faq/faq-nochunks.html#faq.api.net-functions">
The POSIX select system call can wait on a standard file handles and handles to 
sockets. The select call in Winsock can only wait on sockets. Because of this, 
the Cygwin dll does a lot of nasty stuff behind the scenes, trying to persuade 
various Winsock/Win32 functions to do what a Unix select would do.
</blockquote>

In the meantime, we can handle the EWOULDBLOCK (aka EAGAIN) case. See patch.

Original comment by shane.be...@gmail.com on 29 Jun 2010 at 3:41

Attachments:

@GoogleCodeExporter
Copy link
Author

By the way: The -mno-cygwin flag was removed from GCC 4 in Cygwin 1.7. You'll 
want to install and use GCC 3. Example:

svn co http://puttycyg.googlecode.com/svn/trunk puttycyg-issue39
cd puttycyg-issue39
curl \
  'http://puttycyg.googlecode.com/issues/attachment?aid=-3085487759998918932&name=issue39-2010-06-29T081354.patch&token=22f1aa778ea2336caf6230fcd7572743' \
  | patch -p0
make CC=gcc-3 -f Makefile.maint

The resulting executables:

putty-0.60/windows/putty.exe
putty-0.60/windows/puttytel.exe
putty-0.60/windows/cthelper/cthelper.exe

Original comment by shane.be...@gmail.com on 29 Jun 2010 at 3:45

@GoogleCodeExporter
Copy link
Author

Thanks for tracking this down!

I had hoped that when I found time to work on it, I would look into issue 42 as 
well.  You wouldn't happen to have an idea about that, would you?  :)

I'll try to make a beta release this weekend.

Original comment by medgar123 on 30 Jun 2010 at 9:16

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Any beta releases yet that fixes this issue? At the moment, I am using mintty 
but it does not have the flexibility of puttycyg.

Original comment by slack...@gmail.com on 17 Sep 2010 at 2:02

@GoogleCodeExporter
Copy link
Author

@slackamp I can't help with the issue at hand, but please feel free to report 
PuTTY features you're missing in mintty at 
http://code.google.com/p/mintty/issues.

Original comment by andy.koppe on 18 Sep 2010 at 2:43

@GoogleCodeExporter
Copy link
Author

Finally got around to applying this patch; seems to fix the problem.

Thanks!

Original comment by jordan.d...@gmail.com on 19 Sep 2010 at 7:28

@GoogleCodeExporter
Copy link
Author

@jordan care to share your binaries?
@andy, i am missing color options but someone has already requested for it 
(issue 193).

Original comment by slack...@gmail.com on 28 Oct 2010 at 8:28

@GoogleCodeExporter
Copy link
Author

Uploaded new BETA version:

http://code.google.com/p/puttycyg/downloads/detail?name=puttycyg-20101029.zip

Original comment by medgar123 on 29 Oct 2010 at 12:03

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Hi.  Been fighting same buffer overflow/puttycyg window crash for a while.  
Downloaded beta fix and wanted to provide feedback that the patch fixed the 
issue.  Thanks guys!

Original comment by djaege...@gmail.com on 4 Nov 2010 at 6:24

@GoogleCodeExporter
Copy link
Author

Thanks for the feedback; I'll promote the BETA now. :)

Original comment by medgar123 on 4 Nov 2010 at 7:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant