[cmake-developers] "Cannot restore timestamp" error due to Sharing Violation during Rename on Windows

Eric Berge ericmberge at gmail.com
Mon May 12 11:23:54 EDT 2014


I was seeing an error with the 2.8.2.12 code, so I did some testing with
last week's latest 3.0 code and am still seeing it, which are errors of the
form:

   CUSTOMBUILD : CMake error : Cannot restore timestamp
W:\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp

I used the Sysinternals Process Monitor command and saw that this was
likely due to two processes creating a generate.stamp.tmpXXXXXX file and
then both of them renaming these to generate.stamp at about the same time.
 I've been looking around in descriptions of the Windows rename to see what
might cause this.  The thing that's clear is that both of the temp files
are open with a share mode for SHARE_READ, SHARE_WRITE, and SHARE_DELETE
(so, everything possible).  I suppose there's still an issue regarding the
share mode on the directory as well between the competing renames.

My first question is whether the cmake code was expecting to avoid this
type of race by other means or it was just expecting that the last one
would succeed.

Note that this is not from a Windows CIFS server, but rather a Samba server
so it isn't out of the question that the Samba server is misbehaving (I'll
need to do some experiments on that to see if a Windows CIFS server would
have the same behavior.  But I first wanted to check with the group as to
whether locking or some other think was supposed to keep this type of race
from occurring or note.

Thanks,

Eric


For reference, the following are the events in the Process Monitor tracing
showing the overlapping renames:

"5:10:34.1318968
PM","cmake.exe","4688","CreateFile","\\k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp84940045","SUCCESS","Desired
Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options:
Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode:
Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"5:10:34.1325760
PM","cmake.exe","5000","CreateFile","\\k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp3633013290","SUCCESS","Desired
Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options:
Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode:
Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"5:10:34.1380157 PM","cmake.exe","4688","QueryAttributeTagFile","\\
k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp84940045","SUCCESS","Attributes:
A, ReparseTag: 0x0"
"5:10:34.1380751 PM","cmake.exe","4688","QueryBasicInformationFile","\\
k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp84940045","SUCCESS","CreationTime:
5/9/2014 5:10:34 PM, LastAccessTime: 5/9/2014 5:10:34 PM, LastWriteTime:
5/9/2014 5:10:34 PM, ChangeTime: 5/9/2014 5:10:34 PM, FileAttributes: A"
"5:10:34.1387283 PM","cmake.exe","5000","QueryAttributeTagFile","\\
k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp3633013290","SUCCESS","Attributes:
A, ReparseTag: 0x0"
"5:10:34.1387851 PM","cmake.exe","5000","QueryBasicInformationFile","\\
k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp3633013290","SUCCESS","CreationTime:
5/9/2014 5:10:34 PM, LastAccessTime: 5/9/2014 5:10:34 PM, LastWriteTime:
5/9/2014 5:10:34 PM, ChangeTime: 5/9/2014 5:10:34 PM, FileAttributes: A"
"5:10:34.1490336 PM","cmake.exe","4688","SetRenameInformationFile","\\
k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp84940045","SUCCESS","ReplaceIfExists:
True, FileName: \\k2.mdh.quantum.com
\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp"
"5:10:34.1513128 PM","cmake.exe","5000","SetRenameInformationFile","\\
k2.mdh.quantum.com\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp3633013290","SHARING
VIOLATION","ReplaceIfExists: True, FileName: \\k2.mdh.quantum.com
\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp"
"5:10:34.1514602 PM","cmake.exe","5000","CloseFile","\\;W:0000000031879054\
k2.mdh.quantum.com
\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp","SUCCESS",""
"5:10:34.1514988 PM","cmake.exe","4688","CloseFile","\\;W:0000000031879054\
k2.mdh.quantum.com
\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp","SUCCESS",""
"5:10:34.1515417 PM","cmake.exe","5000","CloseFile","\\k2.mdh.quantum.com
\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp3633013290","SUCCESS",""
"5:10:34.1516375 PM","cmake.exe","4688","CloseFile","\\k2.mdh.quantum.com
\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.tmp84940045","SUCCESS",""
"5:10:34.1517807 PM","cmake.exe","4688","CloseFile","\\k2.mdh.quantum.com
\z1\eberge\git2\vs2012-wdk80-build-monza\build\Windows_x86_64\snfs\obj\snfs\test\SnfsShareTest\CMakeFiles\generate.stamp.depend","SUCCESS",""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140512/e142fd7f/attachment.html>


More information about the cmake-developers mailing list