Page MenuHomePhabricator

Crash on closing Application
Closed, InvalidPublic

Description

The mitk GUI Application crashes in following case:

  • Open GUI
  • Move a plugin-window (e.g. segmentation) otside of the main window e.g. on a second screen
  • Close GUI
  • Reopen GUI
  • Close GUI again -> Crash

Event Timeline

To cause this crash it suffices to open a floating window no matter on which screen and close/open/close the main applictaion. After attaching the window to the main window the crash will occur *one* more time when closing the main application.

The crash arises in

QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority).

The receiver is a valid QObject but it seems its subclass was already destroyed because the virtual function table pointer (__vftbl on VS 9.0) is invalid (0xFEEEFEEE on VS 9.0).

Next step would be to determine which object or type the receiver is/was actually.

Call stack:

berry::QtShell::~QtShell()
-> QObject::deleteLater()
---> QCoreApplication::postEvent()

Okay, the problem is the destructor of berry::QtShell which calls the QObject::deleteLater() method of its widget, which in turn leads to a recursive call of the destructor. The result is a partly destroyed object (virtual function table pointer is invalid) that causes the actual crash.

We scheduled the graceful fixing of the bug for next Wednesday. A temporary (!) fix could be to change the body of the destructor as follows:

// status quo
QtShell::~QtShell()
{

widget->deleteLater();

}

// dirty fix
QtShell::~QtShell()
{

static bool alreadyCalled = false;

if (!alreadyCalled)
{
  alreadyCalled = true;
  widget->deleteLater();
}

}

TODO: Check if deleteLater() is really necessary.

Merging "applicazion modules" component with "ExtApp plugins"

MITK-1-0 keyword is obsolete, we use Target Milestones in the future.

This bug was discovered during testing of 2012-06, updating version. Target milestone is unspecified until general bug review, but feel free to fix it before.

This bug was discovered during testing of 2012-06, updating version. Target milestone is unspecified until general bug review, but feel free to fix it before.

Can't be reproduced with MITK-2012.06.99_r5d2306

kislinsk changed the task status from Invalid to Spite.Jun 27 2018, 1:33 PM
kislinsk added a project: Bulk Edit.
kislinsk changed the task status from Spite to Invalid.Jun 27 2018, 1:37 PM
kislinsk removed a project: Bulk Edit.