Author Topic: Bug in Code Comletion plugin (CPU overload).  (Read 17302 times)

Offline private_joker

  • Single posting newcomer
  • *
  • Posts: 7
Bug in Code Comletion plugin (CPU overload).
« on: January 10, 2010, 07:54:15 am »
How to reproduce:
1. Create new wxWidget project, with Microsoft Visual C++ 2005/2008 compiller option.
2. Fill all wizzard forms.
3. Open Task Manager and you see that CPU overload 50% (on Core 2 Duo) all time(!).


Additional info:
a) Software
  - Code::Blocks SVN Rev. 6065 compiled this morning by myself.
  - Visual C++ 2005 Express Edition.
  - Microsoft Platform SDK for Windows Server 2003 SP1.
  - Windows XP SP3

b) Settings in Code::Blocks

  1) Settings->Editor->Code Completion->C/C++ Parser and check "Follow GLOBAL icludes"

  2) Search directories (Project build options):
     Compiler:
     c:\Program Files\Microsoft Platform SDK\Include
     c:\Program Files\Microsoft Visual Studio 8\VC\include
     $(#wx)\include
     $(#wx)\contrib\include

     Resource compiler:
     c:\Program Files\Microsoft Platform SDK\Include


I'm absolutely sure then this bug in CC, cause when I'm:
 Switch to MinGW Toolchain || uncheck "Follow GLOBAL icludes" || Disable CC plugin at all || use oldest 8.02 Code::Blocks version or november's build founded in "Nightly" subforum
this bug isn't reproduce.


Offline private_joker

  • Single posting newcomer
  • *
  • Posts: 7
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #1 on: January 10, 2010, 10:54:42 am »
Ooops, it seems wrong sub forum. Moderators, please move it to right place.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #2 on: January 13, 2010, 01:07:20 am »
I have some interest to find the bug. It seems you have enough steps to produce the hang bug, but I don't have Visual C++ installed in my computer.( I only use TDM-GCC, it is a MinGW Compiler).

I don't know how to help you(I don't want to install a new,big compiler...). :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline chikigai

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #3 on: January 13, 2010, 02:18:56 am »
I'm experiencing a similar behavior since using the latest Nightly Build SVN Rev 6080.
The CPU Usage hits 100% (most of which is used by CB) when I open a workspace with several inter-dependent projects.

Here is what I did:
1. Open a workspace with several inter-dependent projects (5 to be exact)
- CPU Usage hits 100% (CC kicking in)
- CPU Usage stays at 100% even after several minutes
- Memory consumption of CB does not seem to change (CC stuck in infinite loop?)

2. Closed workspace
- CPU Usage stays at 100%

3. Disabled CC through Plugin Manager
- CPU Usage stays at 100%

4. Closed CB
- CPU Usage stays at 100% for a short period of time and the CB process terminates


Some other information:
- The next time I opened the workspace with CC disabled to begin with, the issue did not take place.
- I tried the above steps with a fresh default config file but the results were the same.
- The issue did not take place with a workspace which contained a single project with a fairly large number of source files
- The workspace causing issues with the current Nightly Build has no issues with the previous Nightly Build SVN Rev 6023.
[Development Environment]
OS: WinXP SP3
IDE: Code::Blocks Nightly Build SVN Rev.6080 wxWidgets: 2.8.10 Windows Unicode Build SVN: 1.6.x

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #4 on: January 13, 2010, 02:32:35 am »
I personally suspect this is a problem related to "real time parse" since rev 6045.
I have reported a similar problem, see It seems CB will hang about 10+ seconds to load the codeblocks.cbp project

I will discuss with blueshake about this issue. :D

Edit
One idea: the real time parse should be executed after the "batch parsing"(parsing the whole files in the workplace) finished.
« Last Edit: January 13, 2010, 02:38:44 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #5 on: January 13, 2010, 02:44:47 am »
Please try VC6.0 compiler, but NOT VC 2005?
It's seems only VC2005's question?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #6 on: January 13, 2010, 05:26:58 am »
I update to svn 6080(without any change,gcc)

and I open the plugin workspace with cb,everything work fine.

Quote
Parsing stage done (1682 total parsed files, 84953 tokens in 0 minute(s), 42.218 seconds).
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

nguray

  • Guest
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #7 on: January 13, 2010, 08:37:52 am »
Hello,
I have  the same problem with new build svn 6080.
I have 100% CPU usage, just with the focus set in a source file open in Code::Blocks.
My Code::Blocks is on Windows XP SP3 with MinGW.
In my opinion, it 's a IDE problem.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #8 on: January 13, 2010, 10:12:40 am »
Hello,
I have  the same problem with new build svn 6080.
I have 100% CPU usage, just with the focus set in a source file open in Code::Blocks.
My Code::Blocks is on Windows XP SP3 with MinGW.
In my opinion, it 's a IDE problem.


No problems on my XP-system (also SP3, newest updates, TDM' MinGW).
Do you have any special includes (boost or anything else) ?

Can you provide a simple test-project, where this happens ?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #9 on: January 19, 2010, 03:37:57 am »
I can confirm it, SVN 6089.
Please download this CB pack, and unpack it to D:\LoveDEV.
http://ppn.googlecode.com/files/LoveDEV.7z
if create a VC project, CPU is 50%.

Contains VC9 compiler, I promise there is no virus, there is no malicious code.
« Last Edit: January 19, 2010, 09:21:29 am by Loaden »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #10 on: January 19, 2010, 07:39:36 am »
I have found the bug, see here Re: The 16 January 2010 build (6088) is out..

I think this bug can be fixed soon. There is a logic error in parsing typedef statement.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline private_joker

  • Single posting newcomer
  • *
  • Posts: 7
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #11 on: January 21, 2010, 11:44:08 pm »
I have found the bug, see here Re: The 16 January 2010 build (6088) is out..

I think this bug can be fixed soon. There is a logic error in parsing typedef statement.
Thank you for interest, but in SVN rev. 6098 problem still exists.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bug in Code Comletion plugin (CPU overload).
« Reply #12 on: January 22, 2010, 02:40:22 am »
I have found the bug, see here Re: The 16 January 2010 build (6088) is out..

I think this bug can be fixed soon. There is a logic error in parsing typedef statement.
Thank you for interest, but in SVN rev. 6098 problem still exists.

This can be solved by Re: The 16 January 2010 build (6088) is out.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.