public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Cc: Anon User <retry0001-vps@yahoo.com>
Subject: Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue
Date: Sun, 02 Feb 2020 07:01:00 -0000	[thread overview]
Message-ID: <20200202160123.675a70d06491b3ba2bb84969@nifty.ne.jp> (raw)
In-Reply-To: <1489040583.393819.1580599508135@mail.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

On Sat, 1 Feb 2020 23:25:08 +0000 (UTC)
"Anon User via cygwin" wrote:
> $ md5sum /bin/cygwin-console-helper.exe
> 221bdfff7c8ccd1227bacb025bba665b */bin/cygwin-console-helper.exe

This is the right md5sum value.
Then, how about the attached test case?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

[-- Attachment #2: pcon_test_1min.c --]
[-- Type: text/x-csrc, Size: 1729 bytes --]

#define _WIN32_WINNT 0x0a00
#include <windows.h>
#include <stdio.h>

typedef void *HPCON;
#ifndef PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
#define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE 0x00020016L
#endif
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif

DWORD WINAPI PipeWriter(LPVOID pipe);
DWORD WINAPI PipeReader(LPVOID pipe);

int main()
{
	HMODULE h;
	FARPROC f;
	COORD size;
	HPCON hpCon;
	HANDLE inR, inW, outR, outW;
	HRESULT (WINAPI *CreatePseudoConsole)(COORD, HANDLE, HANDLE, DWORD, HPCON*);
	VOID (WINAPI *ClosePseudoConsole)(HPCON);

	h = GetModuleHandle("kernel32.dll");
	if (h == INVALID_HANDLE_VALUE) {
		fprintf(stderr, "GetModuleHandle() failed.\n");
		return 1;
	}
	f = GetProcAddress(h, "CreatePseudoConsole");
	if (f == NULL) {
		fprintf(stderr, "GetProcAddress() failed.\n");
		return 1;
	}
	CreatePseudoConsole = (HRESULT (WINAPI *)(COORD, HANDLE, HANDLE, DWORD, HPCON*))f;
	f = GetProcAddress(h, "ClosePseudoConsole");
	if (f == NULL) {
		fprintf(stderr, "GetProcAddress() failed.\n");
		return 1;
	}
	ClosePseudoConsole = (VOID (WINAPI *)(HPCON))f;
	CloseHandle(h);

	if (!CreatePipe(&inR, &inW, NULL, 0)) {
		fprintf(stderr, "CreatePipe() failed.\n");
		return 1;
	}
	if (!CreatePipe(&outR, &outW, NULL, 0)) {
		fprintf(stderr, "CreatePipe() failed.\n");
		return 1;
	}

	size.X = 80;
	size.Y = 24;

	printf("Started.\n");
	if (S_OK != CreatePseudoConsole(size, inR, outW, 0, &hpCon)) {
		fprintf(stderr, "CreatePseudoConsole() failed.\n");
		return 1;
	}
	printf("CreatePseudoConsole() end.\n");

	CloseHandle(inR);
	CloseHandle(outW);
	ClosePseudoConsole(hpCon);
	CloseHandle(inW);
	CloseHandle(outR);
	printf("ClosePseudoConsole() end.\n");

	return 0;
}


[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
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

  reply	other threads:[~2020-02-02  7:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <595178088.221931.1580542748412.ref@mail.yahoo.com>
2020-02-01  7:39 ` Anon User via cygwin
2020-02-01 15:13   ` Takashi Yano
2020-02-01 17:41   ` Anon User via cygwin
2020-02-01 23:11     ` Takashi Yano
2020-02-01 23:25       ` Anon User via cygwin
2020-02-02  7:01         ` Takashi Yano [this message]
2020-02-02  8:31           ` Anon User via cygwin
2020-02-02  8:59             ` Takashi Yano
2020-02-02  9:14               ` Anon User via cygwin
2020-02-02  9:27                 ` Takashi Yano
2020-02-02  9:33                   ` Anon User via cygwin
2020-02-02  9:48                   ` Anon User via cygwin
2020-02-02 18:10                     ` Bengt-Arne Fjellner via cygwin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200202160123.675a70d06491b3ba2bb84969@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@cygwin.com \
    --cc=retry0001-vps@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).