Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Cozwa on November 07, 2017, 09:47:16 am

Title: CMake test freezes when run from Code::Blocks but not from command line
Post by: Cozwa on November 07, 2017, 09:47:16 am
Hi there,

my setup is
- Windows 7 x64
- msys2 x64
- code::blocks 16.01
- cmake 3.9.4
- gcc 7.2.0

I generated a .cbp file with CMake Gui. After building my library with "build all" I'm running my cmake tests with "build test".
Ever so often (estimated 1 in 4) the test does not finish even after a sensible waiting time, e.g. the test normally takes about 0.2 seconds and I wait for more than 2 minutes. My log file does not indicate any error or problem, it just stops at a seemingly random point.

When I navigate to the build directory in a msys2 shell and run "ctest" I never encounter that behavior (ran it in a loop a few hundred times).

The code that I'm testing is about a thread pool, so it is not impossible that there is some deadlock or similar issue. But I wonder why that would only occur when running ctest from within code::blocks.

I'm aware that this isn't much useful information, if anyone has ideas how I can add more helpful details, I would appreciate it.

So my question is: What could cause the different behavior of running ctest from within code::blocks and from a shell?
Title: Re: CMake test freezes when run from Code::Blocks but not from command line
Post by: oBFusCATed on November 07, 2017, 10:22:43 am
The easiest explanation is different scheduling. I don't know if we change the priorities of the build processes, though.

Use a debugger to see where the process has stopped and try to find an explanation.
Most probably you have some threading bug and this is a good time to try and fix it.