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
Pty stalls when pasting long text #810
Comments
I can paste 400KB into mintty without problems, using various test scenarios, e.g. Do you paste into a specific application that runs in mintty? |
The following is needed for a minimal sound incident report: |
I was pasting into some self-written program, but pasting into |
Oh I have also found a
|
I've pasted 431284 bytes of lines of 71 'c's each, terminated with DOS lineends (CRLF) into cat > tst. |
OK, if I remove all the lineends, I do indeed get a crash. To be analysed. |
I have made a debug build from 250cbd7, and attached gdb to mintty when crashing. Here is the backtrace:
|
Thanks for the debug info. Analysis to be continued tomorrow. |
I made the following change to --- a/src/child.c
+++ b/src/child.c
@@ -687,10 +687,14 @@ child_send(const char *buf, uint len)
void
child_sendw(const wchar *ws, uint wlen)
{
- char s[wlen * cs_cur_max];
- int len = cs_wcntombn(s, ws, sizeof s, wlen);
+ int len = wlen * cs_cur_max * sizeof(char);
+ char *s = malloc(len);
+ if (!s)
+ return;
+ len = cs_wcntombn(s, ws, len, wlen);
if (len > 0)
child_send(s, len);
+ free(s);
} And some gdb backtrace:
|
Actually, the hang occurs in |
Splitting up the big |
Possibly related to #390?? |
Please confirm that your test case contains lines of excessive length. |
Yes it does contain line of excessive length. |
I've uploaded a first patch which should avoid the stalling. However, the terminal is rendered unresponsive after pasting such excessive contents until you send an interrupt (^C or ^). |
New test case: I'll leave the patch in place that avoids the total hang and I'll try to improve it to avoid also the need to press ^C to continue. I'll also report the issue on the cygwin mailing list; however, I'll try to extract a minimal test case for a while first which didn't succeed so far. |
The current behaviour (uploaded to repository) is also observed inside |
Released 2.9.4. |
When pasting text with length ~350k chars, mintty quits immediately. I can reproduce this consistently on both mintty v2.9.3 (installed from cygwin x86_64) and wsltty 1.8.4 (mintty 2.8.4).
The text was updated successfully, but these errors were encountered: