- 
    Bug 
- 
    Resolution: Done
- 
    P2: Important 
- 
    None
- 
    4.6.0
- 
    None
- 
        b7179d6f284e277b84c54226be05832a25576387 c838a413ee15b5ee872769f914f76ed3925b2201 c9ae5814eb40acdb683004277573a09c6b78aba9
QSymbianControl::FocusChanged is a Symbian non-leaving virtual function. It should not leave or throw exceptions.
However under OOM testing, specifically the QDesktopWidget test in tst_exceptionsafety_objects, it appears that exceptions can be thrown. This results in a crash, as it is called from QSymbianControl::setFocusSafely, which calls it in a TRAP.
Here is the call stack from the point that the allocation fails.
			48 QAllocFailAllocator::Alloc() I:\qt\tests\auto\exceptionsafety_objects\oomsimulator.h:214 0x6082ae86	
			47 User::Alloc() I:\sf\os\kernelhwsrv\kernel\eka\euser\us_exec.cpp:1749 0x6000fa74	
			46 malloc() M:\sf\os\ossrv\genericopenlibs\openenvcore\libc\src\ualloc.cpp:54 0x0fed56d1	
			45 qMalloc() I:\qt\src\corelib\global\qmalloc.cpp:55 0x608a824b	
			44 QListData::detach3() I:\qt\src\corelib\tools\qlist.cpp:137 0x609a0427	
			43 QList<QWidget *>::detach_helper() I:\qt\src\corelib\tools\qlist.h:604 0x631bba29	
			42 QList<QWidget *>::detach() I:\qt\src\corelib\tools\qlist.h:122 0x631ba90a	
			41 QList<QWidget *>::append() I:\qt\src\corelib\tools\qlist.h:469 0x631ba77c	
			40 QApplication::setActiveWindow() I:\qt\src\gui\kernel\qapplication.cpp:2430 0x63273bfe	
			39 QSymbianControl::FocusChanged() I:\qt\src\gui\kernel\qapplication_s60.cpp:872 0x632d50d8	
			38 CCoeControl::SetFocus() M:\sf\mw\classicui\lafagnosticuifoundation\cone\src\COECNTRL.CPP:2011 0x4060712c	
			37 CCoeAppUi::SetFocusToControl() M:\sf\mw\classicui\lafagnosticuifoundation\cone\src\COEAUI.CPP:728 0x406025d5	
			36 CCoeAppUi::HandleStackChanged() M:\sf\mw\classicui\lafagnosticuifoundation\cone\src\COEAUI.CPP:646 0x406023f2	
			35 CCoeAppUi::DoAddToStackL() M:\sf\mw\classicui\lafagnosticuifoundation\cone\src\COEAUI.CPP:832 0x4060286f	
			34 CCoeAppUi::DoAddToStackL() M:\sf\mw\classicui\lafagnosticuifoundation\cone\src\COEAUI.CPP:811 0x406027db	
			33 CCoeAppUi::AddToStackL() M:\sf\mw\classicui\lafagnosticuifoundation\cone\src\COEAUI.CPP:582 0x406022b0	
			32 QSymbianControl::setFocusSafely() I:\qt\src\gui\kernel\qapplication_s60.cpp:949 0x632d5544	
			31 QSymbianControl::~QSymbianControl() I:\qt\src\gui\kernel\qapplication_s60.cpp:356 0x632d2ee3	
			30 0x632D82FC( QtGui.dll )()  0x632d82fc	
			29 QWidgetPrivate::deleteSysExtra() I:\qt\src\gui\kernel\qwidget_s60.cpp:911 0x632ddb7d	
			28 QWidgetPrivate::deleteExtra() I:\qt\src\gui\kernel\qwidget.cpp:1591 0x632b58cb	
			27 QWidgetPrivate::~QWidgetPrivate() I:\qt\src\gui\kernel\qwidget.cpp:246 0x632b3292	
			26 QDesktopWidgetPrivate::~QDesktopWidgetPrivate() I:\qt\src\gui\kernel\qdesktopwidget_s60.cpp:86 0x632e0c36	
			25 0x632E14BC( QtGui.dll )()  0x632e14bc	
			24 QScopedPointerDeleter<QObjectData>::cleanup() I:\qt\src\corelib\tools\qscopedpointer.h:63 0x60930b58	
			23 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer() I:\qt\src\corelib\tools\qscopedpointer.h:100 0x60930b25	
			22 QObject::~QObject() I:\qt\src\corelib\kernel\qobject.cpp:982 0x60931297	
			21 QWidget::QWidget() I:\qt\src\gui\kernel\qwidget.cpp:1058 0x632b3d89	
			20 QDesktopWidget::QDesktopWidget() I:\qt\src\gui\kernel\qdesktopwidget_s60.cpp:121 0x632e0fb4	
			19 WidgetCreator<QDesktopWidget>::operator() I:\qt\tests\auto\exceptionsafety_objects\tst_exceptionsafety_objects.cpp:407 0x60814dde	
			18 doOOMTest<AbstractTester>() I:\qt\tests\auto\exceptionsafety_objects\tst_exceptionsafety_objects.cpp:201 0x608150be	
			17 tst_ExceptionSafetyObjects::widgets() I:\qt\tests\auto\exceptionsafety_objects\tst_exceptionsafety_objects.cpp:481 0x6081387a	
			16 tst_ExceptionSafetyObjects::qt_metacall() I:\qt\tests\auto\exceptionsafety_objects\tmp\moc\debug_shared\tst_exceptionsafety_objects.moc:91 0x60813e36	
			15 QMetaObject::metacall() I:\qt\src\corelib\kernel\qmetaobject.cpp:237 0x60921f64	
			14 QMetaMethod::invoke() I:\qt\src\corelib\kernel\qmetaobject.cpp:1533 0x609245a0	
			13 QMetaObject::invokeMethod() I:\qt\src\corelib\kernel\qmetaobject.cpp:1112 0x60923b7b	
			12 QMetaObject::invokeMethod() I:\qt\src\corelib\kernel\qobjectdefs.h:395 0x6087b71d	
			11 QTest::qInvokeTestMethodDataEntry() I:\qt\src\testlib\qtestcase.cpp:1212 0x60bf2a1e	
			10 QTest::qInvokeTestMethod() I:\qt\src\testlib\qtestcase.cpp:1308 0x60bf31f8	
			9 QTest::qInvokeTestMethods() I:\qt\src\testlib\qtestcase.cpp:1463 0x60bf39ae	
			8 QTest::qExec() I:\qt\src\testlib\qtestcase.cpp:1666 0x60bf3bf6	
			7 main() I:\qt\tests\auto\exceptionsafety_objects\tst_exceptionsafety_objects.cpp:782 0x60813c21	
			6 QtMainWrapper() I:\qt\src\s60main\qts60main_mcrt0.cpp:90 0x6082ca82	
			5 E32Main() I:\qt\src\s60main\qts60main.cpp:57 0x6082c61c	
			4 _E32Startup() M:\sf\os\kernelhwsrv\kernel\eka\euser\epoc\win32\uc_exe.cpp:87 0x6082bfac	
			3 DThread::EpocThreadFunction() I:\sf\os\kernelhwsrv\kernel\eka\kernel\win32\ckernel.cpp:84 0x0096ac23	
			2 NThread::StartThread() I:\sf\os\kernelhwsrv\kernel\eka\nkern\win32\ncthrd.cpp:187 0x009695b7	
			1 0x7C80B729( KERNEL32.dll )()  0x7c80b729