Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.10.1, 5.11.2
-
None
-
OS: Windows 10, version 1803
Compiler: msvc2017
-
-
83a845aa0e5bb155fae3f1d5d27bb80801f90935 (qt/qtconnectivity/dev)
Description
In our application we're observing a crash in QWinRTBluetoothDeviceDiscoveryWorker class that happens if you let the application run for a while (sometimes after 1h and sometimes after 6h).
What we're doing is a constant scanning for BLE devices with QBluetoothDeviceDiscoveryAgent with a predefined timeout. When the scan finishes, the next one is started.
Here is a stack trace:
1 QMetaObject::invokeMethod qmetaobject.cpp 1474 0x7ffbcffeb6e6 2 QMetaObject::invokeMethod qobjectdefs.h 451 0x7ffbcfbc2aa9 3 QWinRTBluetoothDeviceDiscoveryWorker::onBluetoothLEDeviceFound qbluetoothdevicediscoveryagent_winrt.cpp 541 0x7ffbce0e7ebd 4 QWinRTBluetoothDeviceDiscoveryWorker::onPairedBluetoothLEDeviceFoundAsync qbluetoothdevicediscoveryagent_winrt.cpp 434 0x7ffbce0e6a47 5 <lambda_94a6b4c89a6b31ab34365fe8bbe6c3e2>::operator()<ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Devices::Bluetooth::BluetoothLEDevice * __ptr64> * __ptr64,enum ABI::Windows::Foundation::AsyncStatus> event.h 335 0x7ffbce0e9943 6 Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl ABI::Windows::Foundation::IAsyncOperationCompletedHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Devices::Bluetooth::BluetoothLEDevice * __ptr64,ABI::Windows: event.h 245 0x7ffbce0f1ff5
I've spent some time on analysis and it seems that it's possible that function onPairedBluetoothLEDeviceFoundAsync (which is called asynchronously) is called after an instance of QWinRTBluetoothDeviceDiscoveryWorker is deleted.