Alex Tessier

I keep getting the following compiler errors, albeit sporadically:

fatal error C1033: cannot open program database "D:\somepath\ps_extrude.pdb"

It appears as though mspdbsrv.exe is keeping file handles between builds open, causing sharing violations with itself.

The compiler is using the /Fd option to specify the pdb file, on a multiprocessor machine using 2 invocations of the compiler at a time.

The file access during the error looks like:

------------------------------------------------------------------------------------------

6:28:20 PM mspdbsrv.exe:3568 OPEN D:\somepath\ps_extrude.pdb SUCCESS Options: Open Access: All
6:28:20 PM mspdbsrv.exe:3568 QUERY INFORMATION D:\somepath\ps_extrude.pdb SUCCESS FileFsVolumeInformation
6:28:20 PM mspdbsrv.exe:3568 QUERY INFORMATION D:\somepath\ps_extrude.pdb BUFFER OVERFLOW FileAllInformation
6:28:20 PM mspdbsrv.exe:3568 CLOSE D:\somepath\ps_extrude.pdb SUCCESS
6:28:20 PM mspdbsrv.exe:3568 OPEN D:\somepath\ps_extrude.pdb SHARING VIOLATION Options: Open Access: All
6:28:20 PM mspdbsrv.exe:3568 OPEN D:\somepath\ps_extrude.pdb SHARING VIOLATION Options: OpenIf Access: All
6:28:20 PM cl.exe:6548 CLOSE D:\someOtherPath\ps_extrude.cpp SUCCESS

------------------------------------------------------------------------------------------

A quick dump of the open handles for the still running mspdbsrv process after the build has completed shows:

------------------------------------------------------------------------------------------

mspdbsrv.exe pid: 3568 someDomain\someUser

...

8b08: File D:\somepath\ps_extrude.pdb

8b18: File D:\somepath\ps_extrude.pdb

------------------------------------------------------------------------------------------

The permissions and attributes are all ok, so it's not a permissions issue. No other processes besides mspdbsrv have handles open (I disable all realtime virus checking software during a build).

I'm sure if I wait for mspdbsrv to die, the problem will go away as the handles will be closed, but I have a similar issue when I do a fully clean build through a scheduled task at night. I haven't been able to snapshot the nightly build problem when it happens, but I bet it's related.

I'd log a problem report, but it's incredibly difficult to catch the problem when it happens.

Help Do I need to stop and restart the mspdbsrv process during the build to prevent this from happening



Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

Kang Su Gatlin

I haven't seen this and this is the type of thing that mspdbsrv was supposed to handle. You shouldn't have to stop and restart mspdbsrv during the build.

You should enter a bug at our product feedback site: http://lab.msdn.microsoft.com/productfeedback/

Try to detail it as much as possible, and we'll do our best to figure out what is going on.

Thanks!






Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

ijprest

For what it's worth, I'm seeing the same error, in pretty much the same circumstances.
foo.cpp : fatal error C1033: cannot open program database 'bar.pdb'
I'm compiling multiple DLLs simultaneously on dual-core AMD system, all pointing to the same PDB file with /Fd. The error is sporadic.




Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

cb1024

I'm also having this problem. I am compiling multiple exe projects within one solution. Is there a workaround or a bug report number that we can follow to get more information about this.
Personally I like to delete the Debug/Release directory and try again. There is no need for me to restart VS.




Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

Fish Fish

FYI: I too am STILL experiencing this problem.

It only seems to happen whenever multiple compiles are going on at the same time.

I am VERY disappointed that the problem has been closed as "Not Reproducible".

I have a large project (Solution with 43 sub-projects in it). Doing a "Rebuild All" from VStudio start usually succeeds.

HOWEVER...

If, for whatever reason, the build fails, then trying the "Rebuild All" again, within less than a minute (after correcting the typo causing the error causing the build to originally fail of course) INVARIABLY (i.e. almost 100% of the time) causes C1033 to almost immediately occur!

The only way to "workaround" the problem is to manually KILL the "mspdbsrv.exe" process. Then an immediate Rebuild All succeeds just fine.

ADDITIONAL INFO:

