Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119060

Read access violation when calling stop() during Bluetooth service discovery

    XMLWordPrintable

Details

    • Windows
    • 3
    • 35f853837 (dev), 3593b019e (6.7), 314b9bcdb (6.6), f0666e04b (tqtc/lts-6.5)
    • Foundations Sprint 97

    Description

      The attached project is a lightly modified version of the example Bluetooth Low Energy Scanner application. Invoking QLowEnergyController::disconnectFromDevice() while a pending QLowEnergyService::discoverDetails() executes produces the following exception in the debugger:

      The inferior stopped because it triggered an exception:

      Stopped in thread 0 by: Exception at 0xblahblah, code: 0xc0000005: read
      access violation at: 0x44, flags=0x0 (first chance)

      The line of code was:

      qlowenergyserviceprivate.cpp, line 37:
          if (state == newState)

      Resuming execution allows the program to continue without crashing; running outside the debugger also avoids crashes. However, this strongly suggests use of an invalid pointer, which will lead to undefined behavior in the long run.

      A possibly related issue: https://bugreports.qt.io/browse/QTBUG-60131

      The backtrace is:

      1   QLowEnergyServicePrivate::setState                                                                                                                                                                                                                    qlowenergyserviceprivate.cpp   37   0x7fff69fa3087 
      2   QLowEnergyControllerPrivateWinRT::discoverServiceDetailsHelper                                                                                                                                                                                        qlowenergycontroller_winrt.cpp 1235 0x7fff6a05dc30 
      3   <lambda_c922d2965d798da46026729a334a0e4b>::operator()                                                                                                                                                                                                 qlowenergycontroller_winrt.cpp 1212 0x7fff6a064c43 
      4   std::invoke<<lambda_c922d2965d798da46026729a334a0e4b> &,Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattDeviceService>>                                                                                        type_traits                    1549 0x7fff6a081075 
      5   std::_Invoker_ret<void,1>::_Call<<lambda_c922d2965d798da46026729a334a0e4b> &,Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattDeviceService>>                                                                   functional                     652  0x7fff6a07c42e 
      6   std::_Func_impl_no_alloc<<lambda_c922d2965d798da46026729a334a0e4b>,void,Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattDeviceService>>::_Do_call                                                              functional                     823  0x7fff6a06cb1a 
      7   std::_Func_class<void,Microsoft::WRL::ComPtr<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattDeviceService>>::operator()                                                                                                              functional                     869  0x7fff6a089d62 
      8   <lambda_29ff8518cb9930cba3174e1da2e022e3>::operator()                                                                                                                                                                                                 qlowenergycontroller_winrt.cpp 792  0x7fff6a063959 
      9   Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl ABI::Windows::Foundation::IAsyncOperationCompletedHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::GattDeviceServic event.h                        354  0x7fff6a06c338 
      10  NdrSendReceive                                                                                                                                                                                                                                        RPCRT4                              0x7ff825dbb4b3 
      11  Ndr64AsyncServerCallAll                                                                                                                                                                                                                               RPCRT4                              0x7ff825e1e77b 
      12  NdrStubCall3                                                                                                                                                                                                                                          RPCRT4                              0x7ff825d5d479 
      13  CStdStubBuffer_Invoke                                                                                                                                                                                                                                 combase                             0x7ff825f25f00 
      14  CStdStubBuffer_Invoke                                                                                                                                                                                                                                 RPCRT4                              0x7ff825d9a74b 
      15  CoWaitForMultipleHandles                                                                                                                                                                                                                              combase                             0x7ff825efbad3 
      16  CoWaitForMultipleHandles                                                                                                                                                                                                                              combase                             0x7ff825efb85e 
      17  HSTRING_UserSize                                                                                                                                                                                                                                      combase                             0x7ff825f2aaa6 
      18  RoGetActivatableClassRegistration                                                                                                                                                                                                                     combase                             0x7ff825ea1283 
      19  CoWaitForMultipleHandles                                                                                                                                                                                                                              combase                             0x7ff825ef9d7d 
      20  SetErrorInfo                                                                                                                                                                                                                                          combase                             0x7ff825e95036 
      ... <More>                                                                                                                                           

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivan.solovev Ivan Solovev
            bjones Bryan Jones
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: