<table><tr><td style="">jtamate added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12371">View Revision</a></tr></table><br /><div><div><p>More investigation, in bold what causes the problem.</p>

<p>moveListersWithoutCachedItemsJob append  KDirLister(0x3b510c70) to holders for url= QUrl("file:///virtual/kde5/5kde/build/frameworks/kio")<br />
forgetDirs removeAll in directoryData[ "file:///virtual/kde5/5kde/build/frameworks/kio" ] for KDirLister(0x3b510c70)<br />
moveListersWithoutCachedItemsJob append  KDirLister(0x3b510c70) to holders for url= QUrl("remote:/")<br />
forgetDirs removeAll in directoryData[ "remote:/" ] for KDirLister(0x3b510c70)<br />
<strong>forgetDirs not found: "smb://" in directoryData for KDirLister(0x3b510c70) </strong><br />
moveListersWithoutCachedItemsJob append  KDirLister(0x3b510c70) to holders for url= QUrl("smb:///")<br />
<strong>moveListersWithoutCachedItemsJob append  KDirLister(0x3b510c70) to holders for url= QUrl("smb://") </strong><br />
forgetDirs removeAll in directoryData[ "smb:///" ] for KDirLister(0x3b510c70)<br />
moveListersWithoutCachedItemsJob append  KDirLister(0x3b510c70) to holders for url= QUrl("smb://127.0.0.1/")<br />
forgetDirs removeAll in directoryData[ "smb://127.0.0.1/" ] for KDirLister(0x3b510c70)<br />
moveListersWithoutCachedItemsJob append  KDirLister(0x3b510c70) to holders for url= QUrl("smb://127.0.0.1/kk")<br />
forgetDirs removeAll in directoryData[ "smb://127.0.0.1/kk" ] for KCoreDirLister(0x3b510c70)<br />
forgetCachedItemsJob append  KDirLister(0x4e273400) to holders for url= QUrl("smb://127.0.0.1/kk")<br />
forgetDirs removeAll in directoryData[ "smb://127.0.0.1/kk" ] for KDirLister(0x4e273400)<br />
forgetCachedItemsJob append  KDirLister(0x4e273400) to holders for url= QUrl("file:///virtual/kde5/5kde/build/frameworks/kio")<br />
forgetDirs removeAll in directoryData[ "file:///virtual/kde5/5kde/build/frameworks/kio" ] for KDirLister(0x4e273400)<br />
moveListersWithoutCachedItemsJob append  KDirLister(0x4e273400) to holders for url= QUrl("smb://127.0.0.1/kk")<br />
forgetDirs removeAll in directoryData[ "smb://127.0.0.1/kk" ] for KDirLister(0x4e273400)<br />
forgetCachedItemsJob append  KDirLister(0x4e273400) to holders for url= QUrl("file:///virtual/kde5/5kde/build/frameworks/kio")<br />
forgetDirs removeAll in directoryData[ "file:///virtual/kde5/5kde/build/frameworks/kio" ] for KDirLister(0x4e273400)<br />
forgetCachedItemsJob append  KDirLister(0x4e273400) to holders for url= QUrl("file:///virtual/kde5/5kde/build/frameworks/kio")<br />
forgetDirs removeAll in directoryData[ "file:///virtual/kde5/5kde/build/frameworks/kio" ] for KDirLister(0x4e273400)<br />
forgetCachedItemsJob append  KDirLister(0x4e273400) to holders for url= QUrl("remote:/")<br />
forgetDirs removeAll in directoryData[ "remote:/" ] for KDirLister(0x4e273400)<br />
forgetDirs removeAll in directoryData[ "smb://" ] for KDirLister(0x4e273400)<br />
<strong>number of holders for  "smb://" 1</strong></p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">==23870== Invalid read of size 8
==23870==    at 0x5F41167: KCoreDirListerCache::slotRedirection(KIO::Job*, QUrl const&) (kcoredirlister.cpp:1484)
==23870==    by 0x5F4A3A9: call (qobjectdefs_impl.h:136)
==23870==    by 0x5F4A3A9: call<QtPrivate::List<KIO::Job*, const QUrl&>, void> (qobjectdefs_impl.h:169)
==23870==    by 0x5F4A3A9: QtPrivate::QSlotObject<void (KCoreDirListerCache::*)(KIO::Job*, QUrl const&), QtPrivate::List<KIO::Job*, QUrl const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:398)
==23870==    by 0xA0F736B: call (qobjectdefs_impl.h:378)
==23870==    by 0xA0F736B: QMetaObject::activate(QObject*, int, int, void**) (qobject.cpp:3749)
==23870==    by 0x5EED068: KIO::ListJob::redirection(KIO::Job*, QUrl const&) (moc_listjob.cpp:246)
==23870==    by 0x5EED481: KIO::ListJobPrivate::slotRedirection(QUrl const&) (listjob.cpp:222)
==23870==    by 0x5EED4C1: operator() (listjob.cpp:294)
==23870==    by 0x5EED4C1: call (qobjectdefs_impl.h:130)
==23870==    by 0x5EED4C1: call<QtPrivate::List<const QUrl&>, void> (qobjectdefs_impl.h:240)
==23870==    by 0x5EED4C1: QtPrivate::QFunctorSlotObject<KIO::ListJobPrivate::start(KIO::Slave*)::{lambda(QUrl const&)#4}, 1, QtPrivate::List<QUrl const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:423)
==23870==    by 0xA0F736B: call (qobjectdefs_impl.h:378)
==23870==    by 0xA0F736B: QMetaObject::activate(QObject*, int, int, void**) (qobject.cpp:3749)
==23870==    by 0x5ED159A: KIO::SlaveInterface::redirection(QUrl const&) (moc_slaveinterface.cpp:518)
==23870==    by 0x5ED3B39: KIO::SlaveInterface::dispatch(int, QByteArray const&) (slaveinterface.cpp:248)
==23870==    by 0x5ED16F5: KIO::SlaveInterface::dispatch() (slaveinterface.cpp:89)
==23870==    by 0x5ED64A6: KIO::Slave::gotInput() (slave.cpp:406)
==23870==    by 0x5F660AB: KIO::Slave::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_slave.cpp:89)
==23870==  Address 0x3b510c70 is 0 bytes inside a block of size 32 free'd
==23870==    at 0x4C2F7BB: operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23870==    by 0x5BD45B6: KDirLister::~KDirLister() (kdirlister.cpp:55)
==23870==    by 0xA0F503A: QObjectPrivate::deleteChildren() (qobject.cpp:1992)
==23870==    by 0xA0FE38A: QObject::~QObject() (qobject.cpp:1022)
==23870==    by 0x5BD6E68: KDirModel::~KDirModel() (kdirmodel.cpp:394)
==23870==    by 0x5BD6E78: KDirModel::~KDirModel() (kdirmodel.cpp:397)
==23870==    by 0x210252F9: ??? (in /usr/lib64/libKF5KIOFileWidgets.so.5.44.0)
==23870==    by 0x21025492: KDirOperator::~KDirOperator() (in /usr/lib64/libKF5KIOFileWidgets.so.5.44.0)
==23870==    by 0x210254C8: KDirOperator::~KDirOperator() (in /usr/lib64/libKF5KIOFileWidgets.so.5.44.0)
==23870==    by 0x2103C33B: KFileWidget::~KFileWidget() (in /usr/lib64/libKF5KIOFileWidgets.so.5.44.0)
==23870==    by 0x2103C4B8: KFileWidget::~KFileWidget() (in /usr/lib64/libKF5KIOFileWidgets.so.5.44.0)
==23870==    by 0xA0F503A: QObjectPrivate::deleteChildren() (qobject.cpp:1992)
==23870==  Block was alloc'd at
==23870==    at 0x4C2E6FF: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23870==    by 0x21028589: KDirOperator::KDirOperator(QUrl const&, QWidget*) (in /usr/lib64/libKF5KIOFileWidgets.so.5.44.0)
==23870==    by 0x2103EB77: KFileWidget::KFileWidget(QUrl const&, QWidget*) (in /usr/lib64/libKF5KIOFileWidgets.so.5.44.0)
==23870==    by 0x20B722CD: ??? (in /usr/lib64/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so)
==23870==    by 0x20B728A4: ??? (in /usr/lib64/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so)
==23870==    by 0x20B67609: ??? (in /usr/lib64/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so)
==23870==    by 0x8F06654: QDialogPrivate::platformHelper() const (qdialog.cpp:122)
==23870==    by 0x8F1755A: platformFileDialogHelper (qfiledialog_p.h:122)
==23870==    by 0x8F1755A: QFileDialogPrivate::init(QUrl const&, QString const&, QString const&) (qfiledialog.cpp:2826)
==23870==    by 0x8F17995: QFileDialog::QFileDialog(QFileDialogArgs const&) (qfiledialog.cpp:373)
==23870==    by 0x8F18311: QFileDialog::getSaveFileUrl(QWidget*, QString const&, QUrl const&, QString const&, QString*, QFlags<QFileDialog::Option>, QStringList const&) (qfiledialog.cpp:2413)
==23870==    by 0x4F5877E: KTextEditor::DocumentPrivate::documentSaveAs() (katedocument.cpp:4314)
==23870==    by 0x50F868D: KTextEditor::DocumentPrivate::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_katedocument.cpp:514)
==23870== 
KCrash: crashing... crashRecursionCounter = 2</pre></div>



<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>So while I don't deny that we might have designed this wrongly (and if we did, it's probably my fault), the right solution is to design this correctly, not to sprinkle qpointers.</p></blockquote>

<p>It is well designed. But I'll include some comments, just in case someone else gets lost in the forest as I did.</p>

<p>The problem seems to be in moveListersWithoutCachedItemsJob or in forgetDirs.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12371">https://phabricator.kde.org/D12371</a></div></div><br /><div><strong>To: </strong>jtamate, dfaure, Frameworks, apol<br /><strong>Cc: </strong>apol, michaelh, bruns<br /></div>