Author Topic: codecompletion plugin will eat 100% CPU usage  (Read 7379 times)

Offline kipade

  • Multiple posting newcomer
  • *
  • Posts: 50
codecompletion plugin will eat 100% CPU usage
« on: November 28, 2012, 10:06:39 am »
My os is GNU/Linux slackware 14.0
I tried version from svn 8598 to 8628
wxWidgets 2.9.4
If I enabled codecomplete plugin, it will eat 100% CPU usage.
Is there anyone have the same problem?
I don't know how to fix it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: codecompletion plugin will eat 100% CPU usage
« Reply #1 on: November 28, 2012, 10:16:02 am »
For what kind of projects does this happens?
Does it happen on simple hello world projects or it is only on the bigger ones?
(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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: codecompletion plugin will eat 100% CPU usage
« Reply #2 on: November 28, 2012, 11:19:08 am »
If I enabled codecomplete plugin, it will eat 100% CPU usage.
This is OK, if C::B parses your files. Don't worry - it has less priority than other processes, but we also try to scan as fast as possible. However, after a while the 100% CPU load will be gone. How long did you wait? Do you have a sample project?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline kipade

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: codecompletion plugin will eat 100% CPU usage
« Reply #3 on: November 29, 2012, 04:09:21 am »
For what kind of projects does this happens?
Does it happen on simple hello world projects or it is only on the bigger ones?
No, helloworld project included. Here, If I only create the helloworld project, compile and run it directly, all the things ok. However, if I open its source code, CPU go up to 100%. In addition, if any project opened, CB could not exit, paused at log "Deinitializing plugins...", CPU usage stills high.

Offline kipade

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: codecompletion plugin will eat 100% CPU usage
« Reply #4 on: November 29, 2012, 04:11:44 am »
If I enabled codecomplete plugin, it will eat 100% CPU usage.
This is OK, if C::B parses your files. Don't worry - it has less priority than other processes, but we also try to scan as fast as possible. However, after a while the 100% CPU load will be gone. How long did you wait? Do you have a sample project?
I don't think its OK, because the CPU usage goes up once, it will not go down! eat all the cpu resource without release.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: codecompletion plugin will eat 100% CPU usage
« Reply #5 on: November 29, 2012, 04:19:04 am »
Quote
I tried version from svn 8598 to 8628
wxWidgets 2.9.4
So, you build C::B against wx2.9.4? Or did you just use some pre-build binaries?
It looks like the CC parser goes to an endless loop, but I can't reproduce this. (I'm under WinXP, no Linux at hand).
Can you try to debug C::B under C::B(If you can build C::B, I believe you can debug it), and hit the pause key when you see Codecompletion hangs, and see where is the infinite loop.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: codecompletion plugin will eat 100% CPU usage
« Reply #6 on: November 29, 2012, 06:22:30 am »
Also, what happens if you use  an "official" (i.e. non-self-built) version?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline kipade

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: codecompletion plugin will eat 100% CPU usage
« Reply #7 on: November 30, 2012, 06:18:25 am »
Maybe the problem is not due to CB or WX.
Because I use the same version of WX and CB source code, it works find on other OS. I tried on Ubuntu 10.04 and LFS 7.7.
I think there is something went worth under my Slackware, but Im not sure which features used by codecompletion trap into this hole.
Thanks, all

Offline kipade

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: codecompletion plugin will eat 100% CPU usage
« Reply #8 on: December 07, 2012, 07:51:02 am »
However, I still hope someone would like to help me to resovle this problem under Slackware.

Offline davec55

  • Single posting newcomer
  • *
  • Posts: 2
Re: codecompletion plugin will eat 100% CPU usage
« Reply #9 on: December 12, 2012, 11:49:12 pm »
I have the same problem and traced it to the '/usr/include/seamonkey/' directory which has 3 soft links to itself
i.e
 nss -> ./
 plugin -> ./
 xpcom -> ./

I have resolved the problem by deleting these links, but someone who knows how the codecompletion directory transversal works can perhaps detect these situations and prevent these from causing continuous loops within the thread.
« Last Edit: March 07, 2013, 08:50:43 pm by davec55 »