[JIRA] [core] (JENKINS-9104) Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

247 views
Skip to first unread message

kevin.phillips@caris.com (JIRA)

unread,
May 29, 2015, 9:21:05 AM5/29/15
to jenkinsc...@googlegroups.com
Kevin Phillips commented on Bug JENKINS-9104
 
Re: Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

Just a quick ping-back on this issue. Outstanding for like 4 years, no comments for months now, and all for a debilitating, crippling problem in the system! I did notice the pull request Daniel Webber created, which does seem to have some more recent activity on it but still no complete resolution to the issue even in the latest LTS release.

Are there plans for finishing this work any time soon? We are still stuck on an LTS version from like a year or two ago because we can not accept this bug into our production environment. If there is any way to get this fix in sooner rather than later I know I'd appreciate it and I'm sure many others would as well.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

Alexey.Larsky@jeppesen.com (JIRA)

unread,
May 29, 2015, 9:22:03 AM5/29/15
to jenkinsc...@googlegroups.com

kevin.phillips@caris.com (JIRA)

unread,
May 29, 2015, 10:55:07 AM5/29/15
to jenkinsc...@googlegroups.com
 
Re: Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

@steve carter
First, let me thank you for summarizing the earlier comment threads. That does help bring everything into focus.

4) Jenkins, in order to catch rogue processes at job end (i.e. those that have broken ties with their parent process) scans the whole process space for those with the particular BUILD_ID in their environment, and kills them. This is correct and good behavior by Jenkins.

Agreed. This is a perfectly valid and useful enhancement for the majority of cases. However, given the debilitating effect it has on this specific use case combined with the fact that the change was included on an LTS release which is expected to be kept as stable as possible is where I take issue. I see this problem as a bug, albeit a difficult to detect bug and admittedly a bug that is really caused by some questionable behavior provided by the Microsoft build tools, but a bug none the less. In that case critical, production halt kind of bugs like this should be fixed immediately or reverted until an appropriate fix can be made. Doing otherwise reduces users' confidence in the stability of the tool. There is a reason shops like ours choose to use LTS editions for production work - to avoid problems like this that may be found on the latest, cutting edge versions.

8) Solution 1: start pdbsrv with a BUILD_ID that doesn't match the build jobs. Then pdbsrv will not be killed at the end of the job.

This should be called a workaround or hack rather than a solution. That point aside, this workaround again won't work for our particular build environment. We use the BUILD_ID throughout our build processes to embed metadata in the binary files we generate. If we reset that environment variable as part of our build this metadata will essentially get corrupted. Changing our tooling to use an alternative environment variable would require significant effort as well, having to be propagated out to dozens of products across several release branches each.

9) Solution 2: use Daniel's whitelist feature to not kill pdbsrv at the end of the job.

Based on my review of his pull request, Daniel's feature has not yet been completed nor has it been included in any actual LTS release. I do believe this would be a reasonable and appropriate solution to this defect though, so hopefully this work can be completed sooner rather than later.

10) The problem with Solutions 1 and 2 are this: pdbsrv still has a timeout, so you will get sporadic failures when the server goes away.

I know some earlier posters did indicate that this was an issue for them I have not been able to reproduce the problem as described. When a compile begins and this process is running it makes use of the existing process, and if the process is not already running it starts it. I have never had a compile running and seen the mspdbsrv process terminate mid-compile without any other background process or system event occurring. Also, I work with many development teams including many dozens of developers and have never once had a report of this bug outside of the reproducible use cases I've stated before.

Conversely, I have shown the problem is reproducible outside of Jenkins in very hard to detect ways which I suspect may appear to some to be an intermittent timeout. For example, if you are logged in to a system which is performing a compile in a background process which is also running under the same user profile as your local session, by simply logging out of the system the service terminates. The reason for this is the pdbsrv process is shared by the background process and your local user session and when you log out from the local session all processes in that memory space are terminated, including pdbsrv. This was a very difficult use case to isolate and not very obvious to users of the target systems and even went undiagnosed at my place of work for months under the assumption that the failure was unpredictable and intermittent.

I know that my argument doesn't prove that this particular problem couldn't ever happen but I am extremely skeptical to say the least. If someone does believe that this problem does in fact exist I would greatly appreciate a detailed description on how to reproduce the problem. Maybe we're using a slightly older or slightly newer version of the compiler that doesn't exhibit the problem or something. Either way, if these individuals were willing to compare notes maybe we can help further isolate the root of this discrepancy.

12) pdbsrv's timeout doesn't get a new lease every time you use pdbsrv. I regard this as a bug in pdbsrv.

As I've stated in earlier posts, my team manages a build farm with close to a dozen agents now, running over 1000 build jobs and never once have I ever had this error occur on any of those systems, nor have any of the development teams we support report this problem on any of their local development machines. I would have to say that if this were in fact a core issue with the Microsoft toolset we would have discovered it by now. Again, if anyone can give me a reproducible use case that proves otherwise I would be happy to hear from them. Maybe we are doing something they aren't, or vice versa.

13) You can't leave pdbsrv running forever because it (allegedly) has memory leaks. I regard this as a bug in pdbsrv.

Again, this is something we have not been able to reproduce. For example, I have watches some of our agents that are under the most considerable load wrt build operations - machines which essentially run 24/7 compiling one or more projects in parallel nearly all the time and these systems continue to run stably day after day, week after week without requiring any outside intervention from me or my team. The pdbsrv process is nearly always active, the memory consumption increases and decreases with the load on the machines, and never causes any fatal errors in our build processes.

If anyone can provide specific, reproducible criteria for this problem I would be interested to hear it. If there is something we have overlooked that may be causing us grief elsewhere that we have not yet considered I would definitely want to know about it.

I really think to roll back Jenkins' ProcessTreeKiller is NOT a solution.

Agreed. I don't think 'just' rolling back this change is the best solution. I think fixing this bug is the best solution. However in the absence of an appropriate fix for this bug, combined with the severity of it's impact, I think that rolling back the change until an appropriate fix was put in place would have been a better solution rather than stranding users of your tool on an old, out of date release as we have been.

Just my 2 cents.

The use of BUILD_ID brings the Jenkins machine under better control against rogue processes...

Totally agree that the improvement is well worth the effort. My concern is that the change includes a relatively significant bug.

...and the workaround (for well-behaved servers) is easy, set BUILD_ID before starting the server, or use Daniel's whitelist.

Again, 'easy' workaround is a relative term. As just mentioned we would need to rework our build tools and roll that change out to many teams for many products, and backport those changes to many branches for this to work, after which we'd need to going through all 1000+ jobs on our farm and update them with the hack to the environment variable. Obviously significant effort in our case. Also the whitelist solution has yet to be completed from what I can tell, so that is not a usable solution yet.

14) Solution 3: start pdbsrv periodically, e.g. every day with a day-long timeout. That will mitigate against the memory leaks. If you use some concurrency control, e.g. Job Weight plugin, you can make sure this "kill and restart pdbsrv" job does not fire during a build.

Again, just to be clear this is clearly a workaround and not a solution.

This hack may work for us in the interim until an appropriate fix can be made. I will test it out as soon as I can and report back. In our case we'll likely just setup a scheduled task that runs on boot and forces the service to start, and stay running indefinitely as there is no need for it to shut down ever that we have seen.

However, for those individuals who claim that the service does need periodic resetting a solution like this would likely be more complex. Assuming they to need to ensure the utmost stability of their build farm as we do, they would need to ensure the pdbsrv service gets started before any compilation operation runs, including after reboots, power outages, crashes and the like. I don't believe there is any way to achieve this using a Jenkins operation. This means an external process would be needed like the Scheduled Task idea I just mentioned. But then the external process would be running independently from the Jenkins agent making it even more difficult to coordinate the two. For example, I suspect it would be difficult at best to make sure the scheduled task restarts the service at an opportune moment when no compilation operations are happening on the agent. Just something else for those users to keep in mind.

kevin.phillips@caris.com (JIRA)

unread,
May 29, 2015, 10:57:15 AM5/29/15
to jenkinsc...@googlegroups.com

PS: Sorry for the rant. My team and I have been aggravated for some time now, hoping this bug would be fixed so we can move off the old version of Jenkins we're currently stuck on and thus able to pick up some new bug fixes both in the core as well as in numerous plugins which only support newer versions. Hopefully I don't come across as overly adversarial.

Alexey.Larsky@jeppesen.com (JIRA)

unread,
May 29, 2015, 10:59:02 AM5/29/15
to jenkinsc...@googlegroups.com
Alexey Larsky updated an issue
Change By: Alexey Larsky
Environment: Windows XP,  Windows 7  using MSBuild or devenv.exe to build MS Visual Studio Projects

rosenboom@bias.de (JIRA)

unread,
May 29, 2015, 12:16:04 PM5/29/15
to jenkinsc...@googlegroups.com
Lars Rosenboom commented on Bug JENKINS-9104
 
Re: Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

Maybe there is a way to shut down the mspdbsrv.exe softly, so it stops only after all active request (by msbuild.exe or devenv.exe in parallel builds) are done. Then it should simply restart on the next request.

Another solution would be to allow the user to give a list of process names not to kill (or maybe hardcode not to kill mspdbsrv.exe).

rosenboom@bias.de (JIRA)

unread,
May 29, 2015, 12:18:02 PM5/29/15
to jenkinsc...@googlegroups.com
Lars Rosenboom edited a comment on Bug JENKINS-9104

gavinswanson@gmail.com (JIRA)

unread,
May 29, 2015, 12:27:03 PM5/29/15
to jenkinsc...@googlegroups.com

Stopping after a timeout period after all active requests and continuing to run when it gets a new request are the way mspdbsrv runs normally when something doesn't go around killing it (ala Jenkins).

I believe the correct solution is a whitelist.

kevin.phillips@caris.com (JIRA)

unread,
May 29, 2015, 3:02:05 PM5/29/15
to jenkinsc...@googlegroups.com

Update
So, it turns out setting up some kind of background process to spawn a copy of the pdbsrv process isn't going to work as expected. From what I can tell Windows seems to be able to tell when a process has been launched from a system service and it will prevent those sub-processes from using other processes that are spawned elsewhere. The particulars of my test case are as follows:

  1. Setup a small Python script that launches a copy of mspdbsrv.exe when called
  2. Setup a scheduled task in Windows to run the python script on boot
  3. Reboot the agent - confirm the mspdbsrv.exe process is running
  4. trigger a compilation operation via the Jenkins dashboard
  5. A new, secondary copy of mspdbsrv.exe is spawned to serve the Jenkins agent. This sub-process is then terminated as per usual once the Jenkins build is complete.

I have confirmed that both the service that runs the Jenkins agent and the scheduled task use the same user profile and credentials and that both environments are using the same version of mspdbsrv.exe with the same set of command line parameters (ie: -start -spawn).

Looks like I have to head back to the drawing board.

kevin.phillips@caris.com (JIRA)

unread,
May 29, 2015, 3:13:04 PM5/29/15
to jenkinsc...@googlegroups.com

Update
As a quick sanity check I decided to throw together a quick ad-hoc test configuration where by I overload the BUILD_ID in the environment for one of my compilation jobs just to see if one of the hacks proposed earlier will potentially work. Unfortunately it looks like this is not a robust solution either. I have confirmed in the trivial case that the solution does work, as in:

  1. Setup a job with a single shell operation as a build step, configured as follows:
    • override the BUILD_ID env var with some arbitrary value
    • call into MSBuild to perform the compilation
  2. run a build of the given job
  3. upon completion, confirm that the mspdbsrv.exe process is still running - TEST SUCCESSFUL

However, unfortunately I've found another case where this solution doesn't work. Apparently if you manually kill the build while it is running Jenkins still somehow manages to locate the orphaned pdbsrv process and kill it, despite the changes described above. So, to put it more clearly:

  1. Setup a job with a single shell operation as a build step, configured as follows:
    • override the BUILD_ID env var with some arbitrary value
    • call into MSBuild to perform the compilation
  2. run a build of the given job
  3. while the compilation operation is running, and you have confirmed the mspdbsrv.exe process has been launched, manually force the running build to terminate (ie: by clicking on the X icon next to the running build on the Jenkins dashboard)
  4. FAILURE - Jenkins still terminates the pdbsrv process

I have confirmed that the pdbsrv process does correctly inherit the overloaded BUILD_ID, so Jenkins is somehow able to locate and terminate the process in this case. I suspect what may be happening in my test env is that at the point at which I manually kill the build Jenkins is still running one or more Visual Studio operations which have a direct link to the mspdbsrv.exe process and thus it detects and kills the thread by recursively transcending the process tree killing all running processes / threads that are tied to the agent at the time.

Either way, this example shows that even this 'hack' of overriding the BUILD_ID is fragile at best. It looks like we may have no choice but to wait for a fix for that 'whitelist' solution before we can consider upgrading our Jenkins instance.

kevin.phillips@caris.com (JIRA)

unread,
May 29, 2015, 3:22:03 PM5/29/15
to jenkinsc...@googlegroups.com

Update
While reporting the issue in my last comment I had the idea for a slight variation of the configuration described there which does appear to work in both use cases. The main modification that I made was to separate the build operation into two separate build operations:

  • the first is a simple Windows command line call which overrides BUILD_ID and then launches mspdbsrv.exe. Once this first operation completes, Jenkins terminates the shell session that is linked to the pdbsrv process thus decoupling it from the agent. Combined with the overloaded BUILD_ID env var, Jenkins can no longer track the process.
  • the second operation is just another instance of a Windows shell session that then calls into msbuild to proceed with the build.

Theoretically even this solution "could" fall prey to the same problem I described in my previous comment, however the execution time of this initial build step is negligible and is highly unlikely to be exploited in practice (ie: a user would need to hit the kill button on the build at just that small fraction of a second it takes Jenkins to launch mspdbsrv.exe).

I'm not sure how easy this hack will be for us to roll out into production at the scale we need, but just in case others find this tidbit of information helpful I thought I'd provide it here.

kevin.phillips@caris.com (JIRA)

unread,
Jun 1, 2015, 8:46:03 AM6/1/15
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Jul 5, 2015, 10:53:04 AM7/5/15
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-9104
 
Re: Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

Code changed in jenkins
User: Daniel Weber
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/a220431770cfe716e4f69fd76a4a59bbb27aa045
Log:
JENKINS-9104 Add ProcessKillingVeto extension point

This allows extensions to veto killing of certain processes.

Issue 9104 is not yet solved by this, it is only part of the solution. The
rest should be taken care of in plugins.

scm_issue_link@java.net (JIRA)

unread,
Jul 5, 2015, 10:53:08 AM7/5/15
to jenkinsc...@googlegroups.com

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

dogfood@java.net (JIRA)

unread,
Jul 5, 2015, 12:43:06 PM7/5/15
to jenkinsc...@googlegroups.com
dogfood commented on Bug JENKINS-9104

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

michael.foerderer@zf.com (JIRA)

unread,
Jul 9, 2015, 3:13:04 AM7/9/15
to jenkinsc...@googlegroups.com

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.

gavinswanson@gmail.com (JIRA)

unread,
Jul 9, 2015, 10:15:05 AM7/9/15
to jenkinsc...@googlegroups.com

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.

michael.foerderer@zf.com (JIRA)

unread,
Jul 10, 2015, 1:11:04 AM7/10/15
to jenkinsc...@googlegroups.com

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.

dbeck@cloudbees.com (JIRA)

unread,
Nov 17, 2015, 7:53:03 PM11/17/15
to jenkinsc...@googlegroups.com

knavero@gmail.com (JIRA)

unread,
Nov 20, 2015, 6:28:05 PM11/20/15
to jenkinsc...@googlegroups.com
Kevin Navero commented on Bug JENKINS-9104
 
Re: Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

Just wanted to note that this also occurs on my slave nodes and each slave node only has one executor. So at first glance, since I'm not running concurrent builds on any individual slave node, it seems like this error occurring on my slave nodes doesn't make any sense.

scm_issue_link@java.net (JIRA)

unread,
Jan 15, 2016, 3:50:13 PM1/15/16
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Jan 15, 2016, 3:50:14 PM1/15/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Daniel Weber
Path:
pom.xml
src/main/java/hudson/plugins/msbuild/MsBuildKillingVeto.java
src/test/java/hudson/plugins/msbuild/MsBuildKillingVetoTest.java
http://jenkins-ci.org/commit/msbuild-plugin/855a84479b64f32ceb30f73433858dfe2efb5e9f
Log:
[FIXED JENKINS-9104] Veto killing mspdbsrv.exe

Making use of the newly introduced ProcessKillingVeto extension point,
we now make sure that mspdbsrv.exe survives process killing during build
cleanup.

This requires a Jenkins version >= 1.625, the new extension point was
added there. I marked the extension as optional, so that the msbuild
plugin should still work with older Jenkins releases.

scm_issue_link@java.net (JIRA)

