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

Build C::B against wx3.02 with gcc 5.2 under Windows

<< < (7/25) > >>

ollydbg:

--- Quote from: stahta01 on September 28, 2015, 10:08:42 pm ---New warning that looks like a real problem to me.

MSys2 32 bit MinGW GCC 5.2 compiler.

Tim S.


--- Code: ---src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsfontpickerctrl.cpp|70|warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]|

--- End code ---
Line 70 to 72 below

--- Code: ---            if(!sFnt.Len() > 0){
                sFntName = wxT("wxNullFont");
            }

--- End code ---

--- End quote ---
Good catch, so it should be "if(sFnt.Len() == 0)", right?

stahta01:

--- Quote from: ollydbg on September 29, 2015, 12:23:39 am ---
--- Quote from: stahta01 on September 28, 2015, 10:08:42 pm ---New warning that looks like a real problem to me.

MSys2 32 bit MinGW GCC 5.2 compiler.

Tim S.


--- Code: ---src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsfontpickerctrl.cpp|70|warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]|

--- End code ---
Line 70 to 72 below

--- Code: ---            if(!sFnt.Len() > 0){
                sFntName = wxT("wxNullFont");
            }

--- End code ---

--- End quote ---
Good catch, so it should be "if(sFnt.Len() == 0)", right?

--- End quote ---

I had no idea; just thought the way it was looked very wrong.

Tim S.

ollydbg:
First, I guess my Windows XP is broken, but I copy tim's built(which he build from win7) to another Windows XP computer, and I see the same crash there.

I build a wx3.0.2 release library which has debug information(has -g compiler option added)
Which shows some more detailed stack back trace, but still no idea where the crash come from:
 
Details are in a question I asked wx-user forum: help: wired crash issue which only happens in Windows XP system with release build of wx 3.0.2.

While, the wx3.0.2 debug library works quite well(no crash here).

It looks like the bug are inside the Destroy() function of the whole GUI, which handling the AUI window. I have some test, if I put only two plugin dlls along with C::B, and in their OnAttach() function, I remove the code snippet:

--- Code: ---    CodeBlocksDockEvent evt(cbEVT_ADD_DOCK_WINDOW);
    ....
    Manager::Get()->ProcessEvent(evt);

--- End code ---
Then, I don't see the crash.

Second issue is that OnRelease code, I see some code just do this:

--- Code: ---        // remove tree from docking system
        CodeBlocksDockEvent evt(cbEVT_REMOVE_DOCK_WINDOW);
        evt.pWindow = m_pTree;
        Manager::Get()->ProcessEvent(evt);

        // finally destroy the tree
        m_pTree->Destroy();
        m_pTree = nullptr;

--- End code ---
But this is not correct, because if the function parameter "appShutDown" is true, the "Manager::Get()->ProcessEvent(evt)" just dose nothing.

Third issue is how to remove the images created before the wxTree?
When in OnAttach(), we have:

--- Code: ---    m_pTree = new wxTreeCtrl();
    ...
    m_pImages = new wxImageList(16, 16);
    ....
    m_pTree->SetImageList(m_pImages);

--- End code ---

But if the destroy of the wxTreeCtrl is done inside the Aui window system(as I said in second issue), what is the time to delete the m_pImages?

ollydbg:

--- Quote from: scarphin on September 28, 2015, 04:43:30 pm ---
--- Quote from: ollydbg on September 28, 2015, 03:47:15 pm ---EDIT:
When using the BUILD=debug option to build wxWidgets 3.0.2, it actually use the "-O0" option for the G++ compiler, while BUILD=release uses the "-O2" option instead, thus I believe the "-O2" cause the crash issue.

--- End quote ---
I use '-o3' for my x32 and x64 builds all the time and I don't have such a crash issue. My version for mingw-builds is 4.9.2 though. I used your method to overcome the pch issue to be able to compile 64-bit cb. Maybe you should try '-o3'.

--- End quote ---
Currently, I would still suggest using -O0 option to build both wxWidgets 3.0.2 and C::B trunk, at least it don't crash on my windows XP.
Do you have a 32 bit C::B (include the wx 3.0.2 library)which you build with '-o3' option? If you don't have a Windows XP system, You can upload some where, and PM the link, I'd like to test it, thanks.

ollydbg:
One thing I noticed when we build the "codeblocks.exe" (the target we named "src"), I see the "BUILDING_PLUGIN" is defined, this is much similar like building other plugin dlls. This enables the __declspec(dllexport) option.

Remove this "BUILDING_PLUGIN" is OK for the src target, but which cause the PCH file used for codeblocks.exe and other plugin dlls can't be shared. So, that's the reason we keep it there. :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version