Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Crashing when use QBluetooth on Windows 10 with a BTLE adapter
Forum Updated to NodeBB v4.3 + New Features

Crashing when use QBluetooth on Windows 10 with a BTLE adapter

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 5 Posters 964 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Pham HoangP Offline
    Pham HoangP Offline
    Pham Hoang
    wrote on last edited by Pham Hoang
    #1

    i am using:
    Windows 10, up to date. Using a BTLE adapter (no BTLE driver built in)
    QT 5.12.
    Paired my BTLE device with Windows adapter.

    i am trying to connect to the device many times 10 seconds each time. because i don't know when my device power on.
    normally, i got:
    [2019-01-22T10:47:19.209+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::ConnectingState
    [2019-01-22T10:47:27.010+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::UnconnectedState
    it works fine.

    but after few times, it crashed: after QLowEnergyController::ConnectingState. it is:
    [2019-01-22T10:47:19.209+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::ConnectingState
    Second Chance Assertion Failed: File
    minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp, Line 904
    ( a form rised: Expression: _CrtlsValidHeapPointer(block))

    it is more often when i run on Debug mode.

    my questions are:

    • What am i missing? how can i pass this issue?
    • does QT support full work flow and cases of BTLE on windows? (BTLE driver built in and BTLE adapter 3rd party)
      thanks. ^^!
    sierdzioS J.HilkJ 2 Replies Last reply
    0
    • Pham HoangP Pham Hoang

      i am using:
      Windows 10, up to date. Using a BTLE adapter (no BTLE driver built in)
      QT 5.12.
      Paired my BTLE device with Windows adapter.

      i am trying to connect to the device many times 10 seconds each time. because i don't know when my device power on.
      normally, i got:
      [2019-01-22T10:47:19.209+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::ConnectingState
      [2019-01-22T10:47:27.010+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::UnconnectedState
      it works fine.

      but after few times, it crashed: after QLowEnergyController::ConnectingState. it is:
      [2019-01-22T10:47:19.209+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::ConnectingState
      Second Chance Assertion Failed: File
      minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp, Line 904
      ( a form rised: Expression: _CrtlsValidHeapPointer(block))

      it is more often when i run on Debug mode.

      my questions are:

      • What am i missing? how can i pass this issue?
      • does QT support full work flow and cases of BTLE on windows? (BTLE driver built in and BTLE adapter 3rd party)
        thanks. ^^!
      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Pham-Hoang said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

      my questions are:

      • What am i missing? how can i pass this issue?

      Try with Qt 5.11.3, it seems more stable.

      Both Qt and Windows have serious bugs in Bluetooth support (even leading to system crashing). My recommendations are:

      • put your bluetooth code in a plugin (or even better - in a separate process) and load it dynamically
      • if QtBluetooth crashes - reload the plugin
      • do not constantly scan for devices in the background - due to a memory leak in Windows it leads to runaway RAM consumption and crashes the whole system. Only do a manual scan when necessary (when user requests it)
      • do not go below Qt 5.11.3 - it includes a fix for a crash in Qt's bluetooth module
      • does QT support full work flow and cases of BTLE on windows? (BTLE driver built in and BTLE adapter 3rd party)
        thanks. ^^!

      Yep, it all works, although with many caveats and quirks.

      (Z(:^

      JKSHJ 1 Reply Last reply
      3
      • Pham HoangP Pham Hoang

        i am using:
        Windows 10, up to date. Using a BTLE adapter (no BTLE driver built in)
        QT 5.12.
        Paired my BTLE device with Windows adapter.

        i am trying to connect to the device many times 10 seconds each time. because i don't know when my device power on.
        normally, i got:
        [2019-01-22T10:47:19.209+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::ConnectingState
        [2019-01-22T10:47:27.010+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::UnconnectedState
        it works fine.

        but after few times, it crashed: after QLowEnergyController::ConnectingState. it is:
        [2019-01-22T10:47:19.209+07:00][debug ] 0xe9c BTLEQtInputDevice::onStateChanged QLowEnergyController::ConnectingState
        Second Chance Assertion Failed: File
        minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp, Line 904
        ( a form rised: Expression: _CrtlsValidHeapPointer(block))

        it is more often when i run on Debug mode.

        my questions are:

        • What am i missing? how can i pass this issue?
        • does QT support full work flow and cases of BTLE on windows? (BTLE driver built in and BTLE adapter 3rd party)
          thanks. ^^!
        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @Pham-Hoang additionally to what @sierdzio said, make sure your windows is up to date with all updates.

        That makes a huge difference!


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        1
        • K Offline
          K Offline
          kuzulis
          Qt Champions 2020
          wrote on last edited by
          #4

          @Pham-Hoang , you can try to use the win32-based plugin (not UWP plugin) from the wip/win branch of qtconnectivity module. Maybe it will be more stable. For this, you need to compile the qtconnectivity module yourself.

          1 Reply Last reply
          0
          • Pham HoangP Offline
            Pham HoangP Offline
            Pham Hoang
            wrote on last edited by
            #5

            @Pham-Hoang said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

            es QT support full work flow and cases of BTLE on windows? (BTLE driver built in and BTLE adapter 3rd party)

            thank you all. your information are very useful for me to dev on my project.

            1 Reply Last reply
            0
            • sierdzioS sierdzio

              @Pham-Hoang said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

              my questions are:

              • What am i missing? how can i pass this issue?

              Try with Qt 5.11.3, it seems more stable.

              Both Qt and Windows have serious bugs in Bluetooth support (even leading to system crashing). My recommendations are:

              • put your bluetooth code in a plugin (or even better - in a separate process) and load it dynamically
              • if QtBluetooth crashes - reload the plugin
              • do not constantly scan for devices in the background - due to a memory leak in Windows it leads to runaway RAM consumption and crashes the whole system. Only do a manual scan when necessary (when user requests it)
              • do not go below Qt 5.11.3 - it includes a fix for a crash in Qt's bluetooth module
              • does QT support full work flow and cases of BTLE on windows? (BTLE driver built in and BTLE adapter 3rd party)
                thanks. ^^!

              Yep, it all works, although with many caveats and quirks.

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              @sierdzio said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

              do not constantly scan for devices in the background - due to a memory leak in Windows it leads to runaway RAM consumption and crashes the whole system.

              Is it possible to provide more details about this memory leak? Do you know if it has been fixed in recent builds of Windows?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              sierdzioS 1 Reply Last reply
              0
              • JKSHJ JKSH

                @sierdzio said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

                do not constantly scan for devices in the background - due to a memory leak in Windows it leads to runaway RAM consumption and crashes the whole system.

                Is it possible to provide more details about this memory leak? Do you know if it has been fixed in recent builds of Windows?

                sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                @JKSH said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

                @sierdzio said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

                do not constantly scan for devices in the background - due to a memory leak in Windows it leads to runaway RAM consumption and crashes the whole system.

                Is it possible to provide more details about this memory leak? Do you know if it has been fixed in recent builds of Windows?

                I certainly hope it has been fixed, it's been at least 3-4 years since I run into it.

                If I recall well, we were scanning devices with a timer every few seconds. Windows was not cleaning up correctly between scans or something. At first, RAM was only raising slowly, but after some 10-30 minutes it was beginning to snowball rapidly, taking all memory, crashing GPU drivers etc.

                (Z(:^

                JKSHJ 1 Reply Last reply
                1
                • sierdzioS sierdzio

                  @JKSH said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

                  @sierdzio said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

                  do not constantly scan for devices in the background - due to a memory leak in Windows it leads to runaway RAM consumption and crashes the whole system.

                  Is it possible to provide more details about this memory leak? Do you know if it has been fixed in recent builds of Windows?

                  I certainly hope it has been fixed, it's been at least 3-4 years since I run into it.

                  If I recall well, we were scanning devices with a timer every few seconds. Windows was not cleaning up correctly between scans or something. At first, RAM was only raising slowly, but after some 10-30 minutes it was beginning to snowball rapidly, taking all memory, crashing GPU drivers etc.

                  JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #8

                  @sierdzio said in Crashing when use QBluetooth on Windows 10 with a BTLE adapter:

                  I certainly hope it has been fixed, it's been at least 3-4 years since I run into it.

                  If I recall well, we were scanning devices with a timer every few seconds. Windows was not cleaning up correctly between scans or something. At first, RAM was only raising slowly, but after some 10-30 minutes it was beginning to snowball rapidly, taking all memory, crashing GPU drivers etc.

                  Looks like the issue still exists, unfortunately: https://bugreports.qt.io/browse/QTBUG-105742

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply
                  1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved