Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.1
-
None
-
4070bb1daafafabebb3c893a472a22fab413e4de
Description
QFSEventsFileSystemWatcherEngine::addPaths is waiting for the worker thread to start, but it's nowhere to be seen.
This could be related to starting and stopping the worker thread. addPaths calls QThread::start() at some point, but if the thread is
already started and about to exit then nothing will happen.
One possible solution is to rewrite using a QThreadPool with one worker thread, and then create a QRunnable subclass
that does the worker thread tasks.
Sampling process 56983 for 3 seconds with 1 millisecond of run time between samples Sampling completed, processing symbols... Analysis of sampling Qt Creator (pid 56983) every 1 millisecond Call graph: 2306 Thread_3027531 DispatchQueue_1: com.apple.main-thread (serial) 2306 start 2306 main 2306 QCoreApplication::exec() 2306 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 2306 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 2306 QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 2306 -[NSApplication run] 2306 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] 2306 _DPSNextEvent 2306 BlockUntilNextEventMatchingListInMode 2306 ReceiveNextEventCommon 2306 RunCurrentEventLoopInMode 2306 CFRunLoopRunSpecific 2306 __CFRunLoopRun 2306 __CFMessagePortPerform 2306 CoreDragMessageHandler 2306 DoDropMessage 2306 NSCoreDragReceiveProc 2306 -[QCocoaWindow performDragOperation:] 2306 -[QCocoaView performDragOperation:] 2306 QCoreApplication::notifyInternal(QObject*, QEvent*) 2306 QApplication::notify(QObject*, QEvent*) 2306 QApplicationPrivate::notify_helper(QObject*, QEvent*) 2306 QMainWindow::event(QEvent*) 2306 QWidget::event(QEvent*) 2306 Core::Internal::MainWindow::dropEvent(QDropEvent*) 2306 Core::Internal::MainWindow::openFiles(QStringList const&) 2306 ProjectExplorer::Internal::ProjectFileFactory::open(QString const&) 2306 ProjectExplorer::ProjectExplorerPlugin::openProject(QString const&) 2306 ProjectExplorer::ProjectExplorerPlugin::openProjects(QStringList const&) 2306 ProjectExplorer::Project::restoreSettings() 2306 Qt4ProjectManager::Qt4Project::fromMap(QMap<QString, QVariant> const&) 2306 Qt4ProjectManager::Qt4Project::update() 2306 Qt4ProjectManager::Internal::Qt4ProFileNode::update() 2306 Qt4ProjectManager::Internal::Qt4PriFileNode::Qt4PriFileNode(Qt4ProjectManager::Qt4Project*, Qt4ProjectManager::Internal::Qt4ProFileNode*, QString const&) 2306 Core::FileManager::addFile(Core::IFile*) 2306 Core::FileManager::addFiles(QList<Core::IFile*> const&) 2306 Core::FileManager::addFileInfo(Core::IFile*) 2306 QFileSystemWatcher::addPath(QString const&) 2306 QFileSystemWatcher::addPaths(QStringList const&) 2306 QFSEventsFileSystemWatcherEngine::addPaths(QStringList const&, QStringList*, QStringList*) 2306 QWaitCondition::wait(QMutex*, unsigned long) 2306 _pthread_cond_wait 2306 __semwait_signal 2306 Thread_3027533 DispatchQueue_2: com.apple.libdispatch-manager (serial) 2306 start_wqthread 2306 _pthread_wqthread 2306 _dispatch_worker_thread2 2306 _dispatch_queue_invoke 2306 _dispatch_mgr_invoke 2306 kevent 2306 Thread_3027542 2306 thread_start 2306 _pthread_start 2306 __CFSocketManager 2306 select$DARWIN_EXTSN 2306 Thread_3027544 2306 thread_start 2306 _pthread_start 2306 ne7ssh::selectThread(void*) 2285 usleep 2280 nanosleep 2277 __semwait_signal 3 nanosleep 5 cerror 3 cthread_set_errno_self 2 cerror 9 __bzero 5 ne7ssh::selectThread(void*) 4 ne7ssh::unlock() 2 Ne7ssh_Mutex::unlock() 2 pthread_mutex_unlock 1 ne7ssh::isSelectActive() 1 ne7ssh::unlock() 2 ne7ssh::lock() 1 ne7ssh::getConnetions() 2306 Thread_3027545 2306 thread_start 2306 _pthread_start 2306 QThreadPrivate::start(void*) 2306 QProcessManager::run() 2306 select$DARWIN_EXTSN 2306 Thread_3027548 2306 thread_start 2306 _pthread_start 2306 QTWTF::TCMalloc_PageHeap::runScavengerThread(void*) 2306 QTWTF::TCMalloc_PageHeap::scavengerThread() 2306 _pthread_cond_wait 2306 __semwait_signal 2306 Thread_3027549 2306 thread_start 2306 _pthread_start 2306 WTF::TCMalloc_PageHeap::runScavengerThread(void*) 2306 WTF::TCMalloc_PageHeap::scavengerThread() 2306 _pthread_cond_wait 2306 __semwait_signal 2306 Thread_3027732 2306 thread_start 2306 _pthread_start 2306 QThreadPrivate::start(void*) 2306 CppEditor::Internal::SemanticHighlighter::run() 2306 QWaitCondition::wait(QMutex*, unsigned long) 2306 _pthread_cond_wait 2306 __semwait_signal Total number in stack (recursive counted multiple, when >=5): 6 _pthread_start 6 thread_start 5 __semwait_signal Sort by top of stack, same collapsed (when >= 5): __semwait_signal 11501 select$DARWIN_EXTSN 4612 kevent 2306 __bzero 9 ne7ssh::selectThread(void*) 5 Sample analysis of process 56983 written to file /dev/stdout