User forums > Nightly builds

The 07 January 2012 build (7678) is out.

<< < (11/17) > >>

ollydbg:

--- Quote from: ollydbg on January 28, 2012, 05:52:01 am ---I do no even to open a "hello world" project, I just start c::b, and close c::b, then I will receive these two errors when c::b exits.

--- End quote ---
It looks like the thread: ClassBrowserBuilderThread cause this issue.

I just add the test code:


--- Code: ---void ClassBrowser::BuildTree()
{
    if (Manager::IsAppShuttingDown() || !m_Parser)
        return;

    // tree shall only be  created in case of a new builder thread
    bool create_tree = false;

    // create the thread if needed
    if (!m_BuilderThread)
    {
        return; //***************
        m_BuilderThread = new ClassBrowserBuilderThread(m_Semaphore, &m_BuilderThread);
        m_BuilderThread->Create();
        m_BuilderThread->Run();
        create_tree = true; // new builder thread - need to create new tree
    }
...

--- End code ---

You see, I forbid to create an ClassBrowserBuilderThread instance, then I have no error report on c::b exit.

Looks like writing GUI related code in a worker thread cause this issue.

oBFusCATed:

--- Quote from: ollydbg on January 28, 2012, 07:16:10 am ---Looks like writing GUI related code in a worker thread cause this issue.

--- End quote ---
Not only this one, but some random crashes, too.

ollydbg:
I just debug further, I change the BuildTree function like below:

--- Code: ---void ClassBrowserBuilderThread::BuildTree()
{
    return;
   ...
}

--- End code ---

Thus, no UI related operation here, but c::b still report 2 errors. That's too strange. It looks like this thread can't safely be destroyed.

ollydbg:
Ok, I find the reason, we only need Wait(). (We don't need Delete()), otherwise, we try to delete the thread twice.


--- Code: ---// class destructor
ClassBrowser::~ClassBrowser()
{
    int pos = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetSashPosition();
    Manager::Get()->GetConfigManager(_T("code_completion"))->Write(_T("/splitter_pos"), pos);

    SetParser(NULL);

    if (m_BuilderThread)
    {
        m_Semaphore.Post();
        //m_BuilderThread->Delete();
        m_BuilderThread->Wait();
        delete m_BuilderThread;
        m_BuilderThread=0;
    }
}
--- End code ---

It works OK.

MortenMacFly:

--- Quote from: ollydbg on January 28, 2012, 11:19:14 am ---
--- Code: ---        //m_BuilderThread->Delete();
        m_BuilderThread->Wait();

--- End code ---

--- End quote ---
Good catch! This would explain the error indeed and also, why I couldn't catch it - I was looking into the parser stuff, not the classbrowser. I'll try and give feedback (also for the wx2.9.x/64bit builds...).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version