Author Topic: CMake test freezes when run from Code::Blocks but not from command line  (Read 2485 times)

Offline Cozwa

  • Single posting newcomer
  • *
  • Posts: 2
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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CMake test freezes when run from Code::Blocks but not from command line
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]