none
Intermittent 'build busy' errors

    Question

  • I have a Win32 C++ solution with several dependent projects.  Often when I build or rebuild, I get some sort of 'busy error.  For instance:

    error MSB6003: The specified task executable "link.exe" could not be run. The process cannot access the file 'E:\dev\cs\mscs\Debug\link.4172-cvtres.read.1.tlog' because it is being used by another process.    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets

    If I am persistent and retry (sometimes it takes 3 or 4 retries), the problem resolves itself and everything works.  A long time ago, someone in a forum pointed out that this was a problem with VS2005 on multi-cpu processors.

    I had this problem on previous versions of VS, but now I've upgraded to 2010 and still having the issue.

    Is this a Visual Studio problem or perhaps some sort of setting that I have wrong?

    In terms of computer details, I'm now running Windows 7 Ultimate on an i7-930, but I've also seen the exact problem on a quad core running XP.

    Monday, June 07, 2010 6:37 PM

Answers

  • Are any two of your projects outputting objs to the same folder? If so, we are aware of this issue and that error is occurring due to a conflict in the tlog file name. As of now, you may work around it by turning off incremental build for those projects.
    Renin John Visual C++ Project & Build Team
    Tuesday, June 08, 2010 11:41 PM

All replies

  • I have seen similar issues due to anti-virus software.  A file gets created or modified in the build process, the anti-virus gets curious and gives it a scan, then the build process tries to access the file again while the anti-virus is still holding it.  One possibility might to configure the anti-virus software to exclude .tlog files, or perhaps exclude monitoring E:\dev\cs\mscs\
    Monday, June 07, 2010 9:02 PM
  • Hello,

    When the issue happens, you could use Process Explorer to find which process is handling the file.

    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

    Regards,
    Rong-Chun Zhang
    MSDN Subscriber Supportin Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com 


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, June 08, 2010 9:17 AM
  • Are any two of your projects outputting objs to the same folder? If so, we are aware of this issue and that error is occurring due to a conflict in the tlog file name. As of now, you may work around it by turning off incremental build for those projects.
    Renin John Visual C++ Project & Build Team
    Tuesday, June 08, 2010 11:41 PM
  • John,

    Yes, projects are sharing build directories. This must be the problem.  I'll rework the projects to change the directories and see what happens.

    Thanks.

    Wednesday, June 09, 2010 12:45 AM
  • Good thought, but stopping anti-virus didn't change the problem.  See my reply below to the issue of having projects sharing a directory.  I believe that's the real problem.

     

    Wednesday, June 09, 2010 12:47 AM
  • Changing the intermediate directories solved the problems.  That's where the .tlog files are located.
    Wednesday, June 09, 2010 12:57 AM
  • I have experienced several manifestations of this problem in VS2010 in several ways including MSB6003 and C2471, as well as several other errors similar to:

       "The specified task executable "link.exe" could not be run. The process cannot access the file '...s\Debug\link.4172-cvtres.read.1.tlog' because it is being used by another process.  "

    and

      "c:\program files (x86)\microsoft visual studio 10.0\vc\include\istream(1187): fatal error C1090: PDB API call failed, error code '23' :"

    The cause was because several projects in the solution were using the same default pdb filename (vc100.pdb) in the same output directory. If parallel project building is enabled then there's a conflict/race condition with multiple build processes trying to modify the files at the same time.  The solution was to change the pdb filename to  $(OutDir)\$(ProjectName).pdb  and create a separate output and intermediate directory for each project and configuration:

       Output Directory: $(Platform)\$(Configuration)\$(ProjectName)\
       Intermediate Directory: $(OutDir)

    Paul Walmsley

    Wednesday, August 14, 2013 2:53 PM