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

Deadlock when CancelIoEx fails?

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.2
    • 5.6.2
    • Core: I/O
    • None
    • Windows 7 x64, manually built qt 5.6.2, VS2015 compiler for everything
    • c7ec07d40115bef849574c81d619b629af9434a9

    Description

      I am getting a deadlock at my app's destruction.

      Call Stack is
        ntdll.dll!ZwDelayExecution() Unknown
      KernelBase.dll!SleepEx() Unknown
      > Qt5Cored.dll!QWindowsPipeReader::waitForNotification(int timeout) Line 300 C++
      Qt5Cored.dll!QWindowsPipeReader::stop() Line 116 C++
      Qt5Networkd.dll!QLocalSocketPrivate::_q_pipeClosed() Line 253 C++
      Qt5Networkd.dll!QLocalSocket::close() Line 300 C++
      Qt5Networkd.dll!QLocalSocket::~QLocalSocket() Line 358 C++
      rt_debug.exe!QLocalSocket::`scalar deleting destructor'(unsigned int) C++
      Qt5Cored.dll!QObjectPrivate::deleteChildren() Line 1963 C++
      Qt5Cored.dll!QObject::~QObject() Line 1034 C++
      rt_debug.exe!KrConnection::~KrConnection() Line 52 C++
      rt_debug.exe!KrConnection::`scalar deleting destructor'(unsigned int) C++
      rt_debug.exe!KrApplication::_stopConnection() Line 362 C++
      rt_debug.exe!KrApplication::~KrApplication() Line 174 C++
      rt_debug.exe!main(int argCount, char * * argValues) Line 58 C++
      rt_debug.exe!WinMain(HINSTANCE__ * _formal, HINSTANCE_ * __formal, char * __formal, int __formal) Line 113 C++
      rt_debug.exe!invoke_main() Line 99 C++
      rt_debug.exe!__scrt_common_main_seh() Line 253 C++
      rt_debug.exe!__scrt_common_main() Line 296 C++
      rt_debug.exe!WinMainCRTStartup() Line 17 C++
      kernel32.dll!BaseThreadInitThunk() Unknown
      ntdll.dll!RtlUserThreadStart() Unknown

      WaitForNotification (-1) triggers an infinite sleep, and i assume no notificaion ever comes
      qt_cancelIo() called earlier in stop() failed with error ERROR_NOT_FOUND

      Some fork of qt made a modification 4 years ago ( https://git.merproject.org/mer-core/qtbase/commit/17869a544e2a3b2cdc61dfe87a96a8c1a3286fff ) saying that if cancelIo fails, then there will not be a notification. So the wait should be conditioned by the success of cancelIo

      Wouldn't that be a valid fix to integrate ?

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            bartoli Olivier BARTHELEMY
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes