News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

codecompletion plugin will eat 100% CPU usage

Started by kipade, November 28, 2012, 10:06:39 AM

Previous topic - Next topic

kipade

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.

oBFusCATed

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!]

MortenMacFly

Quote from: kipade on November 28, 2012, 10:06:39 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

kipade

Quote from: oBFusCATed 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?
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.

kipade

Quote from: MortenMacFly on November 28, 2012, 11:19:08 AM
Quote from: kipade on November 28, 2012, 10:06:39 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.

ollydbg

QuoteI 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.

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

kipade

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

kipade

However, I still hope someone would like to help me to resovle this problem under Slackware.

davec55

#9
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.