Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 10.0.0-beta1
-
None
-
263c5e6b7 (master)
Description
In order to reproduce:
1. Create a new session
2. Create a new project (Qt Widget Application)
3. Open a contained ui file and close Creator
4. Relaunch Creator and open the session created in point 1 - crash.
Stack trace:
1 Utils::FilePath::needsDevice filepath.cpp 610 0x7ffff7a2fbf4 2 Utils::FilePath::toString filepath.cpp 232 0x7ffff7a2dc68 3 operator() resourcehandler.cpp 83 0x7fff82776a9d 4 std::_{_}invoke_impl<bool, Designer::Internal::ResourceHandler::updateResourcesHelper(bool)::<lambda(const ProjectExplorer::Node *)>&, ProjectExplorer::Node *>(std::{_}_invoke_other, struct \{...} &) invoke.h 61 0x7fff82778034 5 std::__invoke_r<bool, Designer::Internal::ResourceHandler::updateResourcesHelper(bool)::<lambda(const ProjectExplorer::Node *)>&, ProjectExplorer::Node *>(struct \{...} &) invoke.h 114 0x7fff82777bdf 6 std::_Function_handler<bool(ProjectExplorer::Node *), Designer::Internal::ResourceHandler::updateResourcesHelper(bool)::<lambda(const ProjectExplorer::Node *)>>::_M_invoke(const std::_Any_data &, ProjectExplorer::Node *&&) std_function.h 290 0x7fff82777807 7 std::function<bool (ProjectExplorer::Node *)>::operator()(ProjectExplorer::Node *) const std_function.h 590 0x7fff98a5f28d 8 ProjectExplorer::FolderNode::findNode(std::function<bool (ProjectExplorer::Node *)> const&) projectnodes.cpp 468 0x7fff98a5a47e 9 Designer::Internal::ResourceHandler::updateResourcesHelper resourcehandler.cpp 82 0x7fff82776f3b 10 Designer::Internal::ResourceHandler::updateResources resourcehandler.h 33 0x7fff8275c2d5 11 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (Designer::Internal::ResourceHandler:: *)()>::call(void (Designer::Internal::ResourceHandler:: *)(), Designer::Internal::ResourceHandler *, void * *) qobjectdefs_impl.h 135 0x7fff8275d2b7 12 QtPrivate::FunctionPointer<void (Designer::Internal::ResourceHandler:: *)()>::call<QtPrivate::List<>, void>(void (Designer::Internal::ResourceHandler:: *)(), Designer::Internal::ResourceHandler *, void * *) qobjectdefs_impl.h 172 0x7fff8275cfdd 13 QtPrivate::QSlotObject<void (Designer::Internal::ResourceHandler:: *)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobjectdefs_impl.h 383 0x7fff8275ce69 14 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 363 0x7ffff52a68c3 15 doActivate<false> qobject.cpp 3979 0x7ffff5321a9c 16 QMetaObject::activate qobject.cpp 4039 0x7ffff5317e73 17 Core::IDocument::filePathChanged moc_idocument.cpp 275 0x7fff990f1bae 18 Core::IDocument::setFilePath idocument.cpp 685 0x7fff993aedfc 19 Designer::Internal::FormWindowFile::setFilePath formwindowfile.cpp 159 0x7fff8275ba78 20 Designer::Internal::FormWindowFile::open formwindowfile.cpp 78 0x7fff8275b3ec 21 Core::Internal::EditorManagerPrivate::openEditor editormanager.cpp 851 0x7fff99278c29 22 Core::Internal::SplitterOrView::restoreState editorview.cpp 940 0x7fff992c1bdb 23 Core::EditorManager::restoreState editormanager.cpp 3632 0x7fff99287cc5 24 ProjectExplorer::SessionManagerPrivate::restoreEditors session.cpp 976 0x7fff98b1b16c 25 ProjectExplorer::SessionManager::loadSession session.cpp 1132 0x7fff98b1c02c 26 ProjectExplorer::Internal::SessionModel::switchToSession sessionmodel.cpp 243 0x7fff98b394a9 27 ProjectExplorer::Internal::SessionDelegate::editorEvent projectwelcomepage.cpp 409 0x7fff98a91415 28 QAbstractItemViewPrivate::sendDelegateEvent qabstractitemview.cpp 4564 0x7ffff71c4085 29 QAbstractItemView::edit qabstractitemview.cpp 2747 0x7ffff71bc44e 30 QAbstractItemView::mouseReleaseEvent qabstractitemview.cpp 1944 0x7ffff71b8c7b 31 QTreeView::mouseReleaseEvent qtreeview.cpp 1927 0x7ffff7286506 32 QWidget::event qwidget.cpp 8848 0x7ffff6dddfb0 33 QFrame::event qframe.cpp 515 0x7ffff6ee2de1 34 QAbstractScrollArea::viewportEvent qabstractscrollarea.cpp 1063 0x7ffff6eddd1c 35 QAbstractItemView::viewportEvent qabstractitemview.cpp 1766 0x7ffff71b7a39 36 QTreeView::viewportEvent qtreeview.cpp 1295 0x7ffff7282db9 37 QAbstractScrollAreaPrivate::viewportEvent qabstractscrollarea_p.h 74 0x7ffff6edf46d 38 QAbstractScrollAreaFilter::eventFilter qabstractscrollarea_p.h 85 0x7ffff6edf566 39 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp 1158 0x7ffff52858e0 40 QApplicationPrivate::notify_helper qapplication.cpp 3309 0x7ffff6d4df48 41 QApplication::notify qapplication.cpp 2803 0x7ffff6d4bbcb 42 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1026 0x7ffff52853e5 43 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1456 0x7ffff5286013 44 QApplicationPrivate::sendMouseEvent qapplication.cpp 2387 0x7ffff6d4a676 45 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 623 0x7ffff6e121c2 46 QWidgetWindow::event qwidgetwindow.cpp 241 0x7ffff6e10605 47 QApplicationPrivate::notify_helper qapplication.cpp 3315 0x7ffff6d4df74 48 QApplication::notify qapplication.cpp 3266 0x7ffff6d4dd66 49 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1026 0x7ffff52853e5 50 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1456 0x7ffff5286013 51 QGuiApplicationPrivate::processMouseEvent qguiapplication.cpp 2249 0x7ffff5ecf0f0 52 QGuiApplicationPrivate::processWindowSystemEvent qguiapplication.cpp 1998 0x7ffff5ece3e0 53 QWindowSystemInterface::sendWindowSystemEvents qwindowsysteminterface.cpp 1103 0x7ffff5f7d50a 54 xcbSourceDispatch qxcbeventdispatcher.cpp 57 0x7ffff0f943ee 55 g_main_context_dispatch 0x7ffff3be2d3b 56 ?? 0x7ffff3c376c8 57 g_main_context_iteration 0x7ffff3be03e3 58 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 393 0x7ffff56c1782 59 QXcbGlibEventDispatcher::processEvents qxcbeventdispatcher.cpp 96 0x7ffff0f9464c 60 QEventLoop::processEvents qeventloop.cpp 100 0x7ffff5299745 61 QEventLoop::exec qeventloop.cpp 182 0x7ffff5299ab4 62 QCoreApplication::exec qcoreapplication.cpp 1347 0x7ffff5285d50 63 QGuiApplication::exec qguiapplication.cpp 1859 0x7ffff5ecdcea 64 QApplication::exec qapplication.cpp 2595 0x7ffff6d4af7d 65 main main.cpp 794 0x5555555639d0
Frame #9, (inside ResourceHandler::updateResourcesHelper): project->rootProjectNode() returns null here:
// Find the (sub-)project the file belongs to. We don't want to find resources // from other parts of the project tree, e.g. via a qmake subdirs project. Node * const fileNode = project->rootProjectNode()->findNode([&fileName](const Node *n) { return n->filePath().toString() == fileName; });
Before the 22da0f2fd660ebd916a140d1d3a64632bca7cc35 change, the
Project *project = SessionManager::projectForFile(Utils::FilePath::fromUserInput(fileName));
returned nullptr, now it returns non-nullptr for which project->rootProjectNode() returns null.