This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: MC no longer working with cygwin 3.1.x
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Wed, 18 Dec 2019 21:14:42 +0000
- Subject: Re: MC no longer working with cygwin 3.1.x
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C3xG084mvxc/lL1aujKUDTSN2Pfm13hZy/a/zFo64BE=; b=lK4DVJ/b4iQ7gwIYmydciM+7XavEx1jMPtxqLB8KBHXKE63vaJqRz+OwrRpV0Edy1MRfbl+b4GS64CKXqUNuIoVNiJqHFD+9cLJ8IMAaOrS3RErdmROyackSf5yfqYSk10hgpxGAV4JP6XfHPDWbsw1NKOe7dKaza6PgFDavKBcDwP3oPuYoza6CUe6hDDXalCX3xj1Ox1CwwDr/mO/ZhEzqXwVGNA9ljex0524LYIKixs5lMhiKN90V/wM17Lgtqj43pnU/Gt378Ccn7mudGmA0lYoTvjyStihYR7jmFTM4PoiglVfPB1ubM6L3r2q4HgohzbvTgjnT0RRHUZEukQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QrWwYaJPULUcOHkLfzHROrnNiz6I8ya92Nd1+oB7geMKjw8Eb2EQzR4PpLtSJXGmFCN1rcNki1YxVgcgN5OQoaYJcWMxcYVt8lqWX3evJATvptlpglgO242uQEXL3zPQuJiuwBkE/L2qIAD4cQz3H0ueo0duxUV8IbBwfai3C+/s8+yb83zqVYs35vRJgWPJy4SphF1YORzg5GvP2ZQ16QeWTqYsGi5uY6Wq1qw4DTQsFrOVVa1+4fu5bprqtraNgHVcSh16mib1AHnB09tSXLWmCnw5k2FY7kNC6UvSTyFAH18C3JJKVxmQ3fYOehD896y/X/fnrClht5rxOqB8cA==
- References: <DB8PR01MB5996973955794728D12078E6BC530@DB8PR01MB5996.eurprd01.prod.exchangelabs.com> <97c8a719-73b9-e0ec-9651-97c2c684a086@gmail.com> <20191218193205.GP10310@calimero.vinschen.de>
On 12/18/2019 2:32 PM, Corinna Vinschen wrote:
> On Dec 18 17:23, Marco Atzeri wrote:
>> Am 18.12.2019 um 15:42 schrieb Laurent R:
>>> Dear all,
>>>
>>> After the update to cygwin-3.1.1, mc (aka Midnight Commander) no longer starts. It goes into an infinite loop, if I go back to cygwin-3.0.7, mc works perfectly.
>>>
>>> I tested with cygwin-3.1.0, same problem.
>>>
>>> The MC version is 4.8.23 and the operating system is Windows 10 Pro x64 1903.
>>>
>>> Regards.
>>>
>>
>> confirmed
>>
>> there must be a race somewhere as running /usr/bin/mc.exe from strace
>> works fine.
>
> But that's not the only problem running mc AFAICS. I'm seeing an
> error message in the background:
>
> Cannot open named pipe /tmp/mc-corinna/mc.pipe.384
> /cygdrive/d/cyg_pub/devel/mc/mc-4.8.23-1.x86_64/src/mc-4.8.23/src/subshell/common.c: open: Permission denied
>
> It looks like there's another problem, this time with the new FIFO
> code.
>
> Ken, care to take a look?
I've just looked at the mc source code, and it seems that (under tcsh only), mc
creates a fifo and tries to open it twice as O_RDWR. This is not supported on
Cygwin, so the second attempt fails.
Here's the relevant code from src/subshell/common.c:
if (mc_global.shell->type == SHELL_TCSH)
{
g_snprintf (tcsh_fifo, sizeof (tcsh_fifo), "%s/mc.pipe.%d",
mc_tmpdir (), (int) getpid ());
if (mkfifo (tcsh_fifo, 0600) == -1)
[...]
/* Opening the FIFO as O_RDONLY or O_WRONLY causes deadlock */
if ((subshell_pipe[READ] = open (tcsh_fifo, O_RDWR)) == -1
|| (subshell_pipe[WRITE] = open (tcsh_fifo, O_RDWR)) == -1)
{
fprintf (stderr, _("Cannot open named pipe %s\n"), tcsh_fifo);
perror (__FILE__ ": open");
mc_global.tty.use_subshell = FALSE;
[...]
Under bash, zsh, and some other shells, mc uses ordinary pipes rather than
FIFOs. I have no idea why tcsh is treated differently.
Until someone[*] gets around to making it possible to open a FIFO twice for
reading, I don't think there's anything we can do about it. I also don't know
how important this is for mc. I don't use tcsh or mc, so I can't judge.
Ken
[*] I will probably look into this at some point if there's enough demand for
it, but I'd like the new FIFO code to get lots of testing first.
--
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