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

Application crashes when calling stop() on QBluetoothServiceDiscoveryAgent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9.2
    • 5.8.0
    • None
    • Qt 5.8.0
      QtCreator 4.2.0
      Android for armeabi-v7a, SDK API level 17, 19, 21, 25

    Description

      This issue occurs on certain devices upon trying to interrupt an active service discovery by explicitly calling the

      stop()

      slot of QBluetoothServiceDiscoveryAgent.

      Steps to reproduce:

      1. Make sure Bluetooth adapter is installed, fully functional and powered on.
      2. Start a service discovery using a default constructed QBluetoothServiceDiscoveryAgent.
      3. Make sure discovery is active.
      4. Call the slot stop() on the above mentioned QBluetoothServiceDiscoveryAgent before discovery finishes.
      5. Notice that the application crashes.

      The issue was initially reproduced while developing a more complex application (a work-related project) so I've created a minimal example to reproduce the issue. Sources attached.

      The issue was tested on multiple devices and
      it occurs on:

      • Lenovo TAB 2 (A8-50LC), running Android 5.0.2
      • Samsung Galaxy Tab 2 (GT-P3110), running Android 4.1.2

      it does not occur on:

      • Nexus 4, running Android 5.1.1
      • AllView A5 Duo, running Android 4.2.2
      • OnePlus 3 (A3003), running Android 7.0 OxygenOS 4.0.3
      • Huawei P8 Lite, running Android 6.0

      Application output from the Lenovo TAB 2, starting from stop() call and until crash (complete output is attached as txt file):

      D/libServiceDiscovery.so(16395): ..\ServiceDiscovery\controller.cpp:28 (void Controller::stopScan()): calling stop
      D/BluetoothAdapter(16395): cancelDiscovery
      D/BluetoothAdapter(16395): 624572704: getState(). Returning 12
      ...
      ...
      ... about 6100 lines of 
      ... D/BluetoothAdapter(16395): cancelDiscovery
      ... D/BluetoothAdapter(16395): 624572704: getState(). Returning 12
      ...
      ...
      D/BluetoothAdapter(16395): cancelDiscovery
      D/BluetoothAdapter(16395): 624572704: getState(). Returning 12
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      E/art     (16395): JNI GetMethodID called with pending exception 'java.lang.StackOverflowError' thrown in unknown throw location
      W/ADB_SERVICES(  651): terminating JDWP 16395 connection: Try again
      D/ADB_SERVICES(  651): remove pid 16395 to jdwp process list
      D/DisplayManagerService(  675): Display listener for pid 16395 died.
      I/SurfaceFlinger(  206): EventThread Client Pid (16395) disconnected by (206)
      I/SurfaceFlinger(  206): EventThread Client Pid (16395) disconnected by (206)
      I/Zygote  (  302): Process 16395 exited due to signal (11)
      I/ActivityManager(  675): Process org.qtproject.example.ServiceDiscovery (pid 16395) has died
      D/ActivityManager(  675): SVC-handleAppDiedLocked: app = ProcessRecord{1690dc22 16395:org.qtproject.example.ServiceDiscovery/u0a95}, app.pid = 16395
      W/InputMethodManagerService(  675): Got RemoteException sending setActive(false) notification to pid 16395 uid 10095
      
      
      "org.qtproject.example.ServiceDiscovery" died.
      

      Please note that while the application output from the Samsung Galaxy Tab 2 is less detailed (complete output is also attached), both outputs end in the following line before application crashes:
      W/InputMethodManagerService( ###): Got RemoteException sending setActive(false) notification to pid ##### uid #####

      Attachments

        For Gerrit Dashboard: QTBUG-60131
        # Subject Branch Project Status CR V

        Activity

          People

            ablasche Alex Blasche
            viktorr14 Victor-Andrei Variu
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes