The attached patch turns running kill_python(_d).exe into a PreBuildEvent in pythoncore.vcxproj. This should guarantee that kill_python(_d).exe is always run to guarantee no zombie pythons in the background can prevent overwriting the Python dll. The pythoncore project already depends on the kill_python project, so kill_python should always be built and ready before this PreBuildEvent fires. The patch also removes the separate building and running of kill_python_d.exe from the buildbot build scripts, since it should be unnecessary with the patch to pythoncore.vcxproj. Tim Peters, this patch was partly inspired by your issues in #19779; I suspect that perhaps your rebuild didn't take due to the segfaulted interpreter still hanging around in the background since the same thing happened to me doing a rebuild from the command line. Would you mind testing this patch to see if it would have helped in your case? Steps to test should be something like: - update to e39db21df580 - build, run test_concurrent_futures (expect segfault) - update to default - rebuild, run test_concurrent_futures (expect build error and segfault again) - apply patch - rebuild, run test_concurrent_futures (expect success (or usual result))
Zach, I'll try the patch soon. Will this kill _all_ Python processes? I often have some unrelated Python program(s) running when waiting for a development build to finish, so that could create real havoc. BTW, I'm sure you're right that zombie Pythons were the cause of my earlier woes.
Done. I wasn't able to provoke the failing test into leaving behind rogue processes, so I eventually just ran some python_d processes of my own. Of course that stopped the build from replacing the executables, so test_concurrent_futures kept failing. But after applying your patch, my python_d processes were indeed killed off, as expected, and test_concurrent_futures started working again. So: ship it! :-) Thanks!