high cpu with version 5.4

CodeLite installation/troubleshooting forum
bobcat
CodeLite Enthusiast
Posts: 11
Joined: Wed Aug 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: c++
Contact:

high cpu with version 5.4

Post by bobcat »

Hello,

I tried to use Codelite 5.4.
The process consumes 100% CPU (one of the cores). GDB shows that it constantly creates new threads with fork(). I tried to stop process several times and it the backtrace shows that process somewhere in TagsManager::StartCodeLiteIndexer():

#0 0x0000003bdb4acdbd in fork () from /lib64/libc.so.6
#1 0x00007fd28cfcadc6 in UnixProcessImpl::Execute(wxEvtHandler*, wxString const&, IProcessCreateFlags, wxString const&, IProcessCallback*) ()
from /usr/lib64/codelite/liblibcodelite.so
#2 0x00007fd28cfe763d in TagsManager::StartCodeLiteIndexer() () from /usr/lib64/codelite/liblibcodelite.so
#3 0x00007fd28d8696ec in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/local/lib/libwx_baseu-3.0.so.0
#4 0x00007fd28d86a69b in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/local/lib/libwx_baseu-3.0.so.0
#5 0x00007fd28d86a76a in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/local/lib/libwx_baseu-3.0.so.0
#6 0x00007fd28d86ad73 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/local/lib/libwx_baseu-3.0.so.0
#7 0x00007fd28d86add5 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/local/lib/libwx_baseu-3.0.so.0
#8 0x00007fd28d86b991 in wxEvtHandler::ProcessPendingEvents() () from /usr/local/lib/libwx_baseu-3.0.so.0
#9 0x00007fd28d73d58f in wxAppConsoleBase::ProcessPendingEvents() () from /usr/local/lib/libwx_baseu-3.0.so.0
#10 0x00007fd28e1d8a83 in wxApp::DoIdle() () from /usr/local/lib/libwx_gtk2u_core-3.0.so.0
#11 0x00007fd28e1d8b83 in wxapp_idle_callback () from /usr/local/lib/libwx_gtk2u_core-3.0.so.0
#12 0x0000003bdc83feb2 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#13 0x0000003bdc843d68 in ?? () from /lib64/libglib-2.0.so.0
#14 0x0000003bdc844275 in g_main_loop_run () from /lib64/libglib-2.0.so.0
#15 0x0000003be4949da7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#16 0x00007fd28e1ef1a5 in wxGUIEventLoop::DoRun() () from /usr/local/lib/libwx_gtk2u_core-3.0.so.0
#17 0x00007fd28d774ebc in wxEventLoopBase::Run() () from /usr/local/lib/libwx_baseu-3.0.so.0
#18 0x00007fd28d740332 in wxAppConsoleBase::MainLoop() () from /usr/local/lib/libwx_baseu-3.0.so.0
#19 0x00007fd28d7addc5 in wxEntry(int&, wchar_t**) () from /usr/local/lib/libwx_baseu-3.0.so.0
#20 0x00000000008b514e in main ()

How can it possible to fix the issue?
Thanks in advance
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: high cpu with version 5.4

Post by eranif »

It seems that codelite_indexer could not be started on your machine.

1. Is it a self compiled codelite?
2. Do you have /usr/bin/codelite_indexer binary installed?
3. Does it start? (try to start manually)

Eran
Make sure you have read the HOW TO POST thread
bobcat
CodeLite Enthusiast
Posts: 11
Joined: Wed Aug 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: high cpu with version 5.4

Post by bobcat »

Yes, it is self compiled version.
indexer exists, but it missing libraries from wx:

ldd /usr/bin/codelite_indexer
linux-vdso.so.1 => (0x00007fff733ff000)
libwx_gtk2u_core-3.0.so.0 => not found
libwx_baseu-3.0.so.0 => not found
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003be7400000)
libm.so.6 => /lib64/libm.so.6 (0x0000003bdb000000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003be6000000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003bdb800000)
libc.so.6 => /lib64/libc.so.6 (0x0000003bdb400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003bdac00000)

So, the issue is not related to codelite.
Thanks for help.
bobcat
CodeLite Enthusiast
Posts: 11
Joined: Wed Aug 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: high cpu with version 5.4

Post by bobcat »

I checked the codelite binary.

