Page MenuHomePhabricator

Application crashes when using File > Exit
Closed, ResolvedPublic

Description

After a brief investigation, the reason seems to be that the QApplication gets closed while the mouse press event is still processed.
In berryQtDisplay.cpp this method is called right before the crash:

void QtDisplay::ExitEventLoop(int code)
{
  QApplication::exit(code);
}

leading to a crash when stepping out of 3 further qt methods. Sascha, i think this is rather a severe problem connected to the logic of the workbench closing procedure. i dont know wether you changed something or not... However, just clicking the window "X" works without problems.

stack trace:

QtCored4.dll!QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> >::data() Zeile 135 + 0x3 Bytes C++

	QtCored4.dll!qGetPtrHelper<QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> > >(const QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> > & p={...})  Zeile 2315 + 0xb Bytes	C++
	QtCored4.dll!QObject::d_func()  Zeile 121 + 0x13 Bytes	C++
	QtCored4.dll!QObjectPrivate::get(QObject * o=0xfeeefeee)  Zeile 172	C++
	QtCored4.dll!QMetaObject::changeGuard(QObject * * ptr=0x05c0e3cc, QObject * o=0x00000000)  Zeile 501 + 0xb Bytes	C++
	QtGuid4.dll!QPointer<QAction>::operator=(QAction * p=0x00000000)  Zeile 68 + 0x1f Bytes	C++
	QtGuid4.dll!QMenuPrivate::activateAction(QAction * action=0x05c109d8, QAction::ActionEvent action_e=Trigger, bool self=true)  Zeile 1104	C++
	QtGuid4.dll!QMenu::mouseReleaseEvent(QMouseEvent * e=0x00eba8d8)  Zeile 2308	C++
	QtGuid4.dll!QWidget::event(QEvent * event=0x00eba8d8)  Zeile 7975	C++
	QtGuid4.dll!QMenu::event(QEvent * e=0x00eba8d8)  Zeile 2407	C++
	QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x05c0e1e8, QEvent * e=0x00eba8d8)  Zeile 4242 + 0x11 Bytes	C++
	QtGuid4.dll!QApplication::notify(QObject * receiver=0x05c0e1e8, QEvent * e=0x00eba8d8)  Zeile 3822 + 0x32 Bytes	C++
	Mitk3M3.exe!mitk3M3SafeQApplication::notify(QObject * receiver=0x05c0e1e8, QEvent * event=0x00eba8d8)  Zeile 34 + 0x13 Bytes	C++
	QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x05c0e1e8, QEvent * event=0x00eba8d8)  Zeile 704 + 0x15 Bytes	C++
	QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x05c0e1e8, QEvent * event=0x00eba8d8)  Zeile 218 + 0x38 Bytes	C++
	QtGuid4.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver=0x05c0e1e8, QMouseEvent * event=0x00eba8d8, QWidget * alienWidget=0x00000000, QWidget * nativeWidget=0x05c0e1e8, QWidget * * buttonDown=0x65c77a04, QPointer<QWidget> & lastMouseReceiver={...}, bool spontaneous=true)  Zeile 2954 + 0xe Bytes	C++
	QtGuid4.dll!QETWidget::translateMouseEvent(const tagMSG & msg={...})  Zeile 3134 + 0x2a Bytes	C++
	QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x00021386, unsigned int message=514, unsigned int wParam=0, long lParam=6160437)  Zeile 1617 + 0xc Bytes	C++
	user32.dll!7608fd72() 	
	[Unten angegebene Rahmen sind möglicherweise nicht korrekt und/oder fehlen, keine Symbole geladen für user32.dll]	
	user32.dll!7608fe4a() 	
	user32.dll!7608fdf3() 	
	user32.dll!7609018d() 	
	user32.dll!7609022b() 	
	QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Zeile 753	C++
	QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Zeile 1133 + 0x15 Bytes	C++
	QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Zeile 150	C++
	QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Zeile 201 + 0x2d Bytes	C++
	QtCored4.dll!QCoreApplication::exec()  Zeile 981 + 0x15 Bytes	C++
	QtGuid4.dll!QApplication::exec()  Zeile 3571	C++
	liborg_blueberry_ui_qtd.dll!berry::QtDisplay::RunEventLoop()  Zeile 46 + 0x8 Bytes	C++
	liborg_blueberry_uid.dll!berry::Workbench::RunUI()  Zeile 764 + 0x1d Bytes	C++
	liborg_blueberry_uid.dll!berry::Workbench::CreateAndRunWorkbench(berry::Display * display=0x0329fa20, berry::WorkbenchAdvisor * advisor=0x032a0548)  Zeile 191 + 0xb Bytes	C++
	liborg_blueberry_uid.dll!berry::PlatformUI::CreateAndRunWorkbench(berry::Display * display=0x0329fa20, berry::WorkbenchAdvisor * advisor=0x032a0548)  Zeile 60 + 0xd Bytes	C++
	liborg_mitk_gui_qt_3mapplicationd.dll!Qmitk3MApplication::Start()  Zeile 37 + 0x4b Bytes	C++
	liborg_blueberry_osgid.dll!berry::Starter::Run(int & argc=1, char * * argv=0x02a40b20, Poco::Util::AbstractConfiguration * config=0x02a80ff8)  Zeile 150 + 0x15 Bytes	C++
	Mitk3M3.exe!main(int argc=1, char * * argv=0x02a40b20)  Zeile 75 + 0x17 Bytes	C++
	Mitk3M3.exe!__tmainCRTStartup()  Zeile 582 + 0x19 Bytes	C
	Mitk3M3.exe!mainCRTStartup()  Zeile 399	C
	kernel32.dll!768cd0e9() 	
	ntdll.dll!777e19bb() 	
	ntdll.dll!777e198e()

Event Timeline

Results from a mouseReleaseEvent sent to the already destroyed file menu widget.
No idea from where.

I mean the popup menu which opens when pressing on file.

[SVN revision 21882]
FIX (#3428): delay widget deletion
The QtShell class wraps a QWidget (the main window) and deletes it in it's constructor. Now the widget deletion is done in the GUI event loop.

[SVN revision 21917]
FIX (#3428): fix side-effects due to delayed deletion of the main Qt widget

hi guys,

FYI, I´m still getting the following errors in WorkbenchWindow::Close()

Fri Mar 26 11:47:47 2010
blueberry.ui.wrkbncWnd: WorkbenchWindow::Close()
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Fri Mar 26 11:47:47 2010
blueberry.ui.wnd: Window::Close() (just a debug message here)
Fri Mar 26 11:47:47 2010
blueberry.ui.wrkbncWnd: WorkbenchWindow::~WorkbenchWindow() (just a debug message here)

I filed T3659 for those Qt warnings

(In reply to comment #6)

hi guys,

FYI, I´m still getting the following errors in WorkbenchWindow::Close()

Fri Mar 26 11:47:47 2010
blueberry.ui.wrkbncWnd: WorkbenchWindow::Close()
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
Fri Mar 26 11:47:47 2010
blueberry.ui.wnd: Window::Close() (just a debug message here)
Fri Mar 26 11:47:47 2010
blueberry.ui.wrkbncWnd: WorkbenchWindow::~WorkbenchWindow() (just a debug
message here)

[SVN revision 22189]
FIX (#3428): fixed crash on application exit when a hidden detached view was present