]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Fix MSVC crash when using /Zi /Fddebug.pdb
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 5 Feb 2024 18:51:49 +0000 (19:51 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 5 Feb 2024 19:12:10 +0000 (20:12 +0100)
With /Zi, MSVC starts a long-lived mspdbsrv.exe background process. The
implementation of #1274 kills all processes created by ccache including
mspdbsrv.exe, which can make cl.exe crash with this error message:

    fatal error C1090: PDB API call failed, error code '23': (0x000006BA)

Fix this by setting JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK to only kill
the compiler and not processes that the compiler creates.

Fixes #1386 in a better way.

src/execute.cpp

index 0c51671bf589c6c814c3fbaa1e4b72327b6149b4..0f64f0a468584641eefa9301bd5ed1a2fced139a 100644 (file)
@@ -174,7 +174,8 @@ win32execute(const char* path,
       // process is killed.
       JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobInfo = {};
       jobInfo.BasicLimitInformation.LimitFlags =
-        JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
+        JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
+        | JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK;
       BOOL job_success = SetInformationJobObject(
         job, JobObjectExtendedLimitInformation, &jobInfo, sizeof(jobInfo));
       if (!job_success) {