general error c101008d

L

Lucvdv

VS2005 SP1, new managed C++ class library project, hardly any code entered.

All it contains are the declarations of two classes plus a few properties
each, and the get/set methods for those properties.


It compiled fine yesterday. Today I added two properties and their get/set
methods to one of the classes, now I get this error about 1/3 of the time
when I try to compile it:

general error c101008d: Failed to write the updated manifest to the
resource of file "..\debug\PR990Engine.dll". The process cannot access
the file because it is being used by another process.
mt.exe


Using Sysinternals' FILEMON, I see that mt.exe is trying to truncate the
file while devenv.exe has it open for reading.


This is a small snippet of the filemon log, with the error marked by '>>>':

9:12:56 devenv.exe:2800
OPEN D:\Temp\PR990Engine\debug\PR990Engine.dll
SUCCESS Options: Open Access: All
9:12:56 mt.exe:3424
QUERY INFORMATION D:\Temp\PR990Engine\debug\PR990Engine.dll
SUCCESS Length: 36352
9:12:56 mt.exe:3424
READ D:\Temp\PR990Engine\debug\PR990Engine.dll
SUCCESS Offset: 0 Length: 36352
9:12:56 mt.exe:3424
CLOSE D:\Temp\PR990Engine\debug\PR990Engine.dll
SUCCESS
9:12:56 mt.exe:3424
CREATE D:\Temp\PR990Engine\debug\PR990Engine.dll9:12:56 devenv.exe:2800
QUERY INFORMATION D:\Temp\PR990Engine\debug\PR990Engine.dll
SUCCESS Length: 36352
9:12:56 devenv.exe:2800
READ D:\Temp\PR990Engine\debug\PR990Engine.dll
SUCCESS Offset: 0 Length: 36352
9:12:56 devenv.exe:2800
CLOSE D:\Temp\PR990Engine\debug\PR990Engine.dll
SUCCESS



It looks (to me) like a race condition caused by two build steps being
performed concurrently. Now I'm wondering if the result can be trusted
when the error doesn't occur: I notice in other parts of the log that
devenv.exe writes to the file too, in exactly the same way as mt.exe here:
read-close-create-rewrite entire file.

Two programs changing the same file at the same time that way, doesn't
sound safe.

Suppose, just because of how the executive happens to hand out time slices
to the two processes during a certain run, devenv.exe gets enough time to
save a modification to the file between mt's CLOSE and CREATE above (or
vice versa).
 
C

Christian Schladetsch

To fix this problem, in the project properties for the Manifest Tool, change "Embed Manifest" to false.

This solves a race condition on multi-core CPU's with Visual Studio 2005 on Vista.

Cheers,
Christian Schladetsch.
 
L

Luc

To fix this problem, in the project properties for the Manifest Tool, change "Embed Manifest" to false.

This solves a race condition on multi-core CPU's with Visual Studio 2005 on Vista.

Cheers,
Christian Schladetsch.

Thanks, I figured it was something like that.

A full multi-core CPU isn't even necessary, one with hyperthreading will do
(that's where it happened on here).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top