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

WebKit with Qt5 hangs on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.0.0
    • 5.0.0
    • None
    • OS X Lion Server, 2x2.93GHz 6-Core Intel Xeon, 8GB RAM.
    • macOS
    • 702b4cb5d464ac5abb97a3e75601b6a946673ee4

    Description

      Either start QtTestBrowser, MiniBrowser or DumpRenderTree it hangs, the main thread is in dead lock:

      #0 0x00007fff90066bca in __psynch_cvwait
      #1 0x00007fff8caac274 in _pthread_cond_wait
      #2 0x0000000107e5e38e in QWaitConditionPrivate::wait at qwaitcondition_unix.cpp:86
      #3 0x0000000107e5e0ac in QWaitCondition::wait at qwaitcondition_unix.cpp:158
      #4 0x0000000107e52f8b in QSemaphore::acquire at qsemaphore.cpp:144
      #5 0x000000010803aff7 in QMetaMethod::invoke at qmetaobject.cpp:1693
      #6 0x000000010803a13b in QMetaObject::invokeMethod at qmetaobject.cpp:1167
      #7 0x000000010927e1c7 in QMetaObject::invokeMethod at qobjectdefs.h:390
      #8 0x00000001092f2d9b in QNetworkConfigurationManagerPrivate::updateConfigurations at qnetworkconfigmanager_p.cpp:429
      #9 0x00000001092f233c in QNetworkConfigurationManagerPrivate::initialize at qnetworkconfigmanager_p.cpp:76
      #10 0x00000001092ee783 in qNetworkConfigurationManagerPrivate at qnetworkconfigmanager.cpp:84
      #11 0x00000001092ee993 in QNetworkConfigurationManager::QNetworkConfigurationManager at qnetworkconfigmanager.cpp:224
      #12 0x00000001092ee94d in QNetworkConfigurationManager::QNetworkConfigurationManager at qnetworkconfigmanager.cpp:223
      #13 0x00000001012f168c in WebCore::NetworkStateNotifierPrivate::NetworkStateNotifierPrivate at NetworkStateNotifierQt.cpp:35
      #14 0x00000001012f160d in WebCore::NetworkStateNotifierPrivate::NetworkStateNotifierPrivate at NetworkStateNotifierQt.cpp:35
      #15 0x00000001012f1aea in WebCore::NetworkStateNotifier::NetworkStateNotifier at NetworkStateNotifierQt.cpp:79
      #16 0x00000001012f1a95 in WebCore::NetworkStateNotifier::NetworkStateNotifier at NetworkStateNotifierQt.cpp:78
      #17 0x0000000100fa5395 in WebCore::networkStateNotifier at NetworkStateNotifier.cpp:37
      #18 0x0000000100eb6d50 in WebCore::Page::Page at Page.cpp:169
      #19 0x0000000100eb678d in WebCore::Page::Page at Page.cpp:165
      #20 0x00000001000d7de5 in QWebPagePrivate::QWebPagePrivate at qwebpage.cpp:335
      #21 0x00000001000d7acd in QWebPagePrivate::QWebPagePrivate at qwebpage.cpp:316
      #22 0x00000001000e210e in QWebPage::QWebPage at qwebpage.cpp:1934
      #23 0x000000010000814b in WebCore::WebPage::WebPage at /Users/balazs/WebKitGit/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp:135
      #24 0x0000000100008115 in WebCore::WebPage::WebPage at /Users/balazs/WebKitGit/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp:135
      #25 0x000000010000a288 in WebCore::DumpRenderTree::DumpRenderTree at /Users/balazs/WebKitGit/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp:416
      #26 0x0000000100009e15 in WebCore::DumpRenderTree::DumpRenderTree at /Users/balazs/WebKitGit/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp:395
      #27 0x00000001000292b2 in main at /Users/balazs/WebKitGit/Tools/DumpRenderTree/qt/main.cpp:191

      I use the weekly pinned hashes as other QtWebKit people: 7f8c9b7eaf9efcda699d4f170cb72f5c2cb71a1d. Simple examples do work with my Qt5 build.

      After some debugging it seems like this deadlock is the result of another that happens in the bearer thread.

      in QNetworkConfigurationManagerPrivate::updateConfigurations there is this:

      foreach (QBearerEngine* engine, enginesToInitialize) {
      QMetaObject::invokeMethod(engine, "initialize", Qt::BlockingQueuedConnection);
      }

      This waits until the engine initializing on the bearer thread, but that thread gets blocked during this initialization:

      #0 0x00007fff90066bf2 in __psynch_mutexwait
      #1 0x00007fff8caa71a1 in pthread_mutex_lock
      #2 0x00007fff8cdb4e9a in __cxa_guard_acquire
      #3 0x0000000109324cfd in manager at qnetworkinterface.cpp:82
      #4 0x0000000109324eab in QNetworkInterface::allInterfaces at qnetworkinterface.cpp:544
      #5 0x000000010f0beeed in QGenericEngine::doRequestUpdate at qgenericengine.cpp:199
      #6 0x000000010f0beea5 in QGenericEngine::initialize at qgenericengine.cpp:182
      #7 0x000000010f0c9f25 in QGenericEngine::qt_static_metacall at moc_qgenericengine.cpp:55
      #8 0x000000010807248e in QMetaCallEvent::placeMetaCall at qobject.cpp:436

      I don't know what'S the problem here, it's a simple Q_GLOBAL_STATIC initialization. Also, I don't know why it happens only with WebKit (for example network examples using QNetworkConfigurationManager works), it does not seems to me that WebKit does anything fancy. The instantiation of QNetworkConfigurationManager happens only once on the main thread, and there is just one bearer thread that tries to initialize the global static.

      Attachments

        Issue Links

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

          Activity

            People

              albisser Zeno Albisser
              kbalazs Balazs Kelemen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes