There is a big problem when running one of my JUCE applications. The most frightful part of the problem is that the problem IS UNSTEADY! I’ve not been being able even to determine any reasons that might cause the problem. It happens at times by no sensible reasons. Sometimes I have to restart my application 10 times sequentially to reproduce the problem; at times it happens in 20 consecutive launches or so. The number of launches, before the problem occurs, is unpredictable. It resembles “The Russian roulette” game.
The problem is:
Sometimes, when the application is being launched, one of my two CPU cores becomes 100% busy until I close the application. In that condition, the application runs normally, but a single thread consumes 100% of one of a CPU core. When I kill that thread (I use “Sysinternals Process Explorer” for that) the application continues running smoothly and normally until the end, but when closed it stays in memory calmly until I kill it forcedly. I did not manage to debug the application because I couldn’t reproduce the problem in the debug mode. Seldom, this problem hangs deadly my computer – everything becomes frozen even the mouse pointer. So, only powering my computer off is able to help. First, I thought I’ve written something wrong in my code that might cause the problem but I’ve discovered that I did not start any thread within my code. Moreover, when that thread killed, the application runs normally and full-function, so all my functions are functional.
This application differs from my other small applications in two things: it shows a splash screen and it plays sounds. This happens under Windows XP SP2. The application is compiled under MinGW (GCC 4.3.0).
All I can do I can provide two screenshots from “Process Explorer” of the problem when I’ve managed to catch it.
On the screenshot below (selected line), the value of 49.24 means 50% of a CPU core time is consumed by that thread (1 core + 1 core = 50% + 50% = 100% of a whole CPU).
here is the calling stack of the thread
Can anyone help me to get rid of the problem?