Version: (using Devel) Installed from: Compiled sources OS: Linux Hi! I am a Krusader developer and I get into a bug in dolphinpart. Situation: - the user tries to view a directory with Krusader's viewer - Krusader searches the default service for showing directories KService::Ptr ptr = KMimeTypeTrader::self()->preferredService( mimetype, "KParts/ReadOnlyPart" ); - it's dolphinpart The crash: ==14047== ==14047== Invalid read of size 4 ==14047== at 0x5501E96: QWidget::window() const (in /usr/lib/libQtGui.so.4.4.0) ==14047== by 0x758B745: (within /usr/lib/kde4/dolphinpart.so) ==14047== by 0x758C911: QObject* KPluginFactory::createPartInstance<DolphinPart>(QWidget*, QObject*, QList<QVariant> const&) (in /usr/lib/kde4/dolphinpart.so) ==14047== by 0x41F6966: KPluginFactory::create(char const*, QWidget*, QObject*, QList<QVariant> const&, QString const&) (in /usr/lib/libkdecore.so.5.1.0) ==14047== by 0x81FE2E6: PanelViewer::getPart(QString) (kpluginfactory.h:342) ==14047== by 0x81FF12A: PanelViewer::openUrl(KUrl const&, KrViewer::Mode) (panelviewer.cpp:69) ==14047== by 0x80E058D: PanelPopup::update(KUrl) (panelpopup.cpp:532) ==14047== by 0x80E0F79: PanelPopup::tabSelected(int) (panelpopup.cpp:505) ==14047== by 0x80E1278: PanelPopup::qt_metacall(QMetaObject::Call, int, void**) (panelpopup.moc:88) ==14047== by 0x4F684C9: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/libQtCore.so.4.4.0) ==14047== by 0x4F68A41: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (in /usr/lib/libQtCore.so.4.4.0) ==14047== by 0x5A25022: QButtonGroup::buttonClicked(int) (in /usr/lib/libQtGui.so.4.4.0) ==14047== Address 0x4 is not stack'd, malloc'd or (recently) free'd
I've set David Faure to CC...
Can you still reproduce this bug with a recent KDE (4.1.4 / 4.2beta2 / 4.2rc1 / 4.2svn / 4.3svn) ? Thanks :)
I see, you're passing a null parent widget, and dolphinpart does parentWidget->window(). I'll fix this in dolphinpart, but I would suggest passing a parent widget anyway (well unless you put it into a layout later on, like Qt4 examples do...)
SVN commit 916972 by dfaure: Don't crash if parentWidget is 0 (even though I don't recommend setting it to 0, the dirlister mainwindow won't be set if you reparent the widget later on) BUG: 161681 M +3 -1 dolphinpart.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=916972