Since the issue appear to revolve around "mspdbsrv.exe" (version 8.0.50727.165) the following may perhaps be clues:

  • VStudio Options -> Debugging -> Symbols = http://msdl.microsoft.com/symbols (checked), "C:\symbols" specified as local symbol store, "Search above locations..." NOT checked, "Load symbols..." IS checked.
  • /Zi option specified for all projects.
  • All projects intermediate directories ARE unique (isolated from one another).
  • I have a macro loaded with Build Events enabled. (See below; it's very small / simple).
  • Windows XP x64 Edition w/Service Pack 1 (i.e. current; all security patchs, etc)
  • One 2.20GHz (3500+) AMD Athlon 64 (i.e. uniprocessor)


--------------------------(BEGIN MyMacro contents)--------------------------

Option Strict Off

Option Explicit Off

Imports System

Imports EnvDTE

Imports EnvDTE80

Imports System.Diagnostics

Public Module EnvironmentEvents

#Region "Automatically generated code, do not modify"

<SNIPPED>

#End Region

Private Sub BuildEvents_OnBuildProjConfigDone _

( _

ByVal Project As String, _

ByVal ProjectConfig As String, _

ByVal Platform As String, _

ByVal SolutionConfig As String, _

ByVal Success As Boolean _

) _

Handles BuildEvents.OnBuildProjConfigDone

If Success = False Then

'The build failed...cancel any further builds.

DTE.ExecuteCommand ( "Build.Cancel" )

End If

End Sub

Private Sub BuildEvents_OnBuildBegin _

( _

ByVal Scope As EnvDTE.vsBuildScope, _

ByVal Action As EnvDTE.vsBuildAction _

) _

Handles BuildEvents.OnBuildBegin

DTE.ExecuteCommand ( "Tools.ExternalCommand3" )

Dim ow As OutputWindow

Dim owP As OutputWindowPane

ow = DTE.ToolWindows.OutputWindow

owP = ow.OutputWindowPanes.Item ( "Build" )

owP.Activate()

End Sub

End Module

--------------------------(END MyMacro contents)--------------------------

The "ExternalCommand3" is nothing important. It's just a simple cmd file (batch file) that simply increments a number in a header file. (AutoBuildCount)

I believe it is the "OnBuildProjConfigDone" event handler that may be related to the issue since it is cancelling the build and thus possibly interfering with "mspdbsrv.exe"'s processing in some way as well.

Also, the fact that I have VStudio configured to use MS's Symbol Server may also be related to the issue, since, it is afterall the Program Database Server progran (mspdbsrv.exe) with the problem!

In short, PLEASE TRY AGAIN, MICROSOFT, as the problem has not been fixed yet, and is causing some of your customers serious problems using your product! Please re-open bug# 132753!

Thank you for your prompt attention into this matter.






Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

codecruncher

We get this all the time also!!!

I was really hoping that VS 2005 SP1 would fix this darn mess, but it doesn't. We have a build farm of PCs cranking away builds 24x7 and at least every other day hit this problem.

It is VERY frustrating as it causes a red herring build break to everyone on the dev team and is destroying the credibility of our automated build system.

We've resorted to killing mspdbsrv.exe if it exists using pskill at the very start of our huge build just to try to reduce our exposure to this bug. That helps a bit, but we still hit this problem quite regularly.

You've got a serious bug here in mspdbsrv.exe.





Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

vokesalex

I'm getting this problem 20-30% of all builds I do now.

This makes it incredibly difficult for me to work effectively. I'm using VS2005 SP1 too, and have a Pentium D system. My colleague doesn't seem to get the problem at all with his Core 2 Duo. I've tried changing the affinity on devenv.exe to only use a single core and this seems to reduce the number of times I get this problem, but has the side effect of swamping my CPU usage during compiles.

I'm also a bit disappointed that Microsoft have closed this bug, marking this as 'Unreproducible'. If anyone else has any workarounds for this problem I'd be much obliged.





Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

CodeTyper

FYI - This is most likely a problem with clearcase. I get this too, but only when working with files in a clearcase VOB. This is a HUGE PITA and needs to be resolved.



Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

codecruncher

Not in our case.

We do not use ClearCase at all - but still have this bug.

This is just a regular old concurrency bug in the interaction between the compiler processes and mspdbsrv.exe.





Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

Alex Tessier

Yup, no clearcase for me either.

Since my original posting, I've found a workaround: don't use /Zi or /ZI debugging info types. You can use /Z7 (old-style debugging info) and still get the debug info packaged (by mspdbsrv.exe) into .pdb files for your .exe and .dll's etc.

Our concurrency woes with mspdbsrv almost always happened with individual .pdb files (eg; foo.obj with foo.pdb when using the /Fd for files) -or- happened with the shared vc80.pdb file in each directory (when you don't use /Fd). With /Z7, the debugging info for individual object files is embedded in the .obj file and mspdbsrv seems to handle this ok for our large project.

SP1 did nothing to clear up the issues with mspdbsrv. However, I have noticed a new post SP1 hotfix, which I haven't had an opportunity to try. If someone can try it out and respond back to this thread, it'd be good to know if the hotfix addresses the original problem(s).

http://support.microsoft.com/kb/935225

And in particular the hotfix says it's adressed this:

"Additionally, the handle count for the Mspdbsrv.exe process continues to increase in Windows Task Manager."

Alex.





Re: Visual C++ General Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database

codecruncher

That hotfix does resolve a really bad handle leak in mspdbsrv.exe with SP1. Perhaps the handle leaks exacerbate the concurrency issues with underlying file access.

Sadly the KB article is incorrect in the availability of a fix for the x64 compiler tool chain. Only a fix for x86 is available at the moment.