Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.3.1
-
None
-
- Qt 6.3.1 open source Windows x64
- Microsoft Windows 10 Pro, Version 10.0.19045 Build 19045
- Processor Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 2592 Mhz, 6 Core(s), 12 Logical Processor(s)
- Installed Physical Memory (RAM) 32,0 GB
- Dell P2418HT 1920x1080 Touch Screen
- Dell UltraSharp U3415W
Repeatable also with other Windows and hardware combinations if a touch screen is installed.- Qt 6.3.1 open source Windows x64 - Microsoft Windows 10 Pro, Version 10.0.19045 Build 19045 - Processor Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 2592 Mhz, 6 Core(s), 12 Logical Processor(s) - Installed Physical Memory (RAM) 32,0 GB - Dell P2418HT 1920x1080 Touch Screen - Dell UltraSharp U3415W Repeatable also with other Windows and hardware combinations if a touch screen is installed.
Description
In the Windows OS in some situations the Qt application receives native WM_GETOBJECT messages (https://learn.microsoft.com/en-us/windows/win32/winauto/wm-getobject) when a touch screen is connected. The reason for the messages is unknown but there can be several messages per second or only a single message once a while (e.g., when the application is activate/focused). If the touch screen was disconnected and system was restarted the then the WM_GETOBJECT messages were not received anymore.
If the application uses QML items that have scroll bars then the QQuickScrollBar::accessibilityActiveChanged(true) is called for every message but there aren't any QQuickScrollBar::accessibilityActiveChanged(false) calls. This causes that the QObject::connect() will be called multiple times without calling QObject::disconnect() so that new additional connections will be created. If the application runs for a long time and it contains a lot of the QML items that have scroll bars, there could be huge amount of the small memory allocations (size of 32 and 96 bytes) which will eventually consume all available memory and the software will crash. That happened also in our system in which the WM_GETOBJECT messages were received 6-7 per second in certain situation.
Also the Accessibility decreaseAction/increaseAction probably won't work correctly due the multiple connections.
If the Accessibility functionality is not needed then the issue can be prevented either by compiling the Qt with -no-feature-accessibility option or by filtering all WM_GETOBJECT messages with native event filter (https://doc.qt.io/qt-6/qcoreapplication.html#installNativeEventFilter). The latter is safe in the Qt 6.3.1 because WM_GETOBJECT messages are used only for the Accessibility and they are also discarded if the -no-feature-accessibility is used.
Call stack:
Qt6Core.dll!QObjectPrivate::connectImpl(const QObject * sender, int signal_index, const QObject * receiver, void * * slot, QtPrivate::QSlotObjectBase * slotObj, int type, const int * types, const QMetaObject * senderMetaObject) Line 5066 at C:\Qt\Src\qtbase\src\corelib\kernel\qobject.cpp(5066) Qt6Core.dll!QObject::connectImpl(const QObject * sender, void * * signal, const QObject * receiver, void * * slot, QtPrivate::QSlotObjectBase * slotObj, Qt::ConnectionType type, const int * types, const QMetaObject * senderMetaObject) Line 4992 at C:\Qt\Src\qtbase\src\corelib\kernel\qobject.cpp(4992) Qt6QuickTemplates2.dll!QObject::connect(const QQuickAccessibleAttached * signal, void(QQuickAccessibleAttached::*)()) Line 254 at C:\Qt\Src\qtbase\src\corelib\kernel\qobject.h(254) Qt6QuickTemplates2.dll!QQuickScrollBar::accessibilityActiveChanged(bool active) Line 896 at C:\Qt\Src\qtdeclarative\src\quicktemplates2\qquickscrollbar.cpp(896) Qt6Gui.dll!QAccessible::setActive(bool active) Line 825 at C:\Qt\Src\qtbase\src\gui\accessible\qaccessible.cpp(825) qwindows.dll!QWindowsUiaAccessibility::handleWmGetObject(HWND__ * hwnd, unsigned __int64 wParam, __int64 lParam, __int64 * lResult) Line 76 at C:\Qt\Src\qtbase\src\plugins\platforms\windows\uiautomation\qwindowsuiaaccessibility.cpp(76) qwindows.dll!QWindowsContext::windowsProc(HWND__ * hwnd, unsigned int message, QtWindows::WindowsEventType et, unsigned __int64 wParam, __int64 lParam, __int64 * result, QWindowsWindow * * platformWindowPtr) Line 1126 at C:\Qt\Src\qtbase\src\plugins\platforms\windows\qwindowscontext.cpp(1126) qwindows.dll!qWindowsWndProc(HWND__ * hwnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 1579 at C:\Qt\Src\qtbase\src\plugins\platforms\windows\qwindowscontext.cpp(1579) [External Code] qwindows.dll!qWindowsWndProc(HWND__ * hwnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 1588 at C:\Qt\Src\qtbase\src\plugins\platforms\windows\qwindowscontext.cpp(1588) [External Code] Qt6Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 493 at C:\Qt\Src\qtbase\src\corelib\kernel\qeventdispatcher_win.cpp(493) Qt6Gui.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 73 at C:\Qt\Src\qtbase\src\gui\platform\windows\qwindowsguieventdispatcher.cpp(73) [Inline Frame] Qt6Core.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag>) Line 136 at C:\Qt\Src\qtbase\src\corelib\kernel\qeventloop.cpp(136) Qt6Core.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 218 at C:\Qt\Src\qtbase\src\corelib\kernel\qeventloop.cpp(218) Qt6Core.dll!QCoreApplication::exec() Line 1388 at C:\Qt\Src\qtbase\src\corelib\kernel\qcoreapplication.cpp(1388) magnes_nbt_x64_u.exe!main(int argc, char * * argv) Line 109 at D:\git\magnes3\magnes\app\magnes_nbt\src\main.cpp(109) magnes_nbt_x64_u.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 97 at C:\Qt\Src\qtbase\src\entrypoint\qtentrypoint_win.cpp(97)