News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Fatal Crash while removing tools

Started by Biplab, May 21, 2007, 08:52:02 PM

Previous topic - Next topic

Biplab

A fatal crash can be observed while removing tools from Tools menu. To reproduce the crash do the following,


  • Add a tool using Tools>Configure menu option and click OK. Now the added tool will be available under Tools menu.
  • Delete the newly added tool using Tools>Configure menu option and click OK. Now C::B will crash.

The crash is not observed if:

  • A separator is added & removed.
  • If tool list is not empty.

The backtrace is as follows:
Quote(gdb) run
Starting program: F:\cbsource\src\devel/codeblocks.exe
---Type <return> to continue, or q <return> to quit---

Program received signal SIGSEGV, Segmentation fault.
0x61a1a0aa in wxListBase::GetCount (this=0xfeeeff22)
    at C:/wxWidgets-2.8.4/include/wx/list.h:517
517         size_t GetCount() const { return m_count; }
(gdb) bt full
#0  0x61a1a0aa in wxListBase::GetCount (this=0xfeeeff22)
    at C:/wxWidgets-2.8.4/include/wx/list.h:517
No locals.
#1  0x61a1a0f0 in wxMenuBase::GetMenuItemCount (this=0xfeeefeee)
    at C:/wxWidgets-2.8.3/include/wx/menu.h:218
No locals.
#2  0x61884319 in MenuItemsManager::Clear (this=0x22ac818)
    at F:/cbsource/src/sdk/menuitemsmanager.cpp:92
        ni = (struct wxMenuItem *) 0x22ac8d0
        menu = (struct wxMenu *) 0xfeeefeee
        subMenu = (struct wxMenu *) 0xfeeefeee
        i = 0
#3  0x619271ef in ToolsManager::BuildToolsMenu (this=0x22ac7d0, menu=0x229ead8)
    at F:/cbsource/src/sdk/toolsmanager.cpp:318
        node = (wxToolsListNode *) 0x23f46c
#4  0x619279fd in ToolsManager::Configure (this=0x22ac7d0)
    at F:/cbsource/src/sdk/toolsmanager.cpp:358
        dlg = {<> = {<No data fields>}, static sm_eventTableEntries = {
    {<wxEventTableEntryBase> = {m_id = 127, m_lastId = -1, m_fn = {__pfn = (
    void ( struct wxObject::*)(struct wxEvent &,)) 204487774, __delta = 0},
        m_callbackUserData = 0x0}, m_eventType = @0x6d2f55e8},
    {<wxEventTableEntryBase> = {m_id = 128, m_lastId = -1, m_fn = {__pfn = (
    void ( struct wxObject::*)(struct wxEvent &,)) 204487802, __delta = 0},
        m_callbackUserData = 0x0}, m_eventType = @0x6d2f55e8},
    {<wxEventTableEntryBase> = {m_id = 637, m_lastId = -1, m_fn = {__pfn = (
    void ( struct wxObject::*)(struct wxEvent &,)) 204487819, __delta = 0},
        m_callbackUserData = 0x0}, m_eventType = @0x6d2f55e8},
    {<wxEventTableEntryBase> = {m_id = 638, m_lastId = -1, m_fn = {__pfn = (
    void ( struct wxObject::*)(struct wxEvent &,)) 204487881, __delta = 0},
        m_callbackUserData = 0x0}, m_eventType = @0x6d2f55e8},
    {<wxEventTableEntryBase> = {m_id = 639, m_lastId = -1, m_fn = {__pfn = (
    void ( struct wxObject::*)(struct wxEvent &,)) 204487937, __delta = 0},
        m_callbackUserData = 0x0}, m_eventType = @0x6d2f55e8},
    {<wxEventTableEntryBase> = {m_id = 640, m_lastId = -1, m_fn = {__pfn = (
    void ( struct wxObject::*)(struct wxEvent &,)) 204487986, __delta = 0},
        m_callbackUserData = 0x0}, m_eventType = @0x6d2f55e8},
    {<wxEventTableEntryBase> = {m_id = -1, m_lastId = -1, m_fn = {__pfn = (
    void ( struct wxObject::*)(struct wxEvent &,)) 204487675, __delta = 0},
        m_callbackUserData = 0x0}, m_eventType = @0x6d2f5438},
    {<wxEventTableEntryBase> = {m_id = 0, m_lastId = 0, m_fn = {__pfn = invalid
pointer to member function
(gdb)

C::B crashes at line 92 of sdk/menuitemsmanager.cpp file where subMenu->GetMenuItemCount() has been called.

If anyone has a fix please post or apply it in SVN.

Thanks & Regards,

Biplab

Edit 1: Filed a bug-report ([Bug #11141] Fatal Crash while removing tools)
Be a part of the solution, not a part of the problem.

Biplab

Thanks Yiannis, for the fix. :D

Regards,

Biplab
Be a part of the solution, not a part of the problem.