Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: private_joker on January 10, 2010, 07:54:15 am

Title: Bug in Code Comletion plugin (CPU overload).
Post by: private_joker 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.

Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: private_joker on January 10, 2010, 10:54:42 am
Ooops, it seems wrong sub forum. Moderators, please move it to right place.
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: ollydbg 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...). :(
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: chikigai 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.
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: ollydbg 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 (http://forums.codeblocks.org/index.php/topic,11790.msg79992.html#msg79992)

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.
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: Loaden on January 13, 2010, 02:44:47 am
Please try VC6.0 compiler, but NOT VC 2005?
It's seems only VC2005's question?
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: blueshake 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).
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: nguray 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.
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: Jenna 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 ?
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: Loaden 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 (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.
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: ollydbg on January 19, 2010, 07:39:36 am
I have found the bug, see here Re: The 16 January 2010 build (6088) is out. (http://forums.codeblocks.org/index.php/topic,11875.msg80774/topicseen.html#msg80774).

I think this bug can be fixed soon. There is a logic error in parsing typedef statement.
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: private_joker on January 21, 2010, 11:44:08 pm
I have found the bug, see here Re: The 16 January 2010 build (6088) is out. (http://forums.codeblocks.org/index.php/topic,11875.msg80774/topicseen.html#msg80774).

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.
Title: Re: Bug in Code Comletion plugin (CPU overload).
Post by: ollydbg on January 22, 2010, 02:40:22 am
I have found the bug, see here Re: The 16 January 2010 build (6088) is out. (http://forums.codeblocks.org/index.php/topic,11875.msg80774/topicseen.html#msg80774).

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. (http://forums.codeblocks.org/index.php/topic,11875.msg80805.html#msg80805)