Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9104

Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      Windows XP, Windows 7 using MSBuild or devenv.exe to build MS Visual Studio Projects

      Description

      I run into errors when using a customized build system which uses Visual Studio's devenv.exe under the hood to compile VisualStudio 2005 projects (with VC++ compiler). When starting two parallel builds with Jenkins (on different code base) the second job will always fail with "Fatal error C1090: PDB API call failed, error code '23' : '(" in exactly the same second the first job finishes processing. Running both jobs outside Jenkins does not produce the error.
      This has also been reported for builds executed by MSBuild on the Jenkins user mailing list [1].

      I analysed this issue thoroughly and can track the problem down to the usage of mspdbsrv.exe. This program is automatically spawned when building a VisualStudio project. All Visual Studio instances normally share one common pdb-server which shutdown itself after a idle period (standard is 10 minutes). "It ensures access to .pdb files is properly serialized in parallel builds when multiple instances of the compiler try to access the same .pdb file" [2].
      I assume that Jenkins does a clean up of its build environment when a automatically started job finishes (like as described at http://wiki.jenkins-ci.org/display/JENKINS/Aborting+a+build). I checked mspbsrv.exe with ProcessExplorer and the process indeed has a variable JENKINS_COOKIE/HUDSON_COOKIE set in its environment if started through Jenkins. Killing mspdbsrv.exe while projects are still connected will break compilation.

      Jenkins mustn't kill mspdbsrv.exe to be able to build more than one Visual Studio project at the same time.


      [1] http://jenkins.361315.n4.nabble.com/MSBuild-fatal-errors-when-build-triggered-by-timer-td385181.html
      [2] http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/b1d1bceb-06b6-47ef-a0ea-23ea752e0c4f/

        Issue Links

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/util/ProcessKillingVeto.java
          core/src/main/java/hudson/util/ProcessTree.java
          test/src/test/java/hudson/util/ProcessTreeKillerTest.java
          http://jenkins-ci.org/commit/jenkins/9a047acd4b5a4e805cee7260f3d091405dc7b930
          Log:
          Merge pull request #1684 from DanielWeber/JENKINS-9104

          JENKINS-9104 Add extension point that allows extensions to veto killing...

          Compare: https://github.com/jenkinsci/jenkins/compare/3c785d5af0ad...9a047acd4b5a

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/util/ProcessKillingVeto.java core/src/main/java/hudson/util/ProcessTree.java test/src/test/java/hudson/util/ProcessTreeKillerTest.java http://jenkins-ci.org/commit/jenkins/9a047acd4b5a4e805cee7260f3d091405dc7b930 Log: Merge pull request #1684 from DanielWeber/ JENKINS-9104 JENKINS-9104 Add extension point that allows extensions to veto killing... Compare: https://github.com/jenkinsci/jenkins/compare/3c785d5af0ad...9a047acd4b5a
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #4205
          JENKINS-9104 Add ProcessKillingVeto extension point (Revision a220431770cfe716e4f69fd76a4a59bbb27aa045)

          Result = UNSTABLE
          daniel.weber.dev : a220431770cfe716e4f69fd76a4a59bbb27aa045
          Files :

          • core/src/main/java/hudson/util/ProcessKillingVeto.java
          • core/src/main/java/hudson/util/ProcessTree.java
          • test/src/test/java/hudson/util/ProcessTreeKillerTest.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4205 JENKINS-9104 Add ProcessKillingVeto extension point (Revision a220431770cfe716e4f69fd76a4a59bbb27aa045) Result = UNSTABLE daniel.weber.dev : a220431770cfe716e4f69fd76a4a59bbb27aa045 Files : core/src/main/java/hudson/util/ProcessKillingVeto.java core/src/main/java/hudson/util/ProcessTree.java test/src/test/java/hudson/util/ProcessTreeKillerTest.java
          Hide
          mifoe MiFoe added a comment -

          When you use the commandline switch /Z7 the debug info is stored in the object and no server process is needed. This should also solve the problem.

          Show
          mifoe MiFoe added a comment - When you use the commandline switch /Z7 the debug info is stored in the object and no server process is needed. This should also solve the problem.
          Hide
          s7726 Gavin Swanson added a comment -

          How does the /Z7 flag affect performance? My impression is that the point of mspdbsrv.exe is to keep the data around for other builds to use, thus decreasing build times for subsequent builds.

          Show
          s7726 Gavin Swanson added a comment - How does the /Z7 flag affect performance? My impression is that the point of mspdbsrv.exe is to keep the data around for other builds to use, thus decreasing build times for subsequent builds.
          Hide
          mifoe MiFoe added a comment -

          It does not affect performance but size of object file. with this option the debug information is stored in each object file instead of one pdb. At linktime, the debug information is written in a PDB file.

          Show
          mifoe MiFoe added a comment - It does not affect performance but size of object file. with this option the debug information is stored in each object file instead of one pdb. At linktime, the debug information is written in a PDB file.

            People

            • Assignee:
              danielweber Daniel Weber
              Reporter:
              gordin Christoph VogtlÃĪnder
            • Votes:
              45 Vote for this issue
              Watchers:
              59 Start watching this issue

              Dates

              • Created:
                Updated: