Codelite using 100% of a CPU core even when idle [SOLVED]

CodeLite installation/troubleshooting forum
Rogerborg
CodeLite Curious
Posts: 4
Joined: Fri Oct 22, 2010 6:57 pm
Genuine User: Yes
IDE Question: C++
Contact:

Codelite using 100% of a CPU core even when idle [SOLVED]

Post by Rogerborg »

SOLVED = Bad Ubuntu install.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Ubuntu 10.04 LTS using Codelite v2.7.0.4375, installed from codelite_2.7.0.4375-ubuntu0_i386.deb obtained from http://kent.dl.sourceforge.net/project/ ... 0_i386.deb

Codelite is stock - I haven't changed the default plugins. It is using most of a CPU core even when idle, i.e. when starting up with no workspace loaded yet.

top:

Code: Select all

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                             
12084 colinmcd  20   0  180m  78m  20m R   53  2.0   5:22.11 codelite 
The issue appears to be that Codelite is forking (actually cloneing) like crazy:

Code: Select all

ps -ef | grep codelite
colinmcd 12084     1 48 15:55 ?        00:06:21 codelite

strace -p 12084 -o /tmp/straced
less /tmp/straced

Process 12084 attached - interrupt to quit
^CProcess 12084 detached
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb5a257c8) = 3652
--- SIGCHLD (Child exited) @ 0 (0) ---
futex(0xb60cc838, FUTEX_WAKE_PRIVATE, 1) = 1
chdir("/home/colinmcd/.codelite")       = 0
close(8)                                = 0
close(11)                               = 0
sched_get_priority_max(SCHED_OTHER)     = 0
sched_get_priority_min(SCHED_OTHER)     = 0
clone(child_stack=0xb54c33f4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb54c3bd8, {entry_number:6, base_addr:0xb54c3b70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb54c3bd8) = 3654
futex(0xb4301160, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0xb430115c, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
read(5, 0x8ebe5a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
gettimeofday({1287760185, 800029}, NULL) = 0
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=6, events=POLLIN}], 4, 0) = 0 (Timeout)
close(10)                               = 0
close(9)                                = 0
kill(3652, SIG_0)                       = -1 ESRCH (No such process)
waitpid(3652, 0xbfc68928, 0)            = -1 ECHILD (No child processes)
stat64("/usr/bin/codelite_indexer", {st_mode=S_IFREG|0755, st_size=226464, ...}) = 0
pipe([8, 9])                            = 0
pipe([10, 11])                          = 0
getcwd("/home/colinmcd/.codelite", 1024) = 25
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb5a257c8) = 3655
chdir("/home/colinmcd/.codelite")       = 0
close(8)                                = 0
close(11)                               = 0
sched_get_priority_max(SCHED_OTHER)     = 0
sched_get_priority_min(SCHED_OTHER)     = 0
clone(child_stack=0xb54c33f4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb54c3bd8, {entry_number:6, base_addr:0xb54c3b70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb54c3bd8) = 3656
read(5, 0x8ebe5a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
gettimeofday({1287760185, 807855}, NULL) = 0
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=6, events=POLLIN}], 4, 4) = 0 (Timeout)
gettimeofday({1287760185, 812167}, NULL) = 0
read(5, 0x8ebe5a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
gettimeofday({1287760185, 812261}, NULL) = 0
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=6, events=POLLIN}], 4, 0) = 0 (Timeout)
read(5, 0x8ebe5a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
gettimeofday({1287760185, 812370}, NULL) = 0
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=6, events=POLLIN}], 4, 0) = 0 (Timeout)
read(5, 0x8ebe5a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
--- SIGCHLD (Child exited) @ 0 (0) ---
gettimeofday({1287760185, 827168}, NULL) = 0
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=6, events=POLLIN}], 4, 0) = 1 ([{fd=3, revents=POLLIN}])
read(3, "A", 1)                         = 1
close(10)                               = 0
close(9)                                = 0
kill(3655, SIG_0)                       = -1 ESRCH (No such process)
waitpid(3655, 0xbfc68928, 0)            = -1 ECHILD (No child processes)
stat64("/usr/bin/codelite_indexer", {st_mode=S_IFREG|0755, st_size=226464, ...}) = 0
...