unread,
Jan 15, 2016, 3:50:17 PM1/15/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Gregory Boissinot
Path:
pom.xml
src/main/java/hudson/plugins/msbuild/MsBuildKillingVeto.java
src/test/java/hudson/plugins/msbuild/MsBuildKillingVetoTest.java
http://jenkins-ci.org/commit/msbuild-plugin/48084be76d434195c9e8b2ddc66f1fb5255a78de
Log:
Merge pull request #19 from DanielWeber/master

[FIXED JENKINS-9104] Veto killing mspdbsrv.exe

scm_issue_link@java.net (JIRA)

unread,
Jan 15, 2016, 4:25:05 PM1/15/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Gregory Boissinot
Path:
pom.xml
src/main/java/hudson/plugins/msbuild/MsBuildKillingVeto.java
src/test/java/hudson/plugins/msbuild/MsBuildKillingVetoTest.java

http://jenkins-ci.org/commit/msbuild-plugin/b9a5b02117e0ee097aaf030ab2574daa3dcd217d
Log:
Revert "[FIXED JENKINS-9104] Veto killing mspdbsrv.exe"

scm_issue_link@java.net (JIRA)

unread,
Jan 17, 2016, 6:04:04 AM1/17/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Gregory Boissinot
Path:
pom.xml
src/main/java/hudson/plugins/msbuild/MsBuildKillingVeto.java
src/test/java/hudson/plugins/msbuild/MsBuildKillingVetoTest.java

http://jenkins-ci.org/commit/msbuild-plugin/031a05982b16e42cba5544c4ba9511515941c62f
Log:
Merge pull request #20 from jenkinsci/revert-19-master

Revert "[FIXED JENKINS-9104] Veto killing mspdbsrv.exe"

damian.dixon@gmail.com (JIRA)

unread,
Jan 21, 2016, 4:36:10 PM1/21/16
to jenkinsc...@googlegroups.com

> Revert "[FIXED JENKINS-9104] Veto killing mspdbsrv.exe"

I'm confused why has the code fix appear to have been reverted?

damian.dixon@gmail.com (JIRA)

unread,
Jan 21, 2016, 5:28:06 PM1/21/16
to jenkinsc...@googlegroups.com
damian dixon edited a comment on Bug JENKINS-9104
> Revert "[FIXED JENKINS-9104] Veto killing mspdbsrv.exe"

I'm confused why has the code fix
 appear to have  been reverted?


The reason I am looking at this again is that the BUILD_ID work around is no longer working for me.

I upgraded from 1.595 to 1.645.

damian.dixon@gmail.com (JIRA)

unread,
Jan 21, 2016, 5:30:27 PM1/21/16
to jenkinsc...@googlegroups.com
damian dixon edited a comment on Bug JENKINS-9104
> Revert "[FIXED JENKINS-9104] Veto killing mspdbsrv.exe"

I'm confused why has the code fix been reverted?


The reason I am looking at this again is that the BUILD_ID work around is no longer working for me.

Neither is the 1.25 msbuild plugin which is meant to have the fix in.

I upgraded from 1.595 to 1.645.

dbeck@cloudbees.com (JIRA)

unread,
Jan 21, 2016, 5:31:05 PM1/21/16
to jenkinsc...@googlegroups.com

daniel.weber.dev@gmail.com (JIRA)

unread,
Jan 22, 2016, 2:20:03 AM1/22/16
to jenkinsc...@googlegroups.com

damian dixon: My changes have been reverted by accident, the msbuild plugin release 1.25 does not contain the change required to fix this issue.
There is a new PR reverting the revert: https://github.com/jenkinsci/msbuild-plugin/pull/21

daniel.weber.dev@gmail.com (JIRA)

unread,
Jan 27, 2016, 7:20:27 AM1/27/16
to jenkinsc...@googlegroups.com
Daniel Weber reopened an issue
 

This is still not resolved. We need an update of the msbuild-plugin, see PR https://github.com/jenkinsci/msbuild-plugin/pull/21

Change By: Daniel Weber
Resolution: Fixed
Status: Resolved Reopened

dbeck@cloudbees.com (JIRA)

unread,
Jan 27, 2016, 7:31:06 AM1/27/16
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-9104
 
Re: Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

Daniel Weber This issue is filed against the core component, and that change has been included a long time ago.

akb@akb.me.uk (JIRA)

unread,
Jan 28, 2016, 6:55:03 AM1/28/16
to jenkinsc...@googlegroups.com

Is there a plan for Visual Studio builds not started by the msbuild-plugin, please?

I'm asking because our job configurations use a "Execute Windows batch command" build step rather than "Build a Visual Studio project or solution using MSBuild" build step (and our batch process is non-trivial).

dbeck@cloudbees.com (JIRA)

unread,
Jan 28, 2016, 7:11:20 AM1/28/16
to jenkinsc...@googlegroups.com

