Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

About the Class browser crash....

(1/5) > >>

rickg22:

--- Quote ---void ClassBrowserBuilderThread::BuildTree()
{
...
    RemoveInvalidNodes(m_pTreeBottom, m_pTreeBottom->GetRootItem());
...
}

void ClassBrowserBuilderThread::RemoveInvalidNodes(wxTreeCtrl* tree, wxTreeItemId parent)
{
...
    CollapseItem( ... )
...
}

void ClassBrowserBuilderThread::CollapseItem(...)
{
...
    m_pTreeTop->DeleteChildren(item);
...
}

--- End quote ---

OK can anyone explain me how did m_pTreeBottom became m_pTreeTop in there?  :P

Biplab:
Does changing this code prevents the crash? :)

rickg22:
No :(
But  I didn't add a mutex. I'll try with the mutex and come back with an answer.

Edit: With the mutex, it crashes much less often :P but it still crashes.

rickg22:
After more than 5 hours examining and testing the code, I'm noticing many problems with the classbrowserbuilderthread...

1) wxMutexGuiEnter and wxMutexGuiLeave aren't used at all for windows platforms. And they should be used for atomic operations, not to build the whole tree. Of course, if we're accessing every single item for this, it could get really slow.

2) There isn't any signal to make the running thread stop.

3) It appears that on Windows, the tree construction is done (at least once) on the main thread?? How to debug that and keep cross-platform compatibility???

Fixing this bug could take several weeks... why not resort to using wxTimer events and use atomic operations for the tree construction? We could make sure that the classbrowserbuilderthread module would be the only one with write access to the tree... and since only one instance of the "thread" would be running at the same time, there would be no risks of lockups or crashes.

Otherwise I have no idea of how to fix this bug... IMHO using threads to build a GUI component is a very bad idea.

mandrav:
...

Rick, I keep seeing you mentioning crashes/bugs/whatnot in symbols browser but I haven't had one of those for the last few months. So I was wondering, instead of trying to fix something that is possibly NOT there, could you just write down a procedure for me to recreate whatever issues you 're seeing?
(same goes for code-completion and other "sensitive" parts of the code: noone's been complaining about them for quite a while now)

Navigation

[0] Message Index

[#] Next page

Go to full version