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

QNetworkConfigurationManager crashes on QMutex access when recreating QApplication and QWebView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.0
    • 4.7.0, 4.8.x
    • None
    • Qt 4.7.0, Windows XP, MSVC9, Qt Creator 2.0.1
    • 7388fcb83592a90aace054314e0c3e7e7a94fdae 44373d71dde16c4899377703e724d46d803ade9e

    Description

      Test case is included as an attachment buildable by qmake && make.
      Build it, run it and close the appearing window and it crashes.
      Here's the contents briefly described:

      • Loop with two rounds containing this:
      • Create QMainApplication
      • Create QMainWindow
      • Create QWebView and set it as QMainWindow's central widget
      • Load URL to QWebView (e.g. http://www.google.com/)
      • Show the QWebView
      • Execute the QMainApplication

      So after closing the window and destroying the objects on the
      first loop it crashes. I know the Qt documentation says that
      there is precisely one QApplication per program but does that
      mean also that you can't have only one QApplication object
      at a time but different ones consequently in a program (as
      is the case in the test case)?

      --- Stack trace from Qt Creator 2.0.1 with MSVC debugger: ---
      
      Stopped at qmutex.cpp:151 in thread 0. 
      Exception at 0x6705e44b, code: 0xc0000005: read access violation at: 0xc, flags=0x0
      
      Level    Function    File    Line    Address
      0	QMutex::lock	qmutex.cpp	151	0x6705e44b	
      1	QMutexLocker::QMutexLocker	qmutex.h	103	0x6703b1cd	
      2	QNetworkConfigurationManagerPrivate::enablePolling	qnetworkconfigmanager_p.cpp	502	0x640828e8	
      3	QNetworkConfigurationManager::QNetworkConfigurationManager	qnetworkconfigmanager.cpp	216	0x6407cada	
      4	QNetworkAccessManager::createRequest	qnetworkaccessmanager.cpp	966	0x64044a87	
      5	QNetworkAccessManager::get	qnetworkaccessmanager.cpp	688	0x64043fec	
      6	WebCore::QNetworkReplyHandler::start	QNetworkReplyHandler.cpp	442	0x109cef56	
      7	WebCore::QNetworkReplyHandler::QNetworkReplyHandler	QNetworkReplyHandler.cpp	178	0x109cd45d	
      8	WebCore::ResourceHandle::start	ResourceHandleQt.cpp	141	0x109cbaeb	
      9	WebCore::ResourceHandle::create	ResourceHandle.cpp	64	0x1083d13c	
      10	WebCore::MainResourceLoader::loadNow	MainResourceLoader.cpp	524	0x10748428	
      11	WebCore::MainResourceLoader::load	MainResourceLoader.cpp	548	0x1074855f	
      12	WebCore::DocumentLoader::startLoadingMainResource	DocumentLoader.cpp	727	0x107100c6	
      13	WebCore::FrameLoader::continueLoadAfterWillSubmitForm	FrameLoader.cpp	3057	0x107244be	
      14	WebCore::FrameLoader::continueLoadAfterNavigationPolicy	FrameLoader.cpp	3538	0x10725e11	
      15	WebCore::FrameLoader::callContinueLoadAfterNavigationPolicy	FrameLoader.cpp	3469	0x10725b15	
      16	WebCore::PolicyCallback::call	PolicyCallback.cpp	101	0x1074c170	
      17	WebCore::PolicyChecker::continueAfterNavigationPolicy	PolicyChecker.cpp	161	0x1074cf1e	
      18	WebCore::FrameLoaderClientQt::callPolicyFunction	FrameLoaderClientQt.cpp	193	0x109f9422	
      19	WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction	FrameLoaderClientQt.cpp	1036	0x109fcd72	
      20	WebCore::PolicyChecker::checkNavigationPolicy	PolicyChecker.cpp	89	0x1074ca1e	
      21	WebCore::FrameLoader::loadWithDocumentLoader	FrameLoader.cpp	2104	0x107217f0	
      22	WebCore::FrameLoader::load	FrameLoader.cpp	2057	0x10721464	
      23	WebCore::FrameLoader::load	FrameLoader.cpp	1998	0x10720f6e	
      24	WebCore::FrameLoader::load	FrameLoader.cpp	1984	0x10720d9b	
      25	QWebFrame::load	qwebframe.cpp	952	0x10a0627f	
      26	QWebFrame::load	qwebframe.cpp	894	0x10a05e2a	
      27	QWebView::load	qwebview.cpp	433	0x10a229f1	
      28	main	main.cpp	13	0x401160	
      29	WinMain	qtmain_win.cpp	131	0x4023ca	
      30	__tmainCRTStartup	crtexe.c	578	0x4018a8	
      31	WinMainCRTStartup	crtexe.c	403	0x40160f	
      32	RegisterWaitForInputIdle	kernel32	0	0x7c816fe7	
      

      Qt\4.7.0\src\corelib\thread\qmutex.cpp:

      void QMutex::lock()
      {
          Qt::HANDLE self;
      
          if (d->recursive) { // <---- debugger points here at level 0
              self = QThread::currentThreadId();
      ...
      

      Attachments

        Issue Links

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

          Activity

            People

              cristiano cristiano di flora
              kari_null Kari Salminen
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes