codeblocks start outputs:
...
Added compiler "GNU GCC Compiler"
[New process 1532]
[LWP 1271 of process 1532 exited]
and gdb shows:
(gdb) file /usr/local/lib/libcodeblocks.so.0
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Load new symbol table from "/usr/local/lib/libcodeblocks.so.0"? (y or n) y
Reading symbols from /usr/local/lib/libcodeblocks.so.0...
(No debugging symbols found in /usr/local/lib/libcodeblocks.so.0)
(gdb) bt
#0 0x00007156dcca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
#1 0x00007156dde0b1ed in pthread_cond_timedwait (cond=0x7156dd5d4a88, mutex=0x7156dd5df140, abstime=0x0) at /usr/src/lib/libpthread/pthread_cond.c:170
#2 0x00007156de399c88 in wxConditionInternal::Wait() () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#3 0x00007156de39f92c in wxSemaphoreInternal::Wait() () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#4 0x00007156e1bacbf9 in cbThreadPool::cbWorkerThread::Entry() () from /usr/local/lib/libcodeblocks.so.0
#5 0x00007156de3a5d65 in wxThread::CallEntry() () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#6 0x00007156de3a5f63 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#7 0x00007156dde0c89f in pthread__create_tramp (cookie=0x7156de07b400) at /usr/src/lib/libpthread/pthread.c:595
#8 0x00007156dcc930e0 in ?? () from /usr/lib/libc.so.12
#9 0x0000000000000000 in ?? ()
(gdb) add-symbol-file /home/programmer/.codeblocks-20.03/src/sdk/.libs/libcodeblocks.so
add symbol table from file "/home/programmer/.codeblocks-20.03/src/sdk/.libs/libcodeblocks.so"
(y or n) y
/home/programmer/.codeblocks-20.03/src/sdk/.libs/libcodeblocks.so: No such file or directory.
(gdb) add-symbol-file /home/programmer/codebl/codeblocks-20.03/src/sdk/.libs/libcodeblocks.so
add symbol table from file "/home/programmer/codebl/codeblocks-20.03/src/sdk/.libs/libcodeblocks.so"
(y or n) y
Reading symbols from /home/programmer/codebl/codeblocks-20.03/src/sdk/.libs/libcodeblocks.so...
(No debugging symbols found in /home/programmer/codebl/codeblocks-20.03/src/sdk/.libs/libcodeblocks.so)
(gdb)
So by verbose output maybe some process was started and probably unexpectedly terminated and function cbThreadPool::cbWorkerThread::Entry()
in source file cbthreadpool.cpp #182 waits for it (or for something other)... I am not sure.
What should I try ?
I rebuild codeblocks and tried again. It freezes again in the same place like I posted above.
codeblocks starting output:
Added compiler "GNU GCC Compiler"
[New process 20719]
[LWP 27145 of process 20719 exited]
and When I tried display processes:
...
programmer 1728 0.0 0.0 20628 2200 pts/0 Is 9:01AM 0:00.30 | | |-- sh
root 20002 0.0 0.0 20584 2120 pts/0 I 6:32PM 0:00.25 | | | `-- sh
root 915 39.6 1.6 274616 200900 pts/0 Sl 6:33PM 0:13.80 | | | `-- gdb codeblocks
root 20719 6.8 0.7 519668 93064 pts/0 SXl+ 6:33PM 0:04.66 | | | `-- /usr/local/bin/codeblocks
root 13499 0.0 0.0 0 0 pts/0 Z+ - 0:00.00 | | | `-- (gcc)
...
Can anybody explain what happens here ?
What means [LWP 27145 of process 20719 exited]
and how can help it ? Is it any problem in kernel ?
Why is (gcc) under codeblocks process like it's child ?
I found that src/src/prefix.cpp uses conditional compilation by #define BR_PTHREADS
I tried to set it to 0, it does not help.
When codeblocks enters into freeze state described above and after it I reboot then it starts automatically after login and (of course) freezes again.
Does anybody know what is this feature for ?
Moreover I am not able to find where is command for it's automatic starting.
...
root 0 0.0 0.7 0 89180 ? DKl 4:56PM 0:04.69 [system]
root 1 0.0 0.0 19972 1700 ? Is 4:56PM 0:00.01 - init
programmer 1073 1.5 0.7 526472 89016 ttyE0 Il 3:58PM 0:04.43 |-- codeblocks
programmer 1357 0.0 0.0 0 0 ttyE0 Z - 0:00.00 | `-- (gcc)
root 335 0.0 0.0 23200 1680 ? Ss 3:56PM 0:00.01 |-- /usr/sbin/rpcbind -l
dbus 802 0.0 0.0 30000 2468 ? Is 3:56PM 0:00.04 |-- /usr/pkg/bin/dbus-daemon --system --fork
...
more diagnostic info:
I rebuild libcompiler.so with debug info and investigated another thread's stacks , not only thread displayed
by "where" command.
It is weird, that two threads try to load the same MINGW compiler and two has the same stack, why OnInit() is called in two separate threads ?
(gdb) info threads
Id Target Id Frame
* 1 LWP 2893 of process 2893 "" 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
2 LWP 3308 of process 2893 "[pango] fontcon" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
3 LWP 3396 of process 2893 "pool-spawner" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
4 LWP 3631 of process 2893 "gmain" 0x0000739919c4745a in poll () from /usr/lib/libc.so.12
6 LWP 3307 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
7 LWP 1622 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
8 LWP 5002 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
9 LWP 4998 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
10 LWP 2893 of process 2893 "" 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
11 process 2893 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
(gdb) bt
#0 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
#1 0x000073991ae086f0 in __select50 (nfds=<optimized out>, readfds=<optimized out>, writefds=<optimized out>, exceptfds=<optimized out>,
timeout=<optimized out>) at /usr/src/lib/libpthread/pthread_cancelstub.c:605
#2 0x000073991b38810f in wxSelectDispatcher::DoSelect(wxSelectSets&, int) const () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#3 0x000073991b3888f1 in wxSelectDispatcher::Dispatch(int) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#4 0x000073991b3afaf8 in wxExecute(char**, int, wxProcess*, wxExecuteEnv const*) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#5 0x000073991b3b1727 in wxExecute(wxString const&, int, wxProcess*, wxExecuteEnv const*) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#6 0x000073991b3c42e0 in ?? () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#7 0x000073991ebbd252 in Compiler::EvalXMLCondition(wxXmlNode const*) () from /usr/local/lib/libcodeblocks.so.0
#8 0x000073991ebc27ef in Compiler::LoadDefaultOptions(wxString const&, int) () from /usr/local/lib/libcodeblocks.so.0
#9 0x000073991ebc47cc in Compiler::LoadDefaultOptions(wxString const&, int) () from /usr/local/lib/libcodeblocks.so.0
#10 0x000073991ebc55e3 in Compiler::Reset() () from /usr/local/lib/libcodeblocks.so.0
#11 0x0000739902aa6241 in CompilerMINGW::CompilerMINGW (this=0x739918077c00, name=..., ID=...) at compilerMINGW.cpp:35
#12 0x0000739902a88f2f in CompilerGCC::DoRegisterCompilers (this=0x73991a460000) at compilergcc.cpp:887
#13 0x0000739902a844cf in CompilerGCC::OnAttach (this=0x73991a460000) at compilergcc.cpp:355
#14 0x000073991eb98bbd in cbPlugin::Attach() () from /usr/local/lib/libcodeblocks.so.0
#15 0x000073991ec97c6f in PluginManager::AttachPlugin(cbPlugin*, bool) () from /usr/local/lib/libcodeblocks.so.0
#16 0x000073991ec9b976 in PluginManager::LoadAllPlugins() () from /usr/local/lib/libcodeblocks.so.0
#17 0x00000000004ecebe in MainFrame::ScanForPlugins() ()
#18 0x00000000004f012e in MainFrame::MainFrame(wxWindow*) ()
#19 0x0000000000464861 in CodeBlocksApp::InitFrame() ()
#20 0x000000000046a89a in CodeBlocksApp::OnInit() ()
#21 0x000073991b303e95 in wxEntry(int&, wchar_t**) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#22 0x000000000055f764 in main ()
(gdb) thr 10
[Switching to thread 10 (LWP 2893 of process 2893)]
#0 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
(gdb) info threads
Id Target Id Frame
1 LWP 2893 of process 2893 "" 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
2 LWP 3308 of process 2893 "[pango] fontcon" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
3 LWP 3396 of process 2893 "pool-spawner" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
4 LWP 3631 of process 2893 "gmain" 0x0000739919c4745a in poll () from /usr/lib/libc.so.12
6 LWP 3307 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
7 LWP 1622 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
8 LWP 5002 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
9 LWP 4998 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
* 10 LWP 2893 of process 2893 "" 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
11 process 2893 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
(gdb) bt
#0 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
#1 0x000073991ae086f0 in __select50 (nfds=<optimized out>, readfds=<optimized out>, writefds=<optimized out>, exceptfds=<optimized out>,
timeout=<optimized out>) at /usr/src/lib/libpthread/pthread_cancelstub.c:605
#2 0x000073991b38810f in wxSelectDispatcher::DoSelect(wxSelectSets&, int) const () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#3 0x000073991b3888f1 in wxSelectDispatcher::Dispatch(int) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#4 0x000073991b3afaf8 in wxExecute(char**, int, wxProcess*, wxExecuteEnv const*) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#5 0x000073991b3b1727 in wxExecute(wxString const&, int, wxProcess*, wxExecuteEnv const*) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#6 0x000073991b3c42e0 in ?? () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#7 0x000073991ebbd252 in Compiler::EvalXMLCondition(wxXmlNode const*) () from /usr/local/lib/libcodeblocks.so.0
#8 0x000073991ebc27ef in Compiler::LoadDefaultOptions(wxString const&, int) () from /usr/local/lib/libcodeblocks.so.0
#9 0x000073991ebc47cc in Compiler::LoadDefaultOptions(wxString const&, int) () from /usr/local/lib/libcodeblocks.so.0
#10 0x000073991ebc55e3 in Compiler::Reset() () from /usr/local/lib/libcodeblocks.so.0
#11 0x0000739902aa6241 in CompilerMINGW::CompilerMINGW (this=0x739918077c00, name=..., ID=...) at compilerMINGW.cpp:35
#12 0x0000739902a88f2f in CompilerGCC::DoRegisterCompilers (this=0x73991a460000) at compilergcc.cpp:887
#13 0x0000739902a844cf in CompilerGCC::OnAttach (this=0x73991a460000) at compilergcc.cpp:355
#14 0x000073991eb98bbd in cbPlugin::Attach() () from /usr/local/lib/libcodeblocks.so.0
#15 0x000073991ec97c6f in PluginManager::AttachPlugin(cbPlugin*, bool) () from /usr/local/lib/libcodeblocks.so.0
#16 0x000073991ec9b976 in PluginManager::LoadAllPlugins() () from /usr/local/lib/libcodeblocks.so.0
#17 0x00000000004ecebe in MainFrame::ScanForPlugins() ()
#18 0x00000000004f012e in MainFrame::MainFrame(wxWindow*) ()
#19 0x0000000000464861 in CodeBlocksApp::InitFrame() ()
#20 0x000000000046a89a in CodeBlocksApp::OnInit() ()
#21 0x000073991b303e95 in wxEntry(int&, wchar_t**) () from /usr/pkg/lib/libwx_baseu-3.0.so.0
#22 0x000000000055f764 in main ()
(gdb) info threads
Id Target Id Frame
1 LWP 2893 of process 2893 "" 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
2 LWP 3308 of process 2893 "[pango] fontcon" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
3 LWP 3396 of process 2893 "pool-spawner" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
4 LWP 3631 of process 2893 "gmain" 0x0000739919c4745a in poll () from /usr/lib/libc.so.12
6 LWP 3307 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
7 LWP 1622 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
8 LWP 5002 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
9 LWP 4998 of process 2893 "" 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
* 10 LWP 2893 of process 2893 "" 0x0000739919c4729a in _sys___select50 () from /usr/lib/libc.so.12
11 process 2893 0x0000739919ca8e7a in ___lwp_park60 () from /usr/lib/libc.so.12
(gdb) thr 11
Thread ID 11 has terminated.
(gdb)
I debugged compiler.cpp , function member Compiler::EvalXMLCondition()
to see what is passed to wxExecute().
See attached screens from debugger.
First it sets flag by wx version. wx-config outputs that I have installed 3.0.5.
in compiler.cpp code is comment:
#if wxCHECK_VERSION(3, 0, 0)
// Stop event-loop while wxExecute runs, to avoid a deadlock on startup,
// that occurs from time to time on wx3
flags |= wxEXEC_NOEVENTS;
#else
flags |= wxEXEC_NODISABLE;
#endif
wxLogNull logNo; // do not warn if execution fails
ret = wxExecute(GetStringFromArray(cmd, wxT(" "), false), cmd, flags);
I am attaching two screens from debugging and my code is going through first condition. Even It freezes when called wxExecute().
I tried also to comment first condition to force WxEXEC_NODISABLE. Then several threads enters into wait state, but codeblocks also freezes.
Se attached screens.
Any ideas ?
Yes, it is functional when I do it manually in console
/home/programmer/wxWidgets-3.2.5$ gcc -dumpversion
10.5.0
/home/programmer/wxWidgets-3.2.5$ gcc -dumpfullversion
10.5.0