Antony Bartlett The proposed MSBuild Plugin change only requires the plugin to be installed to be effective (assuming mspdbsrv.exe is what you don't want killed).

akb@akb.me.uk (JIRA)

unread,
Jan 28, 2016, 7:54:06 AM1/28/16
to jenkinsc...@googlegroups.com

That's great - thank you very much for clarifying this, and for your efforts to fix the wider issue - I'm looking forward to having more projects and configurations built automatically in a timely fashion through judicious use of parallelization

dbeck@cloudbees.com (JIRA)

unread,
Jan 28, 2016, 8:39:05 AM1/28/16
to jenkinsc...@googlegroups.com

daniel.weber.dev@gmail.com (JIRA)

unread,
Jan 30, 2016, 4:09:03 PM1/30/16
to jenkinsc...@googlegroups.com

Daniel Beck: Well, the core stuff is done. But from a user's perspective the issue still exists.

How can I get someone to merge the pending PR and create a release of the msbuild plugin?

peter.whitehead@shimadzu-mso.com (JIRA)

unread,
Feb 29, 2016, 2:41:13 AM2/29/16
to jenkinsc...@googlegroups.com
Pete W commented on Bug JENKINS-9104

What's happened to this fix? It sounds like its ready to go. How can we get a new release of the plugin?

janpolito@free.fr (JIRA)

unread,
Mar 10, 2016, 3:35:07 PM3/10/16
to jenkinsc...@googlegroups.com

I tried parallel builds with MSBuild plugin 1.25 on top of Jenkins 1.580.1 but unfortunately I still get this error (fatal error C1090: PDB API call failed, error code '23'). Did I miss something ?

ostojan@gmail.com (JIRA)

unread,
Mar 17, 2016, 8:41:04 AM3/17/16
to jenkinsc...@googlegroups.com

When do you publish new version of plugin with fix? It's been month since you released version with(out) fix...

jaime.x.ramos@gmail.com (JIRA)

unread,
Apr 7, 2016, 2:16:03 PM4/7/16
to jenkinsc...@googlegroups.com

I'm in need of a fix for this too, it's consistently failing numerous jobs for me. Is there an old version of Jenkins to revert to that avoids this particular problem? I'm willing to go that route as a workaround.
So far this has been a cause of a pretty bad first impressions for a team I setup a CI build setup for who had never seen Jenkins before.

jaime.x.ramos@gmail.com (JIRA)

unread,
Apr 7, 2016, 2:17:13 PM4/7/16
to jenkinsc...@googlegroups.com
Jaime Ramos edited a comment on Bug JENKINS-9104
I'm in need of a fix for this too, it's consistently failing numerous jobs for me. Is there an old version of Jenkins to revert to that avoids this particular problem? I'm willing to go that route as a workaround.
So far this has been a cause of a pretty bad first impressions for a team I setup a CI build setup for who had never seen Jenkins before.

I'm using VS2010 devenv.exe to build the solution files.

olexandr.maltsev@gmail.com (JIRA)

unread,
Apr 7, 2016, 3:44:05 PM4/7/16
to jenkinsc...@googlegroups.com

Hello Jaime,
I found a solution.
I think it is a workaround, but it works for me.
I set for every project addition String parameter.
Go to the Jenkins Project and set "This build is parameterized", “Name” – “BUILD_ID”, “Default Value” – “DoNotKillMe”.

olexandr.maltsev@gmail.com (JIRA)

unread,
Apr 7, 2016, 3:53:02 PM4/7/16
to jenkinsc...@googlegroups.com
Olexandr Maltsev edited a comment on Bug JENKINS-9104
Hello Jaime,
I found a solution.
I think it is a workaround, but it works for me.
I set for every project  the  addition String parameter.

Go to the Jenkins Project and set "This build is parameterized", “Name” – “BUILD_ID”, “Default Value” – “DoNotKillMe”.

olexandr.maltsev@gmail.com (JIRA)

unread,
Apr 7, 2016, 4:02:03 PM4/7/16
to jenkinsc...@googlegroups.com

olexandr.maltsev@gmail.com (JIRA)

unread,
Apr 7, 2016, 4:07:07 PM4/7/16
to jenkinsc...@googlegroups.com

mdealer@gmail.com (JIRA)

unread,
May 20, 2016, 6:12:03 AM5/20/16
to jenkinsc...@googlegroups.com
Edgars B. commented on Bug JENKINS-9104

Stumbled upon this issue immediately after trying parallel builds. Been open for 5 years now, so I guess you can simply check for 'mspdbsrv.exe' and leave it alone?

mdealer@gmail.com (JIRA)

unread,
May 20, 2016, 6:13:03 AM5/20/16
to jenkinsc...@googlegroups.com
Edgars B. edited a comment on Bug JENKINS-9104
Stumbled upon this issue immediately after trying parallel builds. Been open for 5 years now, so I guess you can simply check for 'mspdbsrv.exe' and leave it alone?  Please free us of our pain.

zzayats@yandex.ru (JIRA)

unread,
Jun 9, 2016, 4:52:03 PM6/9/16
to jenkinsc...@googlegroups.com

Somebody, publish the new version please. Apparently, the fix is already in the source code on GitHub. Can someone else (other than the maintainer) release the new version?

jtelfer@flexerasoftware.com (JIRA)

unread,
Jul 4, 2016, 8:34:04 PM7/4/16
to jenkinsc...@googlegroups.com

FWIW, we implemented a workaround to this issue that doesn't involve wiping out the BUILD_ID variable (as we need to use it). Having a release with the Veto would be better, but this avoids random crashes in the meantime.

Instead of allowing the MSBuild process to start the daemon itself, you cause the daemon to start using an environment that you choose. MSBuild then just uses the instance you started rather than starting its own.

The Powershell we use is as follows. Use the Powershell plugin to run this as a step before the MSBuild plugin step (could be translated to Windows batch too if you like).

# https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller

var originalBuildID = $Env:BUILD_ID
$Env:BUILD_ID = "DoNotKillMe"
try
{
    start mspdbsrv -argumentlist '-start','-spawn' -NoNewWindow
}
catch {}
$Env:BUILD_ID = originalBuildID
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Jul 12, 2016, 10:21:03 AM7/12/16
to jenkinsc...@googlegroups.com

msbuild-1.26 should contain the fix. Can we finally resolve this, or is something missing?

jtelfer@flexerasoftware.com (JIRA)

unread,
Jul 12, 2016, 6:54:02 PM7/12/16
to jenkinsc...@googlegroups.com

dbeck@cloudbees.com (JIRA)

unread,
Jul 12, 2016, 7:00:05 PM7/12/16
to jenkinsc...@googlegroups.com

*sigh*

1.26 is tagged in GitHub but no artifacts are uploaded. Looks like a failed release. Sorry about that.

Note that MSBuild Plugin is almost certainly not currently maintained, as Gregory stopped working on his plugins, so if someone here wants to take over (Daniel Weber perhaps?) that should be possible.

jtelfer@flexerasoftware.com (JIRA)

unread,
Jul 12, 2016, 7:59:03 PM7/12/16
to jenkinsc...@googlegroups.com

johannes.schmieder@airbus.com (JIRA)

unread,
Jul 13, 2016, 10:50:05 AM7/13/16
to jenkinsc...@googlegroups.com

As a workaround I have created a Jenkins Job that executes a Windows batch command on the jenkins node where Visual Studio is installed.
The jenkins job triggers the batch command once a day and works in my environment for several years now.
The batch command looks like this:

set MSPDBSRV_EXE=mspdbsrv.exe
set MSPDBSRV_PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE

set PATH=%MSPDBSRV_PATH%;%PATH%
set ORIG_BUILD_ID=%BUILD_ID%
set BUILD_ID=DoNotKillMe

echo stop mspdbsrv.exe
%MSPDBSRV_EXE% -stop

echo wait 7 sec
%windir%\system32\ping.exe -n 7 localhost> nul

echo restart mspdbsrv.exe with a shutdowntime of 25 hours
start /b %MSPDBSRV_EXE% -start -spawn -shutdowntime 90000

set BUILD_ID=%ORIG_BUILD_ID%
set ORIG_BUILD_ID=
exit 0

What the batch command does is:
stop the mspdbsrv.exe to free up resources
start mspdbsrv.exe with BUILD_ID=DoNotKillMe and a shutdowntime of 25 hours, that leaks the mspdbsrv process without getting killed and it runs for 25 hours so that other build jobs can use the already running process

What you maybe have to do is to change the Path to mspdbsrv -> set MSPDBSRV_PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE

mbrock@esri.com (JIRA)

unread,
Sep 13, 2016, 7:18:06 PM9/13/16
to jenkinsc...@googlegroups.com

Updating the msbuild plugin won't work in our situation. We run into this issue, but we don't have the plugin installed. Rather the issue comes for us in the Final Builder scripts we run via Jenkins that call msbuild.

dbeck@cloudbees.com (JIRA)

unread,
Sep 14, 2016, 10:39:07 PM9/14/16
to jenkinsc...@googlegroups.com

m_winter@gmx.de (JIRA)

unread,
Dec 11, 2016, 2:58:03 PM12/11/16
to jenkinsc...@googlegroups.com

set the environment variable
MSPDBSRV_ENDPOINT=$JENKINS_COOKIE
This will lead to separate instance of mspdbsrv being started.

m_winter@gmx.de (JIRA)

unread,
Dec 11, 2016, 3:00:03 PM12/11/16
to jenkinsc...@googlegroups.com
Markus Winter edited a comment on Bug JENKINS-9104
set the environment variable
{{ _MSPDBSRV_ENDPOINT_=$JENKINS_COOKIE }}
This will lead to separate instance of mspdbsrv being started.

m_winter@gmx.de (JIRA)

unread,
Dec 11, 2016, 3:01:04 PM12/11/16
to jenkinsc...@googlegroups.com
Markus Winter edited a comment on Bug JENKINS-9104
set the environment variable
{{
_MSPDBSRV_ENDPOINT_ __MSPDBSRV_ENDPOINT__ =$JENKINS_COOKIE}}

This will lead to separate instance of mspdbsrv being started.

m_winter@gmx.de (JIRA)

unread,
Dec 11, 2016, 3:01:25 PM12/11/16
to jenkinsc...@googlegroups.com
Markus Winter edited a comment on Bug JENKINS-9104
set the environment variable
{{__MSPDBSRV_ENDPOINT__=$JENKINS_COOKIE}}
(The variable starts and ends with a single '_')
This will lead to separate instance of mspdbsrv being started.

mark.grills@gmail.com (JIRA)

unread,
Dec 21, 2016, 11:51:07 PM12/21/16
to jenkinsc...@googlegroups.com

Markus Winter, thanks for the pointer.

We couldn't get it working with $JENKINS_COOKIE but managed to correct it by adding the following property via EnvInject prior to kicking off the build

MSPDBSRV_ENDPOINT=$BUILD_TAG

This resulted in a separate process being initiated for each build and no conflicts/error.

daniel.fischer@iqdoq.de (JIRA)

unread,
Dec 22, 2016, 3:50:09 AM12/22/16
to jenkinsc...@googlegroups.com

daniel.fischer@iqdoq.de (JIRA)

unread,
Dec 22, 2016, 3:55:03 AM12/22/16
to jenkinsc...@googlegroups.com
Daniel Fischer edited a comment on Bug JENKINS-9104
Is it It is {noformat} _MSPDBSRV_ENDPOINT_ {noformat} (with underlines) or is it not MSPDBSRV_ENDPOINT ? .

Just realized it myself that it's a formatting issue. If you enclose the word in underlines it will get italicised and the underlines disappear. ;)

mark.grills@gmail.com (JIRA)

unread,
Dec 22, 2016, 4:45:03 AM12/22/16
to jenkinsc...@googlegroups.com

mark.grills@gmail.com (JIRA)

unread,
Dec 22, 2016, 5:24:09 AM12/22/16
to jenkinsc...@googlegroups.com
Mark Grills edited a comment on Bug JENKINS-9104
[~mwinter69], thanks for the pointer.


We couldn't get it working with $JENKINS_COOKIE but managed to correct it by adding the following property via EnvInject prior to kicking off the build

{noformat} _MSPDBSRV_ENDPOINT_ {noformat} =$BUILD_TAG


This resulted in a separate process being initiated for each build and no conflicts/error.

Edit: Correction. Refer below

mark.grills@gmail.com (JIRA)

unread,
Dec 22, 2016, 5:24:13 AM12/22/16
to jenkinsc...@googlegroups.com
Mark Grills edited a comment on Bug JENKINS-9104
[~mwinter69], thanks for the pointer.

We couldn't get it working with $JENKINS_COOKIE but managed to correct it by adding the following property via EnvInject prior to kicking off the build

{noformat}_MSPDBSRV_ENDPOINT_ {noformat} =$BUILD_TAG {noformat}

This resulted in a separate process being initiated for each build and no conflicts/error.

Edit: Correction. Refer below

mark.grills@gmail.com (JIRA)

unread,
Dec 22, 2016, 5:25:02 AM12/22/16
to jenkinsc...@googlegroups.com
Mark Grills edited a comment on Bug JENKINS-9104
[~mwinter69], thanks for the pointer.

We couldn't get it working with $JENKINS_COOKIE but managed to correct it by adding the following property via EnvInject prior to kicking off the build

{noformat}_MSPDBSRV_ENDPOINT_=$BUILD_TAG{noformat}


This resulted in a separate process being initiated for each build and no conflicts/error.

Edit: Correction due to formatting . Refer below

andy@andne.net (JIRA)

unread,
Feb 6, 2017, 6:14:17 PM2/6/17
to jenkinsc...@googlegroups.com

We recently re-encountered this on our build network and I did some investigation, here's what I found:

  • On the master node, the veto from MSBuild plugin works properly, I was able to confirm the log message show it.
  • On a slave node, I do not see the log message from the veto. Instead I see a message that my process is being killed recursively (I was watching the process list to get the id during the build).

It appears that the veto logic doesn't execute on the slave nodes. Is there something special that has to be done in order for it to be detected and executed there? I don't understand enough about how the remoting logic in Jenkins operates to know the answer to this.

Most of the other work-arounds for this are ones that we cannot easily deploy in our environment. If this is truly the issue, does anyone have an idea what it would take to fix it and how long that would take to carry out?

andy@andne.net (JIRA)

unread,
Feb 6, 2017, 6:52:02 PM2/6/17
to jenkinsc...@googlegroups.com

I spent some more time chasing code and I have a suspicion as to the cause of the issue. In ProcessTree.java, there are two different functions that appear to need information from the master and yet operate in different manners

  • getVeto() is how the whitelist extension is accessed to block the killing of the process. This function just gets the list as it exists, no attempt to go ask the master for any information.
  • getKillers() is used to access the list of ProcessKillers if there are any classes implementing that extension point. This function gets the channel back to the master so it can ask for the master's list of classes implementing this extension.

I think that getVeto() needs to have part of it implemented more like getKillers(), so that it will go to the master for the list. It may be also that the accessor belongs in ProcessTree instead, so that it caches the data and doesn't go back to the master quite as much. Then, I think the veto logic should work properly on both a master and a slave. Unfortuntely, this means a change to Jenkins core and upgrading the full instance to fix the issue instead of just a fix to the plugin itself.

stefan.walter@lisec.com (JIRA)

unread,
Feb 25, 2017, 2:26:14 AM2/25/17
to jenkinsc...@googlegroups.com

Is there any workaround to this issue, because it completely breaks our usage of Jenkins?

mark.grills@gmail.com (JIRA)

unread,
Feb 25, 2017, 4:18:04 AM2/25/17
to jenkinsc...@googlegroups.com

stefan.walter@lisec.com (JIRA)

unread,
Feb 25, 2017, 7:53:09 AM2/25/17
to jenkinsc...@googlegroups.com

david.aldrich@emea.nec.com (JIRA)

unread,
Apr 25, 2018, 1:28:12 PM4/25/18
to jenkinsc...@googlegroups.com

Please can anyone advise me how to set _MSPDBSRV_ENDPOINT_ with value BUILD_TAG in a pipeline declarative script?

I don’t really understand the difference between defining and injecting an environment variable. I could do:

stage('build_VisualStudio') {
        environment { _MSPDBSRV_ENDPOINT_=$BUILD_TAG }
etc.

Would that be sufficient or must environment variable injection be done in a different way?

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

scm_issue_link@java.net (JIRA)

unread,
Apr 30, 2018, 2:43:04 PM4/30/18
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Apr 30, 2018, 2:43:16 PM4/30/18
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Daniel Beck
Path:
content/_data/changelogs/weekly.yml

http://jenkins-ci.org/commit/jenkins.io/62409d42a5769cac66337cbd4b5df5754f0e2384
Log:
Merge pull request #1522 from daniel-beck/changelog-2.119-amended

Remove JENKINS-9104 fix from release to unblock it

scm_issue_link@java.net (JIRA)

unread,
May 2, 2018, 6:48:04 PM5/2/18
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/hudson/util/ProcessTree.java
test/src/test/java/hudson/util/ProcessTreeKillerTest.java
http://jenkins-ci.org/commit/jenkins/3465da4764c322baf4fb5b90651ef6b9bcd409fb
Log:
Merge pull request #3419 from dwnusbaum/JENKINS-9104-test-fix

Fix test failure by cleaning up static state after tests

Compare: https://github.com/jenkinsci/jenkins/compare/ddbc4bbce7d3...3465da4764c3
*NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

Functionality will be removed from GitHub.com on January 31st, 2019.

dbeck@cloudbees.com (JIRA)

unread,
May 7, 2018, 11:05:12 AM5/7/18
to jenkinsc...@googlegroups.com
Daniel Beck resolved as Fixed
 

Jenkins 2.120 contains a fix for the previous problem of the ProcessKillingVeto extension point not working on agents.

Jenkins / Bug JENKINS-9104
Change By: Daniel Beck
Status: Reopened Resolved
Resolution: Fixed

alexxxx89@ya.ru (JIRA)

unread,
Feb 15, 2019, 4:02:04 AM2/15/19
to jenkinsc...@googlegroups.com
John Doe commented on Bug JENKINS-9104
 
Re: Visual studio builds started by Jenkins fail with "Fatal error C1090" because mspdbsrv.exe gets killed

I'm occasionally getting this error with the latest versions of Jenkins and all the plugins. It started in the recent months, haven't been a problem for a year before that. The problem seems to have NOT been resolved, or possibly re-emerged.

What can I do, is there a workaround? Sporadic build failures for no reason are super annoying.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

billhoo@126.com (JIRA)

unread,
Feb 15, 2019, 4:07:03 AM2/15/19
to jenkinsc...@googlegroups.com
Bill Hoo commented on Bug JENKINS-9104

Same error with latest Jenkins ver. 2.150.3

The error is aways occured when running two jobs concurrently on the same agent with VS2015:
fatal error C1090: PDB API

alexxxx89@ya.ru (JIRA)

unread,
Feb 15, 2019, 4:10:04 AM2/15/19
to jenkinsc...@googlegroups.com
John Doe commented on Bug JENKINS-9104

Bill Hoo, thanks for the tip! I was running VS 2017 (v141 toolset), but there were indeed two simultaneous jobs! So the workaround is to limit this agent to one job at a time. Pity, as it's a pretty powerful multicore server, but it's better than flaky builds.

billhoo@126.com (JIRA)

unread,
Feb 15, 2019, 4:17:03 AM2/15/19
to jenkinsc...@googlegroups.com
Bill Hoo commented on Bug JENKINS-9104

John Doe, totaly the same, we have many different jobs which use MSVC14 as toolchain, but now we can only perform one build at a time, its a huge waste of mashine resources ;(

Hope it can be truly solved.

andreas.ringlstetter@gmail.com (JIRA)

unread,
Feb 15, 2019, 4:50:04 AM2/15/19
to jenkinsc...@googlegroups.com

Solution is still the same, before invoking `msbuild`, set the following environment variables to something unique:

_MSPDBSRV_ENDPOINT_=<UUID>
TMP=<Unique Tempdir>
TEMP=$TMP
TMPDIR=$TMP

Once you have done that, you can launch as many parallel MSBuild instances as you like, even mixing different msbuild versions or whatever. They will not interfere in any way. Dong that on a regular base with mixed MSVC12, MSVC14 and MSVC15 toolchains on the same machine, and didn't have any issues since.

andreas.ringlstetter@gmail.com (JIRA)

unread,
Feb 15, 2019, 4:52:04 AM2/15/19
to jenkinsc...@googlegroups.com
Andreas Ringlstetter edited a comment on Bug JENKINS-9104
Solution is still the same, before invoking `msbuild`, set the following environment variables to something unique:

{code:java}_MSPDBSRV_ENDPOINT_=<UUID>
TMP=<Unique Tempdir>
TEMP=$TMP
TMPDIR=$TMP{code}

Once you have done that, you can launch as many parallel MSBuild instances as you like, even mixing different msbuild versions or whatever. They will not interfere in any way.
Dong Doing that on a regular base with mixed MSVC12, MSVC14 and MSVC15 toolchains on the same machine, and didn't have any issues since.

andreas.ringlstetter@gmail.com (JIRA)

unread,
Feb 15, 2019, 5:00:04 AM2/15/19
to jenkinsc...@googlegroups.com
Andreas Ringlstetter edited a comment on Bug JENKINS-9104
Solution is still the same, before invoking `msbuild`, set the following environment variables to something unique:

{code:java}_MSPDBSRV_ENDPOINT_=<UUID>
TMP=<Unique Tempdir>
TEMP=$TMP
TMPDIR=$TMP{code}

Once you have done that, you can launch as many parallel MSBuild instances as you like, even mixing different msbuild versions or whatever. They will not interfere in any way. Doing that on a regular base with mixed MSVC12, MSVC14 and MSVC15 toolchains on the same machine, and didn't have any issues since.

The "official" fix for this problem (trying not to kill the job scheduler) is plain wrong, and causes massive issues. Mostly because MSBuild itself isn't exactly stable either when using the same job server for multiple parallel builds. And if the builds are using different toolchains, a crash is ensured.

roman@pickl.eu (JIRA)

unread,
Apr 21, 2020, 7:34:04 AM4/21/20
to jenkinsc...@googlegroups.com

I used Andreas Ringlstetter's solution:

https://issues.jenkins-ci.org/browse/JENKINS-9104?focusedCommentId=360603&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-360603

we solved it like this in a jenkins github multi-branch setup with jenkinsfiles:
bat """
mkdir tmp
set MSPDBSRV_ENDPOINT= ${BUILD_TAG}
set TMP=${Workspace}
tmp
set TEMP=${Workspace}
tmp
set TMPDIR=${Workspace}
tmp
build.bat
"""

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

roman@pickl.eu (JIRA)

unread,
Apr 21, 2020, 7:35:05 AM4/21/20
to jenkinsc...@googlegroups.com
Roman Pickl edited a comment on Bug JENKINS-9104

we solved it like this in a jenkins github multi-branch setup with jenkinsfiles:
{code:java}
bat """
mkdir tmp
set _MSPDBSRV_ENDPOINT_= ${BUILD_TAG}

set TMP=${Workspace}\\tmp
set TEMP=${Workspace}\\tmp
set TMPDIR=${Workspace}\\tmp
build.bat
""" {code}
 
Reply all
Reply to author
Forward
0 new messages