D10045: Don't assert on empty names
mwolff added inline comments. INLINE COMMENTS > remoteimpl.cpp:56 > > -const QStringList filenames = dir.entryList(QDir::Files | > QDir::Readable); > +const QStringList filenames = > dir.entryList({QStringLiteral("*.desktop")}, > +QDir::Files | > QDir::Readable); is this OK? or are there other entries that should be shown under remote:/ ? REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: dhaumann, #frameworks, michaelh
D10045: Don't assert on empty names
mwolff updated this revision to Diff 26203. mwolff added a comment. filter out empty entries from remote:/ KIO slave REPOSITORY R241 KIO CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10045?vs=25808=26203 BRANCH master REVISION DETAIL https://phabricator.kde.org/D10045 AFFECTED FILES src/ioslaves/remote/remoteimpl.cpp src/ioslaves/remote/remoteimpl.h To: mwolff, dfaure Cc: dhaumann, #frameworks, michaelh
D10045: Don't assert on empty names
mwolff added a comment. OK, that's not enough. It seems like the file can sometimes be read while it's still empty: 7.098 debug: RemoteImpl::createEntry[/home/milian/projects/kf5/src/frameworks/kio/src/ioslaves/remote/remoteimpl.cpp:188]: UDS_NAME "" from "/home/milian/.local/share/remoteview/asdfasdf.desktop" 7.098 fatal: unknown[/home/milian/projects/kf5/src/frameworks/kio/src/ioslaves/remote/remoteimpl.cpp:189]: ASSERT: "!desktop.readName().isEmpty()" in file /home/milian/projects/kf5/src/frameworks/kio/src/ioslaves/remote/remoteimpl.cpp, line 189 REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: dhaumann, #frameworks, michaelh
D10045: Don't assert on empty names
mwolff added a comment. 41.919 warning: KConfigIniBackend::parseConfig[/home/milian/projects/kf5/src/frameworks/kconfig/src/core/kconfigini.cpp:253]: "KConfigIni: In file /home/milian/.local/share/remoteview/yxcvyxcv.desktop.lock, line 1: " Invalid entry (missing '=') 41.919 warning: KConfigIniBackend::parseConfig[/home/milian/projects/kf5/src/frameworks/kconfig/src/core/kconfigini.cpp:253]: "KConfigIni: In file /home/milian/.local/share/remoteview/yxcvyxcv.desktop.lock, line 2: " Invalid entry (missing '=') 41.919 warning: KConfigIniBackend::parseConfig[/home/milian/projects/kf5/src/frameworks/kconfig/src/core/kconfigini.cpp:253]: "KConfigIni: In file /home/milian/.local/share/remoteview/yxcvyxcv.desktop.lock, line 3: " Invalid entry (missing '=') 41.919 debug: RemoteImpl::createEntry[/home/milian/projects/kf5/src/frameworks/kio/src/ioslaves/remote/remoteimpl.cpp:187]: UDS_NAME "" from "/home/milian/.local/share/remoteview/yxcvyxcv.desktop.lock" 41.919 fatal: unknown[/home/milian/projects/kf5/src/frameworks/kio/src/ioslaves/remote/remoteimpl.cpp:188]: ASSERT: "!desktop.readName().isEmpty()" in file /home/milian/projects/kf5/src/frameworks/kio/src/ioslaves/remote/remoteimpl.cpp, line 188 ahum... ;-) I'll see to find a way to skip these files REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: dhaumann, #frameworks, michaelh
D10045: Don't assert on empty names
dfaure added a comment. See https://phabricator.kde.org/D10172 for the fix for the first usability issue. However I can't reproduce the assert... Can you add this to your kio_remote to find out more? There must be one strange .desktop file around somewhere. diff --git a/src/ioslaves/remote/remoteimpl.cpp b/src/ioslaves/remote/remoteimpl.cpp index 6d01cc8cf7..3376d619b9 100644 --- a/src/ioslaves/remote/remoteimpl.cpp +++ b/src/ioslaves/remote/remoteimpl.cpp @@ -184,6 +184,8 @@ void RemoteImpl::createEntry(KIO::UDSEntry , const QString , QString new_filename = file; new_filename.truncate(file.length()-8); +qDebug() << "UDS_NAME" << desktop.readName() << "from" << (dir+file); +Q_ASSERT(!desktop.readName().isEmpty()); entry.insert(KIO::UDSEntry::UDS_NAME, desktop.readName()); entry.insert(KIO::UDSEntry::UDS_URL, "remote:/"+new_filename); REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: dhaumann, #frameworks, michaelh
D10045: Don't assert on empty names
mwolff added a comment. In https://phabricator.kde.org/D10045#195097, @dfaure wrote: > Good point, done. I did the following: - in Dolphin, go to remote:/ - add network folder - allow execution of this script (separate usability issue) - webdav, then fill out the form for our KDAB owncloud instance, i.e. with host = swanson and folder == /owncloud/remote.php/webdav - then save and connect, you'll see a strange warning dialog with this info: "You are about to log in to the site "swanson.kdab.com" with the username "milian", but the website does not require authentication. This may be an attempt to trick you. Is "swanson.kdab.com" the site you want to visit?" imo this is again a usability issue, but unrelated I guess? Anyhow, accept it and dolphin crashes with the assertion REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: dhaumann, #frameworks
D10045: Don't assert on empty names
dfaure added a comment. Good point, done. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: dhaumann, #frameworks
D10045: Don't assert on empty names
dhaumann added a comment. @dfaure It seems to me there is some know-how in your head that you should add as comment to the ASSERT then ;) REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: dhaumann, #frameworks
D10045: Don't assert on empty names
dfaure added a comment. That assert is there to catch a horrible bug in the kioslave. UDS_NAME is NOT supposed to be empty, ever. Which kioslave was this about? REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D10045 To: mwolff, dfaure Cc: #frameworks
D10045: Don't assert on empty names
mwolff created this revision. mwolff added a reviewer: dfaure. Restricted Application added a project: Frameworks. Restricted Application added a subscriber: Frameworks. mwolff requested review of this revision. REVISION SUMMARY This removes an assertion I just hit. Note how the code below checks for the empty name and just skips the entry. Thread 1 (Thread 0x7f194a2fb4c0 (LWP 10953)): [KCrash Handler] #6 0x7f195a064860 in raise () from /usr/lib/libc.so.6 #7 0x7f195a065ec9 in abort () from /usr/lib/libc.so.6 #8 0x7f19570678c8 in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5 #9 0x7f19570624a7 in qt_assert(char const*, char const*, int) () from /usr/lib/libQt5Core.so.5 #10 0x7f19598dc55f in KCoreDirListerCache::slotUpdateResult (this=0x7f1959998500 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, j=0x56549d5cfc60) at /home/milian/projects/kf5/src/frameworks/kio/src/core/kcoredirlister.cpp:1799 #11 0x7f19598e49b5 in KCoreDirListerCache::qt_static_metacall (_o=0x7f1959998500 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7fffa67266f0) at /home/milian/projects/kf5/build-dbg/frameworks/kio/src/core/KF5KIOCore_autogen/include/moc_kcoredirlister_p.cpp:139 #12 0x7f195729aee6 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5 #13 0x7f1958c56ada in KJob::result (this=0x56549d5cfc60, _t1=0x56549d5cfc60, _t2=...) at /ssd/milian/projects/kf5/build-dbg/frameworks/kcoreaddons/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:569 #14 0x7f1958c549df in KJob::finishJob (this=0x56549d5cfc60, emitResult=true) at /home/milian/projects/kf5/src/frameworks/kcoreaddons/src/lib/jobs/kjob.cpp:109 #15 0x7f1958c55141 in KJob::emitResult (this=0x56549d5cfc60) at /home/milian/projects/kf5/src/frameworks/kcoreaddons/src/lib/jobs/kjob.cpp:293 #16 0x7f195988c826 in KIO::SimpleJob::slotFinished (this=0x56549d5cfc60) at /home/milian/projects/kf5/src/frameworks/kio/src/core/simplejob.cpp:236 #17 0x7f19598869b4 in KIO::ListJob::slotFinished (this=0x56549d5cfc60) at /home/milian/projects/kf5/src/frameworks/kio/src/core/listjob.cpp:246 #18 0x7f1959886f97 in KIO::ListJob::qt_static_metacall (_o=0x56549d5cfc60, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffa6726a10) at /home/milian/projects/kf5/build-dbg/frameworks/kio/src/core/KF5KIOCore_autogen/include/moc_listjob.cpp:129 #19 0x7f195729aee6 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5 #20 0x7f195987231f in KIO::SlaveInterface::finished (this=0x56549d3c24b0) at /home/milian/projects/kf5/build-dbg/frameworks/kio/src/core/KF5KIOCore_autogen/include/moc_slaveinterface.cpp:437 #21 0x7f195986fe3d in KIO::SlaveInterface::dispatch (this=0x56549d3c24b0, _cmd=104, rawdata=...) at /home/milian/projects/kf5/src/frameworks/kio/src/core/slaveinterface.cpp:160 #22 0x7f195986fa6a in KIO::SlaveInterface::dispatch (this=0x56549d3c24b0) at /home/milian/projects/kf5/src/frameworks/kio/src/core/slaveinterface.cpp:89 #23 0x7f19598746eb in KIO::Slave::gotInput (this=0x56549d3c24b0) at /home/milian/projects/kf5/src/frameworks/kio/src/core/slave.cpp:406 #24 0x7f195991088d in KIO::Slave::qt_static_metacall (_o=0x56549d3c24b0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffa6726d10) at /home/milian/projects/kf5/build-dbg/frameworks/kio/src/core/KF5KIOCore_autogen/EWIEGA46WW/moc_slave.cpp:89 #25 0x7f195729aee6 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5 #26 0x7f19598135e3 in KIO::Connection::readyRead (this=0x56549d4620b0) at /home/milian/projects/kf5/build-dbg/frameworks/kio/src/core/KF5KIOCore_autogen/include/moc_connection_p.cpp:143 #27 0x7f19598122e5 in KIO::ConnectionPrivate::dequeue (this=0x56549d63f1d0) at /home/milian/projects/kf5/src/frameworks/kio/src/core/connection.cpp:46 #28 0x7f19598133f4 in KIO::Connection::qt_static_metacall (_o=0x56549d4620b0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x56549d4e6fa0) at /home/milian/projects/kf5/build-dbg/frameworks/kio/src/core/KF5KIOCore_autogen/include/moc_connection_p.cpp:87 #29 0x7f195729b932 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5 #30 0x7f195826ee3c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5 #31 0x7f1958276816 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5 #32 0x7f195726a6c0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5 #33 0x7f195726d326 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5 #34 0x7f19572c7584 in ?? () from /usr/lib/libQt5Core.so.5 #35 0x7f19502eee38 in