Skip Menu |

This queue is for tickets about the Cache-FastMmap CPAN distribution.

Report information
The Basics
Id: 29025
Status: resolved
Priority: 0/
Queue: Cache-FastMmap

People
Owner: Nobody in particular
Requestors: SMPETERS [...] cpan.org
Cc:
AdminCc:

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



Subject: [PATCH] Test failures on Win32/Cygwin
The following test failure occurs on Cygwin and Win32. t/10....ok t/11....Unlink of existing share file c:\sharefile-10208-1183534601 failed: Permission denied at /home/cwill1is/perl588/.cpanplus/5.8.8/build/Cache-FastMmap-1.16/blib/lib/Cache/FastMmap.pm line 515. # Looks like you planned 7 tests but only ran 4. # Looks like your test died just after 4. dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 5-7 Failed 3/7 tests, 57.14% okay t/2.....ok t/3.....ok t/4.....ok This is due to some oddities of the Win32 file systems. The problem relates to remove() and the speed at which Win32 file systems are updated. This leads to odd failures in deletes if a file is created and deleted in rapid succession. The attached patch uses the Windows API on Windows and Cygwin to resolve this problem. --- Cache-FastMmap-CImpl/mmap_cache.c.orig 2007-08-27 13:59:12.015625000 -0 500 +++ Cache-FastMmap-CImpl/mmap_cache.c 2007-08-27 14:07:53.937500000 -0500 @@ -24,6 +24,9 @@ #include <time.h> #include <errno.h> #include <stdarg.h> +#if defined(WIN32) || defined(__CYGWIN__) +# include <Windows.h> +#endif #include "mmap_cache.h" #ifdef DEBUG @@ -244,8 +247,12 @@ /* Remove if different size or remove requested */ if (!res && (cache->init_file || (statbuf.st_size != c_size))) { +#if defined(WIN32) || defined(__CYGWIN__) + res = DeleteFile(cache->share_file); +#else res = remove(cache->share_file); - if (res == -1 && errno != ENOENT) { +#endif + if (res != 0 && errno != ENOENT) { _mmc_set_error(cache, errno, "Unlink of existing share file %s failed", cache->share_file); return -1; }
Hmmm that sounds very odd. Are you sure that's the problem? I don't understand why using remove() and DeleteFile() would give different results. Doesn't remove() just use DeleteFile() internally anyway?
I'm hoping 1.29 (see <https://rt.cpan.org/Ticket/Display.html?id=45210>) might fix this as well...