When I try to open a project (I want to open codeblock-unix.cbp) codeblocks crashes. when looking with the debugger (although I don't have no idea how it works :roll: ) I see a lots of new threads, and then the following message:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 3290)]
0x4023dea7 in wxGenericTreeCtrl::Collapse ()
from /usr/local/lib/libwx_gtk2-2.4.so
I want to solve this (probably little) bug, but I don't know how to start. please give some hints...
ps.
I use the cvs version, and want to open the same version of codeblocks. as you can see I use wx-2.4.2 (with patch :P) I am using VectorLinux SOHO 5.
I hope I have the right trace (in gdb after the crash I called backtrace, right?)
#0 0x4023dea7 in wxGenericTreeCtrl::Collapse () from /usr/local/lib/libwx_gtk2-2.4.so
#1 0x40593e20 in ?? ()
#2 0x082e19d8 in ?? ()
#3 0xbfffe268 in ?? ()
#4 0x082f9e58 in ?? ()
#5 0x404b0054 in ?? () from /usr/local/lib/libwx_gtk2-2.4.so
#6 0x404cf248 in vtable for wxObject () from /usr/local/lib/libwx_gtk2-2.4.so
#7 0x404b0054 in ?? () from /usr/local/lib/libwx_gtk2-2.4.so
#8 0xbfffe288 in ?? ()
#9 0x41246cf0 in ClassBrowser::Update () from /home/mispunt/bin/codeblocks/share/CodeBlocks/plugins/libcodecompletion.so
#10 0x41246cf0 in ClassBrowser::Update () from /home/mispunt/bin/codeblocks/share/CodeBlocks/plugins/libcodecompletion.so
#11 0x41246c48 in ClassBrowser::SetParser () from /home/mispunt/bin/codeblocks/share/CodeBlocks/plugins/libcodecompletion.so
#12 0x4124cd7c in NativeParser::SetClassBrowserProject () from /home/mispunt/bin/codeblocks/share/CodeBlocks/plugins/libcodecompletion.so
#13 0x4124a53d in CodeCompletion::OnProjectActivated () from /home/mispunt/bin/codeblocks/share/CodeBlocks/plugins/libcodecompletion.so
#14 0x402e2dc6 in wxEvtHandler::SearchEventTable () from /usr/local/lib/libwx_gtk2-2.4.so
#15 0x402e2bcc in wxEvtHandler::ProcessEvent () from /usr/local/lib/libwx_gtk2-2.4.so
#16 0x402e2c04 in wxEvtHandler::ProcessEvent () from /usr/local/lib/libwx_gtk2-2.4.so
#17 0x402e2c04 in wxEvtHandler::ProcessEvent () from /usr/local/lib/libwx_gtk2-2.4.so
#18 0x402e2c04 in wxEvtHandler::ProcessEvent () from /usr/local/lib/libwx_gtk2-2.4.so
#19 0x402e2c04 in wxEvtHandler::ProcessEvent () from /usr/local/lib/libwx_gtk2-2.4.so
#20 0x402e2c04 in wxEvtHandler::ProcessEvent () from /usr/local/lib/libwx_gtk2-2.4.so
#21 0x405a7932 in ?? ()
#22 0x082d1518 in ?? ()
#23 0xbfffe4b0 in ?? ()
#24 0x00000000 in ?? ()
#25 0x405631ed in ?? ()
#26 0xbfffe500 in ?? ()
#27 0x00000010 in ?? ()
#28 0xbfffe488 in ?? ()
#29 0x082d1518 in ?? ()
#30 0x00000007 in ?? ()
#31 0x01225290 in ?? ()
#32 0xbfffe518 in ?? ()
#33 0x405b31a5 in ?? ()
#34 0x08225290 in ?? ()
#35 0xbfffe4b0 in ?? ()
#36 0x00000001 in ?? ()
#37 0x402d8080 in wxBaseArrayPtrVoid::Grow () from /usr/local/lib/libwx_gtk2-2.4.so
Previous frame inner to this frame (corrupt stack?)
OK here's more info.
void ClassBrowser::Update()
{
if (m_pParser)
{
wxArrayString treeState;
::SaveTreeState(m_Tree, m_pParser->GetRootNode(), treeState);
m_pParser->BuildTree(*m_Tree);
::RestoreTreeState(m_Tree, m_pParser->GetRootNode(), treeState);
}
else
m_Tree->DeleteAllItems();
}
Try adding debugging "breakpoints" in each relevant line, like wxmessageboxes combined with printf's to print the values of pointers.
Also, I have a hunch. Might help, might not.
ClassBrowser::ClassBrowser(wxNotebook* parent, NativeParser* np)
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxCLIP_CHILDREN),
m_Parent(parent),
m_NativeParser(np),
m_pParser(0L)
Try adding a m_Tree(0L) before m_pParser(0L). I've had problems with uninitialized members before, even if they're initialized inside the constructor. I won't guarantee this will work, but it might help. Who knows.