ldd /usr/bin/codelite | grep wx
libwx_gtk2u_aui-3.0.so.0 => /usr/local/lib/libwx_gtk2u_aui-3.0.so.0 (0x00007fec93e53000)
libwx_gtk2u_propgrid-3.0.so.0 => /usr/local/lib/libwx_gtk2u_propgrid-3.0.so.0 (0x00007fec93b3c000)
libwx_gtk2u_stc-3.0.so.0 => /usr/local/lib/libwx_gtk2u_stc-3.0.so.0 (0x00007fec936ff000)
libwx_gtk2u_xrc-3.0.so.0 => /usr/local/lib/libwx_gtk2u_xrc-3.0.so.0 (0x00007fec933cc000)
libwx_gtk2u_html-3.0.so.0 => /usr/local/lib/libwx_gtk2u_html-3.0.so.0 (0x00007fec930cd000)
libwx_gtk2u_qa-3.0.so.0 => /usr/local/lib/libwx_gtk2u_qa-3.0.so.0 (0x00007fec92e80000)
libwx_gtk2u_adv-3.0.so.0 => /usr/local/lib/libwx_gtk2u_adv-3.0.so.0 (0x00007fec92a71000)
libwx_gtk2u_core-3.0.so.0 => /usr/local/lib/libwx_gtk2u_core-3.0.so.0 (0x00007fec921e2000)
libwx_baseu_xml-3.0.so.0 => /usr/local/lib/libwx_baseu_xml-3.0.so.0 (0x00007fec91faf000)
libwx_baseu_net-3.0.so.0 => /usr/local/lib/libwx_baseu_net-3.0.so.0 (0x00007fec91d72000)
libwx_baseu-3.0.so.0 => /usr/local/lib/libwx_baseu-3.0.so.0 (0x00007fec91930000)
libwxsqlite3.so => /usr/lib64/codelite/libwxsqlite3.so (0x00007fec91660000)

The libraries missing in indexer were linked correct into codelite binary.
Is there any difference in build process between codelite and codelite_indexer?

Thanks in advance
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: high cpu with version 5.4

Post by eranif »

RPATH settings. But I am pretty sure that RPATH should be applied to all binaries
I will double check this

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: high cpu with version 5.4

Post by eranif »

What do you get when run:

Code: Select all

readelf -d /usr/bin/codelite_indexer |grep RPATH
Eran
Make sure you have read the HOW TO POST thread
bobcat
CodeLite Enthusiast
Posts: 11
Joined: Wed Aug 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: high cpu with version 5.4

Post by bobcat »

RPATH in codelite_indexer is missing one directory:

readelf -d /usr/bin/codelite_indexer | grep RPATH
0x000000000000000f (RPATH) Library rpath: [/usr/lib64/codelite:/usr/lib64/codelite]

readelf -d /usr/bin/codelite | grep RPATH
0x000000000000000f (RPATH) Library rpath: [/usr/lib64/codelite:/usr/lib64/codelite:/usr/local/lib]
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: high cpu with version 5.4

Post by eranif »

Its not missing it...
If the wx is installed under /usr/local/lib then it means that it is a self compiled wxWidgets, and _you_ should have add it to your LD_LIBRARY_PATH
In other cases:
1. If it is a binary provided by us, then we also copy the wxWidgets libraries to /usr/lib/codelite/, so the RPATH is enough
2. If it is a distro wxWidgets library, then it will be placed under /usr/lib - which is also fine

In your case, you compiled wxWidgets and installed it into /usr/local/lib, so you need to add it to your LD_LIBRARY_PATH

The only question remaining is: how did /usr/local/lib got into codelite binary...

Eran
Make sure you have read the HOW TO POST thread
bobcat
CodeLite Enthusiast
Posts: 11
Joined: Wed Aug 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: high cpu with version 5.4

Post by bobcat »

wxWidget is indeed self compiled.
LD_LIBRARY_PATH is a good workaround.

How can it possible to track the source of /usr/local/lib?
Does CMake has any log files?
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: high cpu with version 5.4

Post by DavidGH »

Hi,
How can it possible to track the source of /usr/local/lib?
That path is the default for a wxWidgets build (and, more generally, for most app builds on most Linux distros). To change it, configure with --prefix=/usr/ to install into /usr/lib/ (risks clobbering, or conflicting with, wx packages) or, as I do all the time:

Code: Select all

mkdir builddir && cd builddir && ../configure --prefix=$(pwd) --whatever-else
to 'install' to a subdir of the wx source. Then 'make' but don't 'make install'. This has the great advantage that it doesn't conflict with anything, and make it easy to have multiple wx build-types (just build each in a different subdir) and versions. However its disadvantage is that you have to specify the path to that build when you build with wx; I usually prepend it to that terminal's $PATH, or specify it in that CodeLite project configuration's compile/linker settings.

Regards,

David
Post Reply