Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Nasty crash in symbol browser

<< < (3/4) > >>

rickg22:
Yiannis: I won't commit, but I'm still going to do the experiment on my own machine.

See, I think the culprit is this function...

--- Code: ---void ClassBrowserBuilderThread::RemoveInvalidNodes(wxTreeCtrl* tree, wxTreeItemId parent)
{
...
            if (m_pTokens->at(data->m_TokenIndex) != data->m_pToken ||
                data->m_TokenKind != data->m_pToken->m_TokenKind || // need to compare kinds: the token index might have been reused...
                data->m_TokenName != data->m_pToken->m_Name || // same for the token name
                !TokenMatchesFilter(data->m_pToken))
...
}

--- End code ---

There's a string comparison for every item in there, and that's the cause of the lag.
Anyway, If I do any changes, I'll post them in the form of a patch.

rickg22:
Yiannis: Guess what.

IT WORKS!!!!!!!!!!!  :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D

I didn't commit anything, instead, I submitted the fix as patch #2084.

Anyway, my theory is that while the classbrowserbuilderthread is deleting nodes, it's also triggering tons of events. The DeleteChildren method of wxTreeCtrl does not trigger any event. Please try it and tell me if it works for you. I notice a side effect, which is that it rebuilds the tree everytime you change the setting above it. But at least it doesn't crash for me :)


--- Code: ---Index: src/plugins/codecompletion/classbrowserbuilderthread.cpp
===================================================================
--- src/plugins/codecompletion/classbrowserbuilderthread.cpp (revision 4196)
+++ src/plugins/codecompletion/classbrowserbuilderthread.cpp (working copy)
@@ -185,8 +185,10 @@
     m_pTreeTop->Freeze();
     m_pTreeBottom->Freeze();
 
- RemoveInvalidNodes(m_pTreeTop, root);
- RemoveInvalidNodes(m_pTreeBottom, m_pTreeBottom->GetRootItem());

+ m_pTreeTop->DeleteChildren(m_pTreeTop->GetRootItem());
+ m_pTreeBottom->DeleteChildren(m_pTreeBottom->GetRootItem());
+ // RemoveInvalidNodes(m_pTreeTop, root);
+ // RemoveInvalidNodes(m_pTreeBottom, m_pTreeBottom->GetRootItem());
 
     if (TestDestroy() || Manager::IsAppShuttingDown())
     {

--- End code ---

Biplab:

--- Quote from: rickg22 on June 28, 2007, 09:20:25 pm ---biplab: The crash reports are *VERY* valuable! :) Just make sure you're running the debug version of C::B and, if you can... use addr2line to find the appropriate lines - if you can and have the time, of course.

--- End quote ---

I always run a debug version of C::B under GDB. It gives enough information to trace it. :)


--- Quote ---Yiannis: Guess what.

IT WORKS!!!!!!!!!!!

I didn't commit anything, instead, I submitted the fix as patch #2082.
--- End quote ---

It works in my machine. :D

mandrav:

--- Quote from: mandrav on June 28, 2007, 11:05:25 pm ---Rick, please, don't...

--- End quote ---


--- Quote from: rickg22 on June 29, 2007, 04:24:10 am ---Yiannis: Guess what.

IT WORKS!!!!!!!!!!!  :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D

I didn't commit anything, instead, I submitted the fix as patch #2084.

Anyway, my theory is that while the classbrowserbuilderthread is deleting nodes, it's also triggering tons of events. The DeleteChildren method of wxTreeCtrl does not trigger any event. Please try it and tell me if it works for you. I notice a side effect, which is that it rebuilds the tree everytime you change the setting above it. But at least it doesn't crash for me :)

--- End quote ---

Why is nobody listening to me these days?  :?

Rick, do you have *any* idea why it was implemented like that?
Do you think I would go the hard way of removing each node individually if I had *any* reason to avoid it?

Agustin:
That's great to know! This is the *only* bug I have experienced in Codeblocks. Can I download the patch? At least until the problem is properly resolved :D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version