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

QLocalSocket may not return correct error code through error() function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12
    • 5.9.7
    • Network: Sockets
    • None
    • Windows
    • cbac5a1a6edfd0d7a1e351bbe50bab118d1155e5

    Description

      In Windows version of QLocalSocket (qlocalsocket_win.cpp), whenever error occurs, error is recorded by calling setErrorString(QLatin1String(...)) and GetLastError() is called in the  setErrorString() function to determine the type of the error.

      But, as QLatin1String(...) may cause system call (for memory allocation, I guess), that GetLastError() will no longer return the original error code (instead, returns ERROR_SUCCESS for the memory allocation system call).  As a result,  QLocalSocketPrivate::_q_winError() sets error = QLocalSocket::UnknownSocketError regardless of the original error type.  And, when QLocalSocket::error() is called later, I get QLocalSocket::UnknownSocketError.

      Attachments

        For Gerrit Dashboard: QTBUG-71744
        # Subject Branch Project Status CR V

        Activity

          People

            tpochep Timur Pocheptsov
            sarai Susumu Arai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes