Kirix Support Forums

AUI: Core dump when loading a perspective in wxGTK (MSW OK)

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

AUI: Core dump when loading a perspective in wxGTK (MSW OK)

Postby mdefreitas on Wed Jun 18, 2008 1:53 pm

I am using wxGTK-2.8.4 on an SGI IRIX 6.5 machine with the MIPS 7.4 compiler

My application sometimes core dumps when I load a perspective. The application seems to be OK under Windows.

My test application docks a pane on the left and has a button in the center. When the application comes up, it saves the perspective in a wxString. The callback of the button in the center pane merely loads the perspective that was saved at startup.

When I undock the left pane and press the button, the pane redocks as expected (most of the time). However, sometimes I get a core dump.

The panel on the left is fairly complex (it has a toolbar, a list control, etc). If I just use a simple text control for the left panel, I can't seem to get a core dump. Perhaps this is related to the complexity of the docked/undocked panel? But again, it works ok under Windows.

Looks like I die on line 456 of src/common/sizer.cpp. This is what the call stack looks like when I core dump:

___________________

> 0 wxSizerItem::IsShown(void) const(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/sizer.cpp":456, 0x10187d24]
1 wxAuiManager::OnRender(wxAuiManagerEvent&)(0x10660e00, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/aui/framemanager.cpp":3568, 0x10115154]
2 wxAppConsole::HandleEvent(wxEvtHandler*,void (wxEvtHandler::*)(wxEvent&),wxEvent&) const(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/appbase.cpp":320, 0x103629c8]
3 wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase&,wxEvtHandler*,wxEvent&)(0x10664a50, 0x0, 0x7fff1f58, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/event.cpp":1204, 0x1032d108]
4 wxEventHashTable::HandleEvent(wxEvent&,wxEvtHandler*)(0x0, 0x7fff1f58, 0x10660e00, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/event.cpp":877, 0x1032bfb0]
5 wxEvtHandler::ProcessEvent(wxEvent&)(0x10660e00, 0x7fff1f58, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/event.cpp":1266, 0x1032ca50]
6 wxAuiManager::ProcessMgrEvent(wxAuiManagerEvent&)(0x10660e00, 0x7fff1f58, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/aui/framemanager.cpp":815, 0x10114acc]
7 wxAuiManager::Render(wxDC*)(0x10664a50, 0x7fff2000, 0xffffffff, 0x7fff1f58, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/aui/framemanager.cpp":3609, 0x101148f8]
8 wxAuiManager::Repaint(wxDC*)(0x10660e00, 0x7fff2000, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/aui/framemanager.cpp":3642, 0x101149d4]
9 wxAuiManager::OnPaint(wxPaintEvent&)(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/aui/framemanager.cpp":3652, 0x101155e8]
10 wxAppConsole::HandleEvent(wxEvtHandler*,void (wxEvtHandler::*)(wxEvent&),wxEvent&) const(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/appbase.cpp":320, 0x103629c8]
11 wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase&,wxEvtHandler*,wxEvent&)(0x10664a50, 0x0, 0x7fff23f8, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/event.cpp":1204, 0x1032d108]
12 wxEventHashTable::HandleEvent(wxEvent&,wxEvtHandler*)(0x0, 0x7fff23f8, 0x10660e00, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/event.cpp":877, 0x1032bfb0]
13 wxEvtHandler::ProcessEvent(wxEvent&)(0x10660e00, 0x7fff23f8, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/event.cpp":1266, 0x1032ca50]
14 wxWindow::GtkSendPaintEvents(void)(0x10660bc0, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/gtk/window.cpp":3762, 0x1013592c]
15 ::gtk_window_expose_callback(_GtkWidget*,_GdkEventExpose*,wxWindow*)(0x10664a50, 0x10660bc0, 0x10660bc0, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/gtk/window.cpp":514, 0x1012cbf8]
16 _gtk_marshal_BOOLEAN__BOXED(0x7fff2540, 0x0, 0xffffffff, 0x7fff2640, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gtk/gtkmarshalers.c":82, 0x5fe20b9c]
17 g_closure_invoke(0x1065ad98, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/gobject/gclosure.c":437, 0x6499e68]
18 signal_emit_unlocked_R(0x105d5fa8, 0x0, 0x105e2c6c, 0x7fff2800, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/gobject/gsignal.c":2436, 0x64b0724]
19 g_signal_emit_valist(0x10664a50, 0x69, 0x6c, 0x7fff2970, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/gobject/gsignal.c":2205, 0x64af578]
20 g_signal_emit(0x10664a50, 0x0, 0xffffffff, 0x7fff2a28, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/gobject/gsignal.c":2239, 0x64afa5c]
21 gtk_widget_event_internal(0x105e2c6c, 0x7fff2a28, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gtk/gtkwidget.c":3563, 0x5ff3cc60]
22 gtk_widget_send_expose(0x10664a50, 0x7fff2a28, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gtk/gtkwidget.c":3395, 0x5ff3c8f8]
23 gtk_main_do_event(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gtk/gtkmain.c":1541, 0x5fe1d99c]
24 gdk_window_process_updates_internal(0x10662608, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gdk/gdkwindow.c":2052, 0x40333f4]
25 gdk_window_process_all_updates(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gdk/gdkwindow.c":2100, 0x40334d8]
26 gtk_container_idle_sizer(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gtk/gtkcontainer.c":1116, 0x5fd91ed0]
27 g_idle_dispatch(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/glib/gmain.c":3750, 0x4f6c308]
28 g_main_dispatch(0x105b8c38, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/glib/gmain.c":1895, 0x4f683ec]
29 g_main_context_dispatch(0x105b8c38, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/glib/gmain.c":2441, 0x4f69968]
30 g_main_context_iterate(0x105b8c38, 0x1, 0x1, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/glib/gmain.c":2522, 0x4f69c30]
31 g_main_loop_run(0x1064abf8, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/glib2/2.4.0/glib-2.4.0.diffbuild/glib/gmain.c":2726, 0x4f6a4e8]
32 gtk_main(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/xlv1/freeware/2003.Nov/gtk2+/2.4.0/gtk+-2.4.0.diffbuild/gtk/gtkmain.c":1172, 0x5fe1cfe8]
33 wxEventLoop::Run(void)(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/gtk/evtloop.cpp":76, 0x102111f8]
34 wxAppBase::MainLoop(void)(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/appcmn.cpp":308, 0x101fe590]
35 wxAppBase::OnRun(void)(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/appcmn.cpp":363, 0x101fe378]
36 ::wxEntry(int&,char**)(0x10664a50, 0x0, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/cm/vobs/vob_3rd/wxwidgets/IRIX/wx_WORK.wxGTK-2.8.4/wxGTK-2.8.4/src/common/init.cpp":449, 0x103b2280]
37 ::main(0x1, 0x7fff2d24, 0xffffffff, 0x10664a50, 0xffffffff, 0x7fff1f58, 0x7fff1f58, 0x7fff1f58) ["/people/mdefreitas/wx/samples/ghui/utils/tst1/tst1.c":42, 0x100fd27c]
38 __start() ["/xlv55/kudzu-apr12/work/irix/lib/libc/libc_n32_M4/csu/crt1text.s":177, 0x100cebf8]

___________________

This is my stripped down test program, with a simple text control for the left pane. Note that this version does not core dump, but I include it to show what I am doing. The only difference between this version and the version that does core dump, is that I have a more complex panel on the left, which is spread out over several files:
_______________

Code: Select all
#include "wx/wx.h"
#include "wx/aui/aui.h"

class TstApp : public wxApp
{
public:
   virtual bool OnInit();
};


class TstFrame : public wxFrame
{
public:

   enum {
      ID_Def = wxID_HIGHEST + 1
   };

   TstFrame(const wxString& title);
   ~TstFrame();

private:
   void onExit(wxCommandEvent& event);
   void onDef(wxCommandEvent& event);

   wxAuiManager    m_mgr;
   wxString        m_def_perspective;

   DECLARE_EVENT_TABLE()
};

DECLARE_APP(TstApp)
IMPLEMENT_APP(TstApp)

bool TstApp::OnInit()
{
   TstFrame *frame = new TstFrame(_T("Tst"));
   SetTopWindow(frame);
   frame->Show(true);
   return true;
}

BEGIN_EVENT_TABLE(TstFrame, wxFrame)
   EVT_MENU(wxID_EXIT,  TstFrame::onExit)
   EVT_BUTTON(TstFrame::ID_Def, TstFrame::onDef)
END_EVENT_TABLE()

TstFrame::TstFrame(const wxString& title) : wxFrame(NULL, wxID_ANY,
title)
{
   m_mgr.SetManagedWindow(this);
   wxMenuBar *menuBar = new wxMenuBar();
   wxMenu *fileMenu = new wxMenu;
   fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt-X"));
   menuBar->Append(fileMenu, _T("&File"));
   SetMenuBar(menuBar);

   //~~~ add some panes

   wxTextCtrl *t1 = new wxTextCtrl(this, -1, _T("test"));
   m_mgr.AddPane(t1, wxAuiPaneInfo().Name(_T("t1")).Caption(_T("t1")).Left());

   wxButton *b = new wxButton(this, ID_Def, _T("DEFAULT"));
   m_mgr.AddPane(b, wxAuiPaneInfo().Name(_T("content")).CenterPane());

   m_def_perspective = m_mgr.SavePerspective();
   m_mgr.Update();
}

TstFrame::~TstFrame()
{
   m_mgr.UnInit();
}

void TstFrame::onExit(wxCommandEvent& event)
{
   Close();
}

void TstFrame::onDef(wxCommandEvent& event)
{
   m_mgr.LoadPerspective(m_def_perspective);
}

______________

Any ideas what is going on?


I can tar up my more complicated panel, if need be...
mdefreitas
Registered User
 
Posts: 12
Joined: Tue Jul 10, 2007 3:14 pm

Re: AUI: Core dump when loading a perspective in wxGTK (MSW OK)

Postby mdefreitas on Thu Jun 19, 2008 12:38 pm

More Info:

When wxAppConsole::HandleEvent is called (level "2" on the stack), I looked at the value of event->m_eventType. It has a value of 10004; not sure what that translates to.

The function wxAuiManager::OnRender is then called (level "1" on the stack). It looks like it loops through its "parts". The part_count is 2 (perhaps the center pane and the left dockable pane?). On the second iteration of the loop (the second "part"), it checks if the "part" has a sizer item (which it does) and then calls the IsShown() member function of that sizer item.

When wxSizerItem::IsShown is called (level 0 on the stack), it goes through a switch statement to figure out what "kind" it is. The Item_Window case is selected. It then calls m_window->IsShown(). But since m_window is a null pointer, we get a core dump.

Also... I tried this on a RedHat linux box (with again wxGTK-2.8.4) and it did not seem to crash (but maybe I just had to try longer?). So, it looks like MSW and Linux are OK, but IRIX is not.
mdefreitas
Registered User
 
Posts: 12
Joined: Tue Jul 10, 2007 3:14 pm

Re: AUI: Core dump when loading a perspective in wxGTK (MSW OK)

Postby mdefreitas on Fri Jun 20, 2008 4:28 pm

MORE INFO:

I finally was able to get a small test program that failed without having to use my complicated pane.

The issue appears to be that I have a panel that is derived from wxPanel and add that as a pane in AUI. For example, the test program I detailed above (that always works) had a text control added as a pane. If I embed that text control in a class that I derive from wxPanel and then add that custom class as a pane -- I have problems.

Is what I am doing wrong? Is there a better, more recommended way to add a custom pane that is a collection of various controls?

Here is the modified test program that sometimes crashes, note that the only change is that I am adding a class that I derive from wxPanel as a pane (rather than adding a wxTextCtrl as a pane):
___________________________

Code: Select all
#include "wx/wx.h"
#include "wx/aui/aui.h"

class MyPanel : public wxPanel {
   public:
      MyPanel(wxWindow *parent, wxWindowID id) : wxPanel(parent, id) {
         wxTextCtrl *t1 = new wxTextCtrl(this, -1, _T("test"));
         wxBoxSizer *panel_sizer = new wxBoxSizer(wxVERTICAL);
         panel_sizer->Add(t1, 0, wxEXPAND);
         SetSizer(panel_sizer);
         panel_sizer->Fit(this);
      }
};

class TstApp : public wxApp
{
public:
   virtual bool OnInit();
};

class TstFrame : public wxFrame
{
public:
   enum {
      ID_Def = wxID_HIGHEST + 1
   };

   TstFrame(const wxString& title);
   ~TstFrame();

private:
   void onExit(wxCommandEvent& event);
   void onDef(wxCommandEvent& event);

   wxAuiManager m_mgr;
   wxString m_def_perspective;

   DECLARE_EVENT_TABLE()
};

DECLARE_APP(TstApp)
IMPLEMENT_APP(TstApp)

bool TstApp::OnInit()
{
   TstFrame *frame = new TstFrame(_T("Tst"));
   SetTopWindow(frame);
   frame->Show(true);
   return true;
}

BEGIN_EVENT_TABLE(TstFrame, wxFrame)
   EVT_MENU(wxID_EXIT, TstFrame::onExit)
   EVT_BUTTON(TstFrame::ID_Def, TstFrame::onDef)
END_EVENT_TABLE()

TstFrame::TstFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title)
{
   m_mgr.SetManagedWindow(this);
   wxMenuBar *menuBar = new wxMenuBar();
   wxMenu *fileMenu = new wxMenu;
   fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt-X"));
   menuBar->Append(fileMenu, _T("&File"));
   SetMenuBar(menuBar);

   //~~~ add some panes

   MyPanel *p = new MyPanel(this, -1);
   m_mgr.AddPane(p, wxAuiPaneInfo().Name(_T("t1")).Caption(_T("t1")).Left());
   wxButton *b = new wxButton(this, ID_Def, _T("DEFAULT"));
   m_mgr.AddPane(b, wxAuiPaneInfo().Name(_T("content")).CenterPane());
   m_def_perspective = m_mgr.SavePerspective();
   m_mgr.Update();
}

TstFrame::~TstFrame()
{
   m_mgr.UnInit();
}

void TstFrame::onExit(wxCommandEvent& event)
{
   Close();
}

void TstFrame::onDef(wxCommandEvent& event)
{
   m_mgr.LoadPerspective(m_def_perspective);
}
mdefreitas
Registered User
 
Posts: 12
Joined: Tue Jul 10, 2007 3:14 pm

Re: AUI: Core dump when loading a perspective in wxGTK (MSW OK)

Postby mdefreitas on Thu Jul 03, 2008 4:03 pm

Hello... Ben... you out there? Any thoughts?
mdefreitas
Registered User
 
Posts: 12
Joined: Tue Jul 10, 2007 3:14 pm

Re: AUI: Core dump when loading a perspective in wxGTK (MSW OK)

Postby mdefreitas on Tue Jul 08, 2008 2:10 pm

I think I found what the problem is…

When I float the pane, the AUI code creates a new wxAuiFloatFrame which has a wxAuiManager object in it (to manage the wxAuiFloatFrame).

Events are now handled by both the main wxAuiManager and the wxAuiManager for the floating frame.

When I load a perspective that re-docks the pane, the floating pane is re-parented to the main frame and the floating frame is destroyed… HOWEVER… according to the documentation on “Destroy”, top-level frames and dialogs are not immediately destroyed. Since this frame is not immediately destroyed, the wxAuiManager for this frame is not immediately destroyed, which means that the UnInit function for that wxAuiManager is not immediately called, which means it can still handle events.

I put some print statements on the wxAuiManager::OnRender function to print the “this” pointer (to find out which instance of wxAuiManager is called). I also put a print statement at the end of the wxAuiFloatFrame destructor to tell me when UnInit is called for its wxAuiManager (which tells me when it removes its event handler).

Sure enough, when I load a perspective that re-docks a floating pane, I see that I call wxAuiManager::OnRender for the floating pane after we re-dock it (and re-parent it and call “Destroy” on it) but before the destructor for the floating frame gets called. Thus we are handling events for an object in an invalid state.

POSSIBLE FIX:

I noticed that when a floating frame gets destroyed, we call SetSizer(NULL) on it. I put the following check at the top of wxAuiManager::OnRender:

if (!GetManagedWindow()->GetSizer()) return;

Thus, I ignore any rendering for invalid floating frames. This seems to work for me.

Is this the right fix? Can I be sure that GetSizer will ONLY return null for invalid frames? Does this check need to be put in other places? Is there a better way to fix the problem?

I’m not sure why I only see the problem on IRIX, or only when my pane is derived from wxPanel, but I guess it gets down to the fact that the true destruction of a frame is unpredictable.
mdefreitas
Registered User
 
Posts: 12
Joined: Tue Jul 10, 2007 3:14 pm

Re: AUI: Core dump when loading a perspective in wxGTK (MSW OK)

Postby Ben on Wed Jul 23, 2008 2:41 pm

It seems like the likely fix. I'm going to need to reproduce the scenario myself to verify it. These floating references can get hairy at times!

Thanks for your work on this. Sorry I was out of contact.

Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Re: AUI: Core dump when loading a perspective in wxGTK (MSW

Postby Kerantino on Fri Mar 02, 2012 6:13 am

I don't think so, it looks like a real bug to me. Unfortunately I really
have no time to (a) learn AUI code and (b) fix the bug now. You probably
should report this as a bug and hope that Ben can look at it...
Kerantino
Registered User
 
Posts: 3
Joined: Fri Mar 02, 2012 4:47 am

Return to wxAUI Questions, Thoughts & Feedback