Henrik Bach
2005-Jan-27 21:16 UTC
[LLVMdev] Building the llvm runtime: 'Can't destroy file: Theprocess cannot access the fi
>From: Jeff Cohen Date: Wed, 26 Jan 2005 19:47:44 -0800 > >Fixed.Yes, now it isn't the path. I've recorded this trace: ------------------------- llvm[3]: Building Debug Bytecode Archive libc.bca /bin/rm -f /C/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca /C/projects/build/MinGW/llvm-4-1/Debug/bin/llvm-ar rcsf /C/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca /C/projects/build/MinGW/llvm-4-1/runtime/GCCLibraries/libc/Debug/atox.bc /C/projects/build/MinGW/llvm-4-1/runtime/GCCLibraries/libc/Debug/io.bc /C/projects/build/MinGW/llvm-4-1/runtime/GCCLibraries/libc/Debug/memory.bc /C/projects/build/MinGW/llvm-4-1/runtime/GCCLibraries/libc/Debug/qsort.bc /C/projects/build/MinGW/llvm-4-1/runtime/GCCLibraries/libc/Debug/string.bc c:\projects\build\MinGW\llvm-4-1\Debug\bin\llvm-ar.exe: c:/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca-000000: Can't destroy file (hb:2): The process cannot access the file because it is being used by another process. make[3]: *** [/C/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca] Error 2 ------------------------- Like before, the temporary file libc.bca-000000 doesn't exist when finished. But libc.bca exists. I've put debugging text into: ------------------------- bool Path::destroyFile() const { if (!isFile()) return false; DWORD attr = GetFileAttributes(path.c_str()); // If it doesn't exist, we're done. if (attr == INVALID_FILE_ATTRIBUTES) return true; // Read-only files cannot be deleted on Windows. Must remove the read-only // attribute first. if (attr & FILE_ATTRIBUTE_READONLY) { if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) ThrowError(path + ": Can't destroy file (hb:1): "); } if (!DeleteFile(path.c_str())) ThrowError(path + ": Can't destroy file (hb:2): "); return true; } ------------------------- I've also attached a complete trace for this run. Any suggestions? Henrik. _________________________________________________________________ Del din verden med MSN Spaces http://spaces.msn.com -------------- next part -------------- A non-text attachment was scrubbed... Name: my_make_tools-only.zip Type: application/x-zip-compressed Size: 4878 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050127/8b6e4034/attachment.bin>
Reid Spencer
2005-Jan-27 22:09 UTC
[LLVMdev] Building the llvm runtime: 'Can't destroy file: Theprocess cannot access the fi
On Thu, 2005-01-27 at 13:16, Henrik Bach wrote:> c:\projects\build\MinGW\llvm-4-1\Debug\bin\llvm-ar.exe: > c:/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca-000000: Can't destroy > file (hb:2): The process cannot access the file because it is being used by > another process. > make[3]: *** [/C/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca] Error 2 > ------------------------- > > Like before, the temporary file libc.bca-000000 doesn't exist when finished. > But libc.bca exists.Here's what's happening in the archiver. It is creating libc.bca. The way it does that is to create a temporary file using the Path::createTemporaryFile. The file with the -000000 suffix is the temporary file that gets renamed as libc.bca when llvm-ar is finished build it. So, I think what is going on is that the file is being renamed correctly but Win32/Path.inc is throwing an exception anyway (where the error message comes from) and llvm-ar returns error code 2 (which means an error exception was generated). We just need to find out why Win32/Path.inc is throwing an exception on rename. Possibly the temporary file has not been closed at the point of the rename. See the logic in Archive::writeToDisk in lib/Bytecode/Archive/ArchiveWriter.cpp for the details. The logic looks correct to me. The Archive file is closed and then renamed. Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050127/a6b89d55/attachment.sig>
Jeff Cohen
2005-Jan-28 01:16 UTC
[LLVMdev] Building the llvm runtime: 'Can't destroy file: Theprocess cannot access the fi
The mapped files weren't being closed at all; they were only being unmapped. It's now fixed. Reid Spencer wrote:>On Thu, 2005-01-27 at 13:16, Henrik Bach wrote: > > >>c:\projects\build\MinGW\llvm-4-1\Debug\bin\llvm-ar.exe: >>c:/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca-000000: Can't destroy >>file (hb:2): The process cannot access the file because it is being used by >>another process. >>make[3]: *** [/C/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca] Error 2 >>------------------------- >> >>Like before, the temporary file libc.bca-000000 doesn't exist when finished. >>But libc.bca exists. >> >> > >Here's what's happening in the archiver. It is creating libc.bca. The >way it does that is to create a temporary file using the >Path::createTemporaryFile. The file with the -000000 suffix is the >temporary file that gets renamed as libc.bca when llvm-ar is finished >build it. So, I think what is going on is that the file is being renamed >correctly but Win32/Path.inc is throwing an exception anyway (where the >error message comes from) and llvm-ar returns error code 2 (which means >an error exception was generated). We just need to find out why >Win32/Path.inc is throwing an exception on rename. Possibly the >temporary file has not been closed at the point of the rename. > >See the logic in Archive::writeToDisk in >lib/Bytecode/Archive/ArchiveWriter.cpp for the details. The logic looks >correct to me. The Archive file is closed and then renamed. > >Reid. > > > >------------------------------------------------------------------------ > >_______________________________________________ >LLVM Developers mailing list >LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Seemingly Similar Threads
- [LLVMdev] Building the llvm runtime: 'Can't destroy file: Theprocess cannot access the fi
- [LLVMdev] Building the llvm runtime: 'Can't destroy file: Theprocess cannot access the fi
- [LLVMdev] Building the llvm runtime: 'Can't destroy file:Theprocess cannot access the fi
- [LLVMdev] Building the llvm runtime: 'Can't destroy file: Theprocess cannot access the fi
- [LLVMdev] Building the llvm runtime: 'Can't destroy file:Theprocess cannot access the fi