如何调试win32上的文件系统“访问被拒绝”错误?

时间:2009-07-25 19:59:32

标签: windows debugging filesystems waf

我现在正忙着使用我们的构建脚本:我正在使用Waf来驱动我们的构建过程,一切都很好,除了Windows,我在这里遇到了间歇性的错误生成。

错误总是基本上是“访问被拒绝”的一种或另一种形式的错误,与我在构建过程中创建的临时文件相关,以使某些工具能够运行并完成它的工作。例如,在运行NSIS生成可执行安装程序之前,我必须将所有必需的文件“暂存”到构建目录并从那里运行命令。有时事情会按预期工作,但有时我会报告有关我复制的其中一个文件的错误,例如:

File: failed opening file "Platform\\Win32\\lxml-2.2.1-py2.6-win32.egg

我花了一个时间试图弄清楚问题是什么,但它真的很难,因为问题是间歇性的。我尝试的最后一件事是使用procmon监视文件系统访问以尝试跟踪导致访问错误的原因:我知道文件存在,所以必须是文件打开的东西。我在下面列出了相关的输出,因为我看不出有什么问题:Python似乎在NSIS想要打开它之前关闭文件但是NSIS失败了。任何人都可以对此有所了解吗?这个问题不是孤立于这种情况,而是与我生成子进程以处理我复制到构建目录的文件的其他情况......

7:35:15.9704427 PM  python.exe  4968    QueryOpen   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg FAST IO DISALLOWED  
7:35:15.9707497 PM  python.exe  4968    CreateFile  ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9708634 PM  python.exe  4968    QueryBasicInformationFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 7/25/2009 7:35:11 PM, LastAccessTime: 7/25/2009 7:35:11 PM, LastWriteTime: 7/25/2009 7:35:11 PM, ChangeTime: 7/25/2009 7:35:11 PM, FileAttributes: A
7:35:15.9709271 PM  python.exe  4968    CloseFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS 
7:35:15.9785180 PM  python.exe  4968    CreateFile  ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Write Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9786119 PM  python.exe  4968    SetBasicInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 1/1/1601 1:00:00 AM, LastAccessTime: 1/1/1601 1:00:00 AM, LastWriteTime: 1/1/1601 1:00:00 AM, ChangeTime: 1/1/1601 1:00:00 AM, FileAttributes: AN
7:35:15.9787155 PM  python.exe  4968    CloseFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS 
7:35:15.9789401 PM  python.exe  4968    QueryOpen   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg FAST IO DISALLOWED  
7:35:15.9790309 PM  python.exe  4968    CreateFile  ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9790700 PM  python.exe  4968    QueryBasicInformationFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 7/25/2009 7:35:11 PM, LastAccessTime: 7/25/2009 7:35:11 PM, LastWriteTime: 7/25/2009 7:35:11 PM, ChangeTime: 7/25/2009 7:35:12 PM, FileAttributes: A
7:35:15.9790952 PM  python.exe  4968    CloseFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS 
7:35:15.9792809 PM  python.exe  4968    CreateFile  ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Write Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:15.9793270 PM  python.exe  4968    SetBasicInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 1/1/1601 1:00:00 AM, LastAccessTime: 1/1/1601 1:00:00 AM, LastWriteTime: 1/1/1601 1:00:00 AM, ChangeTime: 1/1/1601 1:00:00 AM, FileAttributes: AN
7:35:15.9794041 PM  python.exe  4968    CloseFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS 
7:35:16.3508170 PM  makensis.exe    3296    CreateFile  ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SHARING VIOLATION   Desired Access: Generic Read, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, AllocationSize: n/a
7:35:16.3557763 PM  python.exe  4968    QueryOpen   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg FAST IO DISALLOWED  
7:35:16.3558928 PM  python.exe  4968    CreateFile  ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
7:35:16.3559461 PM  python.exe  4968    QueryNetworkOpenInformationFile ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS CreationTime: 7/25/2009 7:35:11 PM, LastAccessTime: 7/25/2009 7:35:11 PM, LastWriteTime: 7/25/2009 7:35:11 PM, ChangeTime: 7/25/2009 7:35:12 PM, AllocationSize: 1/1/1601 1:00:00 AM, EndOfFile: 1/1/1601 1:00:00 AM, FileAttributes: A
7:35:16.3560121 PM  python.exe  4968    CloseFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS 
7:35:16.3562048 PM  python.exe  4968    CreateFile  ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SHARING VIOLATION   Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
7:35:21.9320579 PM  python.exe  3160    CloseFile   ..\Path\To\Build\lxml-2.2.1-py2.6-win32.egg SUCCESS 

1 个答案:

答案 0 :(得分:3)

在该跟踪中,跟踪开始时文件已存在。所以其他东西可能会让它保持打开状态(例如病毒扫描程序或索引服务)。