strace -p 12084 -ff -o /tmp/straced
Process 11002 attached with 9 threads - interrupt to quit
Process 15176 attached
Process 15176 detached
Process 15177 attached
Process 15177 detached
Process 15178 attached
Process 15179 attached
Process 15178 detached
Process 15179 detached
Process 15180 attached
Process 15181 attached
Process 15180 detached
Process 15181 detached
Process 15182 attached
Process 15183 attached
...
ls /tmp/straced.*
/tmp/straced.10841  /tmp/straced.10999  /tmp/straced.15176  /tmp/straced.15181  /tmp/straced.15186  /tmp/straced.15191  /tmp/straced.15196
/tmp/straced.10990  /tmp/straced.11000  /tmp/straced.15177  /tmp/straced.15182  /tmp/straced.15187  /tmp/straced.15192  /tmp/straced.15197
/tmp/straced.10996  /tmp/straced.11001  /tmp/straced.15178  /tmp/straced.15183  /tmp/straced.15188  /tmp/straced.15193  /tmp/straced.15198
/tmp/straced.10997  /tmp/straced.11002  /tmp/straced.15179  /tmp/straced.15184  /tmp/straced.15189  /tmp/straced.15194
/tmp/straced.10998  /tmp/straced.12084  /tmp/straced.15180  /tmp/straced.15185  /tmp/straced.15190  /tmp/straced.15195
Apologies if this is a known issue, or there's an easy fix. I'm happy to provide more details if it would help.
Last edited by Rogerborg on Mon Oct 25, 2010 12:53 pm, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite using 100% of a CPU core by forking even when idle

Post by eranif »

Looks like codelite fails to launch the indexer.

Can you launch the indexer manually?

Try to start it manually like this:

Code: Select all

/usr/bin/codelite_indexer mysocket
does it work properly (i.e. it does not exit) ?

Eran
Make sure you have read the HOW TO POST thread
Rogerborg
CodeLite Curious
Posts: 4
Joined: Fri Oct 22, 2010 6:57 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite using 100% of a CPU core by forking even when idle

Post by Rogerborg »

Thanks for the quick response.

Well, the good news is that the same version (v2.7.0.4375) installed directly from the Canonical repository on my home Ubuntu 10.10 machine behaves fine, and doesn't display the thrashing. It looks like it's a local issue on my work machine then. The bad news is that I won't be able to try running the indexer manually until Monday morning. I'll try it then and post the results, and I'll also have a closer look into the strace to see if I can spot any problems there.
Rogerborg
CodeLite Curious
Posts: 4
Joined: Fri Oct 22, 2010 6:57 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite using 100% of a CPU core by forking even when idle

Post by Rogerborg »

eranif wrote:Looks like codelite fails to launch the indexer.

Can you launch the indexer manually?

Try to start it manually like this:

Code: Select all

/usr/bin/codelite_indexer mysocket
does it work properly (i.e. it does not exit) ?

Eran
OK, here we go:

Code: Select all

$ /usr/bin/codelite_indexer mysocket
/usr/bin/codelite_indexer: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by /usr/bin/codelite_indexer)
$ ls -l /lib/tls/i686/cmov/libc.so.6
lrwxrwxrwx 1 root root 14 2010-05-26 09:54 /lib/tls/i686/cmov/libc.so.6 -> libc-2.10.1.so
$ ldd -v /usr/bin/codelite | grep 2.11
$ 
$ aptitude show libc6
Package: libc6
State: installed
Automatically installed: no
Version: 2.10.1-0ubuntu18
Priority: required
Section: libs
Maintainer: Ubuntu Core developers <ubuntu-devel-discuss@lists.ubuntu.com>
Uncompressed Size: 9,560k
Depends: libc-bin (= 2.10.1-0ubuntu18), libgcc1, tzdata, findutils (>= 4.4.0-2ubuntu2)
Recommends: libc6-i686
Suggests: glibc-doc, debconf | debconf-2.0, locales
Conflicts: belocs-locales-bin, tzdata (< 2007k-1), tzdata-etch
Breaks: nscd (< 2.9)
Replaces: belocs-locales-bin
Provides: glibc-2.10-1
Description: GNU C Library: Shared libraries
 Contains the standard libraries that are used by nearly all programs on the system. This package includes shared versions of the standard C
 library and the standard math library, as well as many others.

Well, that's a bag of dicks. I can Google a few suggestions that Ubuntu 10.04 should have libc6-2.11, but Synaptic resolutely shows 2.10.1-0ubuntu18 as the most recent version for (my) install of 10.04. I may have a hosed install, or 10.04 may be an approximation, or libc2-11 is only in Ubuntu 10.04.1. I'll try upgrading to Ubuntu 10.04.1 later.

In the meantime though, I've just built CodeLite from source, svn 4509. That works fine - codelite_indexer runs (and keeps running) as expected, and codelite's CPU usage is low.

Thanks for the help - I'll followup that Ubuntu 10.04.1 install and see if my libc6 sorts itself out.
Rogerborg
CodeLite Curious
Posts: 4
Joined: Fri Oct 22, 2010 6:57 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite using 100% of a CPU core even when idle [SOLVED]

Post by Rogerborg »

Yup, I have a bad Ubuntu install. Colleagues with Ubuntu 10.04 installs (both clean installs and upgraded from 8.04) do have libc-2.11.1-0ubuntu7.2. I appear to have a messed up 9.10 / 10.04 hybrid system, and my libc6 has never been updated properly.

Sorry for taking up your time, the problem is entirely at my end.
Post Reply