CMake gets freezed during compilation on Windows 10

I am having some issues while compiling my CMAKE project, it gets freezed once in a while during the compilation process. Sometimes I saw the issue once in a week, and sometimes several times in an hour. I migrated my computer from Windows 7 to Windows 10 about 4 months ago, and that’s the time I started to see this issue. I’ve been working with this project for about two years without any issues (with Windows 7). Once it gets freezed, there is no way to abort the compilation, not even using CTRL+C.

Here are the steps I did trying to found the root cause once it gets freezed:

  1. Ge the process ID of the git-cmd console

  2. Get the process tree for the git-cmd ID

2.1 Test 1


  1. Using the cmd ID, run a process explorer app to get the path of the file where it got stuck

  2. Open the batch file to get the command executed

4.1 Test 1

This is the content of the make12424-1.bat:
@echo off
D:\Proj\platform\tools\cmake_bin_v3.6.1\bin\cmake.exe -E cmake_echo_color --switch= --green --progress-dir=D:\Proj\platform\build\mla\app\IAR_ARM\variant\CMakeFiles --progress-num=53 “Building C object 0/dcl/CMakeFiles/dcl_app_0.dir/Implementation/Private/CS43x5.c.obj”

  1. Object creation:

5.1 Test 1

The .obj was not created.

6 The only way to start the compilation again is to close the git-and open a new one, or by killing the process.

After the process was killed, the compilation continued but with errors.

Is there a CMAKE known issue with Windows 10? I also tried to fix this issue by updating my CMAKE version to the latest one (cmake_v3.20.2), but I was able to reproduce the issue also. Do you know how can I fix this behavior? Thanks for your support.

It’s not the same platform, but there is this report. I doubt it’s exactly related, but they sound similar at least…

That said, I don’t know much about debugging this kind of stuff on Windows. I would suggest Process Monitor to see what the last thing performed was at least. Next best would be to use some strace-like utility to see where it is hung. Maybe you can get a debugger attached?

Could you try and provide an example that can reproduce the issue? It’d be great if you could provide a SSCCE.

Hi Juan,
I haven’t identified a way to reproduce the issue, it happens sometimes with the same code that compiles fine the rest of the times. I will try to find a way to reproduce it. The only thing I identify is that I never saw this issue on my windows 7 machine. Thanks!

Hi Ben,
I already identified that it get stuck on the CMD, and using the app explorer it seems to be a dynamic batch file created by CMake, I will try to get a CMake log to see if it helps, thanks!