Details
Description
All of the tests in qtbase that include tests/auto/network-settings.h outputs the following warning before the beginning of the normal test output:
QObject::connect: Cannot connect (null)::destroyed() to QHostInfoLookupManager::waitForThreadPoolDone()
This is caused by the second last line of qtbase/tests/auto/network-settings.h, which indirectly causes the Q_GLOBAL_STATIC QHostInfoLookupManager to be created before a QCoreApplication object exists (see following backtrace).
user@host:~/build/qt5/qtbase/tests/auto/network/kernel/qhostinfo$ gdb ./tst_qhostinfo GNU gdb (GDB) 7.1-ubuntu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/user/build/qt5/qtbase/tests/auto/network/kernel/qhostinfo/tst_qhostinfo...done. (gdb) break QHostInfoLookupManager::QHostInfoLookupManager() Function "QHostInfoLookupManager::QHostInfoLookupManager()" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (QHostInfoLookupManager::QHostInfoLookupManager()) pending. (gdb) run Starting program: /home/user/build/qt5/qtbase/tests/auto/network/kernel/qhostinfo/tst_qhostinfo [Thread debugging using libthread_db enabled] Breakpoint 1, QHostInfoLookupManager (this=0x805a920) at /home/user/depot/qt5-test/qtbase/src/network/kernel/qhostinfo.cpp:498 498 QHostInfoLookupManager::QHostInfoLookupManager() : mutex(QMutex::Recursive), wasDeleted(false) (gdb) bt #0 QHostInfoLookupManager (this=0x805a920) at /home/user/depot/qt5-test/qtbase/src/network/kernel/qhostinfo.cpp:498 #1 0xb7ee2d10 in theHostInfoLookupManager () at /home/user/depot/qt5-test/qtbase/src/network/kernel/qhostinfo.cpp:62 #2 0xb7ee3228 in QHostInfo::fromName (name=...) at /home/user/depot/qt5-test/qtbase/src/network/kernel/qhostinfo.cpp:232 #3 0x08050aaa in QtNetworkSettingsInitializerCode (this=0x8058320) at /home/user/depot/qt5-test/qtbase/tests/auto/network/kernel/qhostinfo/../../../network-settings.h:152 #4 0x0804fce8 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /home/user/depot/qt5-test/qtbase/tests/auto/network/kernel/qhostinfo/../../../network-settings.h:161 #5 0x0804fd04 in global constructors keyed to qtNetworkSettingsInitializer () at .moc/debug-shared/tst_qhostinfo.moc:461 #6 0x08052a6d in __do_global_ctors_aux () #7 0x0804a910 in _init () #8 0x08052a09 in __libc_csu_init () #9 0xb7764b74 in __libc_start_main (main=0x804f238 <main>, argc=1, ubp_av=0xbffff5a4, init=0x80529f0 <__libc_csu_init>, fini=0x80529e0 <__libc_csu_fini>, rtld_fini=0xb7ff1030 <_dl_fini>, stack_end=0xbffff59c) at libc-start.c:185 #10 0x0804b191 in _start () (gdb)