Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 82295
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: BOLDRA [...] boldra.org
piemas25 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.9600
Fixed in: (no value)



Subject: Strange and very annoying bug/problem with Cygwin

Message body is not shown because it is too large.

Sorry to hear that. Unfortunately I have no cygwin around. From your description this looks much more like a cygwin bug than a CPAN.pm bug. If the problem persists for you, you should probably dive a bit into the code and make it more robust against this case. I'm interested in your findings and will gladly apply simple special cases for cygwin when you can do the ground work but I'm reluctant to just invent some heuristics that I cannot test myself.
Subject: Re: [rt.cpan.org #82295] Strange and very annoying bug/problem with Cygwin
Date: Fri, 28 Dec 2012 18:40:28 +0000
To: bug-CPAN [...] rt.cpan.org
From: pierre masci <piemas25 [...] gmail.com>
Thank you for your motivating answer, i'll see how it goes, if it continues i might try and understand. I'm considering going back to Linux-Land too. On the other hand, having to tweak into the modules to be able to install them has been quite teachful ;-) On 28 December 2012 16:23, Andreas Koenig via RT <bug-CPAN@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=82295 > > > Sorry to hear that. Unfortunately I have no cygwin around. From your > description this looks much more like a cygwin bug than a CPAN.pm bug. > If the problem persists for you, you should probably dive a bit into the > code and make it more robust against this case. I'm interested in your > findings and will gladly apply simple special cases for cygwin when you > can do the ground work but I'm reluctant to just invent some heuristics > that I cannot test myself.
FWIW, this problem still exists on Perl5.25.2. Sorry to say that it makes Perl on Cygwin almost unusuable.
I just set up a cygwin. Sample report: http://www.cpantesters.org/cpan/report/a154f439-6bf6-1014-9ba0-94355c8d98b0 So far could not reproduce. Next version of CPAN.pm (2.16) will try to get more diagnostics when it happens again. If this does not help, we need to consider some retry-after-failing-move option. Thanks for the reminder.
On Wed Aug 17 01:07:37 2016, ANDK wrote: Show quoted text
> I just set up a cygwin. Sample report: > http://www.cpantesters.org/cpan/report/a154f439-6bf6-1014-9ba0- > 94355c8d98b0 > > So far could not reproduce. > > Next version of CPAN.pm (2.16) will try to get more diagnostics when > it happens again. If this does not help, we need to consider some > retry-after-failing-move option. > > Thanks for the reminder.
Thanks, more diagnostics could indeed help. Here's a sample with 2.14: Running install for module 'Marpa::R2' Checksum for //utilite/mirrors/CPAN/authors/id/J/JK/JKEGL/Marpa-R2-3.000000.tar.gz ok Couldn't move /cygdrive/i/cpan/build/tmp-12332/Marpa-R2-3.000000/t to /cygdrive/i/cpan/build/Marpa-R2-3.000000-0/t: Is a directory
Actually I don't think it's Cygwin related. I can get the same error with Activestate Perl native on Windows.
On Fri Oct 07 22:21:44 2016, NHORNE wrote: Show quoted text
> Actually I don't think it's Cygwin related. I can get the same error > with Activestate Perl native on Windows.
Here is some output on Activestate, using CPAN 2.14: Running install for module 'IPC::System::Simple' Checksum for \\utilite\mirrors\CPAN\authors\id\P\PJ\PJF\IPC-System-Simple-1.25.tar.gz ok Couldn't move I:\cpan\build\tmp-7008\IPC-System-Simple-1.25\t to I:\cpan\build\IPC-System-Simple-1.25-0\t: No such file or directory Show quoted text
cpan>
If this helps, I can't reproduce the problem on Windows XP, only on Windows 10. My gut feeling is that something has changed in the permissions scheme that Windows now uses and that causes the breakage.
On Tue Oct 11 15:26:21 2016, NHORNE wrote: Show quoted text
> If this helps, I can't reproduce the problem on Windows XP, only on > Windows 10. My gut feeling is that something has changed in the > permissions scheme that Windows now uses and that causes the breakage.
Indeed it seems to be a permission problem! I was sitting together with Paul Boldra today who has the same problem (on Windows 10 I believe), after updating cygwin. We found out that the correct error message is actually lost, because of how File::Copy::move() works. It attempts to do a rename() first. If this fails, it tries other methods, and we haven't completely found out why the second attempt (with copy() and unlink()) produces a different error message, but: * The error message from rename() is "Permission denied" * If we put a "sleep 1" after the rename, it suddenly works So it has todo with copying many files after each other. For the record: CPAN::VERSION=2.18; File::Copy::VERSION=2.32, perl 5.26 Hope that helps!
Le Mer 06 Fév 2019 11:44:03, TINITA a écrit : Show quoted text
> On Tue Oct 11 15:26:21 2016, NHORNE wrote:
> > If this helps, I can't reproduce the problem on Windows XP, only on > > Windows 10. My gut feeling is that something has changed in the > > permissions scheme that Windows now uses and that causes the > > breakage.
> > > Indeed it seems to be a permission problem! > I was sitting together with Paul Boldra today who has the same problem > (on Windows 10 I believe), after updating cygwin. > We found out that the correct error message is actually lost, because > of how File::Copy::move() works. > It attempts to do a rename() first. If this fails, it tries other > methods, and we haven't completely found out why the second attempt > (with copy() and unlink()) produces a different error message, but: > > * The error message from rename() is "Permission denied" > * If we put a "sleep 1" after the rename, it suddenly works > > So it has todo with copying many files after each other. > > For the record: CPAN::VERSION=2.18; File::Copy::VERSION=2.32, perl > 5.26 >
I can confirm this on Windows 7 SP1 (64-bit) with Cygwin-x86_64 v3.0.7-1, Perl v5.26.3, File::Copy v2.32, so this is not only a Windows 10 problem. These packages failed CPAN installation: - Crypt::Mode::CBC - Crypt::Mode::ECB - HTML::Tidy - Excel::Writer::XLSX - Spreadsheet::ParseXLSX Other, more lightweight, packages installed correctly before and after these, e.g. Module::Build or XML::XPathEngine. As mentioned by Tina Müller, this dirty hack allows the listed failing packages to install normally (albeit a bit slowly when moving files): --- Copy.pm 2019-09-24 17:00:39.291599500 +0200 +++ Copy-hacked.pm 2019-09-24 17:00:28.903599500 +0200 @@ -278,7 +278,9 @@ 1 while unlink $to; } + sleep(1); return 1 if rename $from, $to; + sleep(1); # Did rename return an error even though it succeeded, because $to # is on a remote NFS file system, and NFS lost the server's ack? Feel free to contact me if you need further tests.
Hi Andreas, I too have run across this bug. However, I have some interesting diagnostic information. Your debug code triggered nicely. First, my environment: Microsoft Windows [Version 6.1.7601] 7 SP1 64bit CYGWIN_NT-6.1 applejack 3.1.0(0.340/5/3) 2019-11-19 13:58 x86_64 Cygwin This is perl 5, version 22, subversion 4 (v5.22.4) built for cygwin-thread-multi I had this happen once before but it stopped and I forgot about it. However today it cropped up again. As hinted at by the sleep(1) hack, I think that this is a resource issue. I keep TaskInfo running at all times to monitor my system and I was getting alerts. The number of file handles was clocking over 100,000. This is clearly a resource leak being poked by Cygwin. System (the kernel) is sitting on about 75,000 right now. I had been doing compile checks on my Perl lib path and I was watching the handle count tick up. Closing all Cygwin processes does not free the handles; I have to reboot. I then wanted to do some CPAN installations and vwa-la. It was rather random and just keeping trying let them eventually succeed. It also happened when trying to install manually. i.e. make, make test, etc. The error message: cpan[3]> force get CPAN Running get for module 'CPAN' WARNING: This key is not certified with a trusted signature! Primary key fingerprint: 2E66 557A B97C 19C7 91AF 8E20 328D A867 450F 89EC Signature for /home/wagnerc/.cpan/sources/authors/id/A/AN/ANDK/CHECKSUMS ok Checksum for /home/wagnerc/.cpan/sources/authors/id/A/AN/ANDK/CPAN-2.27.tar.gz ok Couldn't move /home/wagnerc/.cpan/build/tmp-5290/CPAN-2.27/lib to /home/wagnerc/.cpan/build/CPAN-2.27-7/lib: Is a directory; #82295? CPAN::VERSION=2.27; File::Copy::VERSION=2.30; /home/wagnerc/.cpan/build/tmp-5290/CPAN-2.27/lib exists; /home/wagnerc/.cpan/build/CPAN-2.27-7/lib does not exist; cwd=/home/wagnerc/.cpan/build/tmp-5290; I assume that the permission denied error stems from Windows or Cygwin not being able to allocate a handle. But seemingly only File::Copy is affected since this is the only situation where I've seen this happen. The hard drive is a RAID 1 SSD so device slowness is not the issue. Since I know how to trigger the bug, let me know if you want to try out some new handling code. Merry 3rd Day of Christmas, -Chris