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

Threadsearch plugin cause crash when initilized (wx3.1,C::B svn head)

<< < (3/6) > >>

oBFusCATed:
If an valid optimisation breaks users code then the code is broken and must be fixed.
Disabling specific optimisations is only a short term workaround!

stahta01:

--- Quote from: oBFusCATed on October 14, 2017, 08:01:57 pm ---If an valid optimisation breaks users code then the code is broken and must be fixed.
Disabling specific optimisations is only a short term workaround!

--- End quote ---

Re-writing wxWidgets to use C++ correctly is a very big job; it will likely take a while! As in years.
Adding the option to see if it works is much faster.

Do you wish to port CB to no longer use the wxWidgets backend?
Or, switch to using wxWidgets for STL build? (No idea if this will fix the issue; but, it has a slight chance)
Edit1: I forgot this bug is wxWidgets RTTI not wxWidgets STL class bug.
Or, try disabling what ever compiler/linker option is causing this bug?
The only other option is finding another solution or ignoring the bug.

Tim S.

ollydbg:

--- Quote from: BlueHazzard on October 14, 2017, 05:44:30 pm ---So if you apply this optimization patch the crash goes away? So this should be reported to gcc?

--- End quote ---
yes and yes, I have already report to gcc bugzilla. see the links of my previous post.

edit: it is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71867

ollydbg:

--- Quote from: stahta01 on October 14, 2017, 07:50:12 pm ---I would try "-fno-delete-null-pointer-checks" in building wxWidgets and see if the second problem goes away.


--- End quote ---

I already try this years ago, but the crash still exists.
see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71867

blauzahn:

To me, that looks like undefined behaviour:


--- Code: ---void ThreadSearch::SetManagerType(ThreadSearchViewManagerBase::eManagerTypes mgrType)
{
    // Is type different from current one ?
    if ( mgrType != m_pViewManager->GetManagerType() )
    {
        // Get show state and destroy current view manager.
        bool show(true);
        if ( m_pViewManager != NULL )          // <---------------- UB
        {
            show = m_pViewManager->IsViewShown();
            m_pViewManager->RemoveViewFromManager();
            delete m_pViewManager;
        }

        // Create and show new view manager.
        m_pViewManager = ThreadSearchViewManagerBase::BuildThreadSearchViewManagerBase(m_pThreadSearchView, true, mgrType);
        m_pViewManager->ShowView(show);
    }
}

--- End code ---

A null-pointer check AFTER having dereferenced m_pViewManager.
If memory serves me, this in combination with "-fno-delete-null-pointer-checks"
led to bugs like heartbleed.

obfuscated:

--- Quote ---If an valid optimisation breaks users code then the code is broken and must be fixed.
Disabling specific optimisations is only a short term workaround!

--- End quote ---
I agree with that.

Cheers!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version