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

WinRT: Sockets sometimes fail to initialize

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.3, 5.7.1
    • 5.7.0, 5.8.0 Beta
    • Network
    • None
    • e798d0b18acfb6756a614aec3e7b4bcb1ef5ff58

    Description

      When listening for new socket connections the client sockets handed out by QTcpServer will sometimes fail to be initialized.

      In file qnativesocketengine_winrt.cpp in function QNativeSocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState)

      A reference to the hr variable is passed into the lambda that is passed to runOnXamlThread. This hr variable is then redeclared a few lines down in the lambda, shadowing it. The hr variable is not initialized before the lambda, not set inside the lambda because it is shadowed, and then checked after the lambda. This is undefined behavior and will randomly succeed or fail.

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            appdynamic-asgeir Asgeir Ingvarsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes