lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Segfault in lmi with wxWidgets-2009-03-10


From: Vadim Zeitlin
Subject: Re: [lmi] Segfault in lmi with wxWidgets-2009-03-10
Date: Wed, 11 Mar 2009 17:27:43 +0100

On Wed, 11 Mar 2009 06:01:42 +0000 Greg Chicares <address@hidden> wrote:

GC> To reproduce, with luck:
GC>   start lmi
GC>   open any file of any type, and leave its window open
GC>   close lmi (forcing the open MDI child window to be closed)

 Fixed in http://trac.wxwidgets.org/changeset/59484, as you can see the fix
is trivial, sorry for failing to see the error when it was right in front
of me. But it does work for me now under Linux while I could reliably
reproduce the crash before and the cause of the crash is pretty clear too:
ViewEx::OnClose(), called as part of closing the document, deleted the
associated frame and then wxView::~wxView() tried to do it again because
the m_docChildFrame pointer wasn't reset to NULL.


 If you're curious, I can also explain why the problem wasn't reproducible
in MSVC: its debug CRT -- which is usually so useful to detect bugs due to
dangling pointers and such because, among other things, it always fills the
freed memory with 0xfeeefeee words -- hid the bug in this case: the test

    if ( m_docChildFrame && m_docChildFrame->GetView() == this )

in docview.cpp failed for it because m_docChildFrame was deleted and so its
GetView() returned 0xfeeefeee. But with g++ this word (usually) wasn't
overwritten yet so the comparison with 'this' passed and we ended up
deleting the frame for the second time with the expectedly catastrophic
results.

 Sorry once again,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]