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

QNAM::get on Android is blocking the thread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.1
    • Network
    • None
    • Android 5.1, Moto X
    • Android

    Description

      A simple QNAM::get on Android (armv7) is blocking the calling thread. It seems to only happen on Android. Here is a code that can reproduce the bug.

      I notice the UI of my app was choking on Android, then it narrow down to QNAM::get call. I don't know if it is initialization, but 759ms and 760ms for that is a long time.

      main.cpp
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      #include <QNetworkAccessManager>
      #include <QElapsedTimer>
      #include <QDebug>
      #include <QNetworkReply>
      #include <QNetworkRequest>
      
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
      
          QNetworkAccessManager nam;
          QElapsedTimer timer;
          timer.start();
          nam.get(QNetworkRequest(QUrl("http://www.google.com")));
          qDebug() << "result: "  << timer.elapsed();
          nam.get(QNetworkRequest(QUrl("http://www.bing.com")));
          qDebug() << "result2: "  << timer.elapsed();
          return app.exec();
      }
      

      Output:

      Starting remote process.I/ActivityManager(  898): Start proc 19198:org.qtproject.example.untitled/u0a502 for activity org.qtproject.example.untitled/org.qtproject.qt5.android.bindings.QtActivity
      I/art     (19198): Late-enabling -Xcheck:jni
      W/linker  (19198): libQt5Gui.so: unused DT entry: type 0x1d arg 0x4e21a
      W/linker  (19198): libQt5Network.so: unused DT entry: type 0x1d arg 0x11731
      W/linker  (19198): libQt5Qml.so: unused DT entry: type 0x1d arg 0x3417d
      W/linker  (19198): libQt5Quick.so: unused DT entry: type 0x1d arg 0x35b61
      W/linker  (19198): libQt5QuickParticles.so: unused DT entry: type 0x1d arg 0x3656
      W/linker  (19198): libqtforandroid.so: unused DT entry: type 0x1d arg 0x8f94
      I/Qt      (19198): qt start
      W/linker  (19198): libqandroidbearer.so: unused DT entry: type 0x1d arg 0x1727
      W/linker  (19198): libuntitled.so: unused DT entry: type 0x1d arg 0x61b
      D/        (19198): (null):0 ((null)): QML debugging is enabled. Only use this in a safe environment.
      D/OpenGLRenderer(19198): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
      D/Atlas   (19198): Validating map...
      I/Adreno-EGL(19198): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.AF.1.1_RB1.05.00.02.006.020_msm8960_LA.AF.1.1_RB1__release_AU ()
      I/Adreno-EGL(19198): OpenGL ES Shader Compiler Version: E031.25.03.06
      I/Adreno-EGL(19198): Build Date: 03/30/15 Mon
      I/Adreno-EGL(19198): Local Branch: mybranch8688311
      I/Adreno-EGL(19198): Remote Branch: quic/LA.AF.1.1_rb1.16
      I/Adreno-EGL(19198): Local Patches: NONE
      I/Adreno-EGL(19198): Reconstruct Branch: AU_LINUX_ANDROID_LA.AF.1.1_RB1.05.00.02.006.020 + 9b2699f + 2215637 + 60aa592 + f2362e6 + 5c64f59 + 82411a1 + 1f36e07 +  NOTHING
      I/OpenGLRenderer(19198): Initialized EGL, version 1.4
      D/OpenGLRenderer(19198): Enabling debug mode 0
      D/libuntitled.so(19198): ../untitled/main.cpp:17 (int main(int, char**)): result:  759
      D/libuntitled.so(19198): ../untitled/main.cpp:19 (int main(int, char**)): result2:  760
      

      Attachments

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

        Activity

          People

            richmoore Richard Moore (qtnetwork)
            paulovap Paulo Pinheiro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes