Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5 and Qt6 Bluetooth crashes on segmentation fault.
Qt 6.11 is out! See what's new in the release blog

Qt5 and Qt6 Bluetooth crashes on segmentation fault.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.1k Views
  • 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.
  • Z Offline
    Z Offline
    Zmmfly
    wrote on last edited by
    #1

    Hello everyone.

    When running with QBluetooth, and call "QLowEnergyService::discoverDetails", it random crash.
    There are the trace of my application:

    Thread 41 received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 58424.0xeffc]
    0x00007ffdd6a13b6a in Qt5Bluetooth!?setMaxPendingConnections@QBluetoothServer@@QEAAXH@Z ()
       from S:\X\dist\Qt5Bluetooth.dll
    (gdb) bt
    #0  0x00007ffdd6a13b6a in Qt5Bluetooth!?setMaxPendingConnections@QBluetoothServer@@QEAAXH@Z ()
       from S:\X\dist\Qt5Bluetooth.dll
    #1  0x00007ffdd6a12620 in Qt5Bluetooth!?setMaxPendingConnections@QBluetoothServer@@QEAAXH@Z ()
       from S:\X\dist\Qt5Bluetooth.dll
    #2  0x00007ff700eb6404 in ?? ()
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)
    

    Qt version:5.15.2
    build with msvc

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @Zmmfly The last line says something is trampling on memory it should not be, or you are mixing library versions, or overwriting a fixed buffer... Run a debug build of your program in your debugger and see where it goes wrong. We cannot do that for you.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zmmfly
        wrote on last edited by Zmmfly
        #3

        @ChrisW67 I try to debug it, The debugger tell me "Unhandled exception at 0x00007FFDCD113B6A (Qt5Bluetooth.dll) in ble_tester.exe: 0xC0000005: Access violation reading location 0x0000000000000000."
        Access violation reading location 0x0000000000000000
        Slot

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          Zmmfly
          wrote on last edited by
          #4

          I think i found solution, before call "QLowEnergyService::discoverDetails", if "QLowEnergyController" emit error signals, and the error is "RemoteHostClosedError", we cannot do it, it will caused crash. The truly method is giveup the conntion, and wait next connection.

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            Zmmfly
            wrote on last edited by
            #5

            The similar problem: https://forum.qt.io/topic/119766/unknown-exception-is-not-beeing-caught-in-trycatch-block-bluetooth-low-energy-servicedetailsdiscovery

            1 Reply Last reply
            0

            • Login

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