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

Hang in QHostInfo prevents exit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P0: Blocker P0: Blocker
    • 4.6.0
    • 4.6.0
    • Core: Threads, Network
    • None
    • 135710b1fa38f72a934c542d196af9eff066d908

      Qt hangs forever if host lookup is pending when application quits.

      Tested on Linux.

      #include <QApplication>
      #include <QHostInfo>
      int main(int argc, char ** argv)
      {
          QApplication app(argc,argv);
          QHostInfo::lookupHost("qt.nokia.com",0,0);
          usleep(10000);
      }
      

      The usleep needs to be long enough for QHostInfoAgent::fromName to have started, but not returned. Too small, and it doesn't start, too long and it returns. Values from 500 to 500000 work for me though, so it's not very sensitive (will depend on DNS of course).

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

            phartman Peter Hartmann (closed Nokia identity) (Inactive)
            wallison Warwick Allison (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes