Summary: | KOrganizerPart crashes the application when it is embedded to show an ICS file (on Krusader as example) [null QWidget::window, QWidget::topLevelWidget, KOrganizerPart, KPluginFactory::createPartInstance<KOrganizerPart>] | ||
---|---|---|---|
Product: | [Applications] korganizer | Reporter: | Ricardo <thrawnkb> |
Component: | embedded | Assignee: | Cornelius Schumacher <schumacher> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | andreas.weder, andresbajotierra, cc, g.lacava, Ingo.Haupt, jan_lepper, kdepim-bugs, mg, mmaker, mp, nick222, renda.krell, smartins, winter |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdepim/b149f5ea6568e3a0840889af705b3153c56f9452 | Version Fixed In: | 4.12 |
Sentry Crash Report: | |||
Attachments: |
this is the file that when opening, krusader crashes
diff |
Description
Ricardo
2009-08-30 18:52:31 UTC
Created attachment 36579 [details]
this is the file that when opening, krusader crashes
It used to be an ics file, but it got corrupted somehow
- Can you check if opening that file with KOrganizer directly will crash it too ? - Do you have any other non-corrupted ICS file to test in Krusader and see if it crashes ? I think the crash is more related to embbeding the KOrganizerPart into Krusader Thanks i tried with a non-corrupt ics file, and happens the same: krusader crash (with korganizer is okay) so yes, it seems to be related to using the kpart On Wed, Sep 2, 2009 at 4:37 AM, Dario Andres <andresbajotierra@gmail.com>wrote: > https://bugs.kde.org/show_bug.cgi?id=205713 > > > Dario Andres <andresbajotierra@gmail.com> changed: > > What |Removed |Added > > ---------------------------------------------------------------------------- > CC| |andresbajotierra@gmail.com > , > | |kdepim-bugs@kde.org > > > > > --- Comment #2 from Dario Andres <andresbajotierra gmail com> 2009-09-02 > 04:37:31 --- > - Can you check if opening that file with KOrganizer directly will crash it > too > ? > - Do you have any other non-corrupted ICS file to test in Krusader and see > if > it crashes ? > > I think the crash is more related to embbeding the KOrganizerPart into > Krusader > > Thanks > > -- > Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email > ------- You are receiving this mail because: ------- > You are a voter for the bug. > You reported the bug. > *** Bug 207909 has been marked as a duplicate of this bug. *** [Comment from a bug triager] From bug 245022: -- Information about the crash: Krusader crashed (reproducibly) when I attempted to F3 ~/.kde/share/apps/korganizer/std.ics. F4 was fine. From bug 253195: -- Information about the crash: When trying to view (using F3) any .vfb file Krussader always crashes. Using the default viewer. Can provide the file if needed. *** Bug 245022 has been marked as a duplicate of this bug. *** *** Bug 253195 has been marked as a duplicate of this bug. *** *** Bug 216332 has been marked as a duplicate of this bug. *** [Comment from a bug triager] Bug 216332 mentions a way to trigger the bug using the PyQt bindings. The full PyQt code is available at https://bugs.kde.org/show_bug.cgi?id=216332#c1 *** Bug 187547 has been marked as a duplicate of this bug. *** From bug 255059 (KDE SC 4.5.1): - What I was doing when the application crashed: I was browsing the events page on my last.fm profile, and wanted to import my calendar from there into Korganizer in ICS format. I clicked the link and then Open in the dialog box asking what I wanted to do with the downloaded file. After clicking Open, rekonq crashed. - Updated backtrace: [KCrash Handler] #6 parent (this=0x0) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:250 #7 parentWidget (this=0x0) at ../../include/QtGui/../../src/gui/kernel/qwidget.h:1022 #8 QWidget::window (this=0x0) at kernel/qwidget.cpp:4182 #9 0x00007f1c6827c805 in topLevelWidget (this=0x3af8e20, parentWidget=0x0, parent=0x2830c60, __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>) at /usr/include/qt4/QtGui/qwidget.h:318 #10 KOrganizerPart::KOrganizerPart (this=0x3af8e20, parentWidget=0x0, parent=0x2830c60, __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>) at ../../korganizer/korganizer_part.cpp:53 #11 0x00007f1c6827d54f in KPluginFactory::createPartInstance<KOrganizerPart> (parentWidget=0x0, parent=0x2830c60, args=...) at //usr/include/kpluginfactory.h:467 #12 0x00007f1c94da897f in KPluginFactory::create (this=0x3af58e0, iface=0x7f1c95a66f60 "KParts::ReadOnlyPart", parentWidget=<value optimized out>, parent=0x2830c60, args=..., keyword=<value optimized out>) at ../../kdecore/util/kpluginfactory.cpp:191 #13 0x00007f1c9678f6b0 in create<KParts::ReadOnlyPart> (this=<value optimized out>, _mimeType=<value optimized out>, url=<value optimized out>, argumentNames=<value optimized out>, argumentValues=<value optimized out>) at ../../kdecore/util/kpluginfactory.h:515 #14 createInstance<KParts::ReadOnlyPart> (this=<value optimized out>, _mimeType=<value optimized out>, url=<value optimized out>, argumentNames=<value optimized out>, argumentValues=<value optimized out>) at ../../kdecore/services/kservice.h:532 #15 createPartInstanceFromQuery<KParts::ReadOnlyPart> (this=<value optimized out>, _mimeType=<value optimized out>, url=<value optimized out>, argumentNames=<value optimized out>, argumentValues=<value optimized out>) at ../../kdecore/services/kmimetypetrader.h:128 #16 KWebPluginFactory::create (this=<value optimized out>, _mimeType=<value optimized out>, url=<value optimized out>, argumentNames=<value optimized out>, argumentValues=<value optimized out>) at ../../kdewebkit/kwebpluginfactory.cpp:133 ... *** Bug 255059 has been marked as a duplicate of this bug. *** I cannot confirm this in KDE 4.6.2 and Krusader 2.3.0/git - do anybody still see this in latest versions? (In reply to comment #13) > I cannot confirm this in KDE 4.6.2 and Krusader 2.3.0/git - do anybody still > see this in latest versions? Good to hear. Please reopen if it still happens. I still see the crash on ics files in KDE 4.7.4 and krusader 2.4.0-beta1 (git), gentoo. In Krusader: hit F3 on any ics-file --> crash hit F4 on any ics-file --> works, I can edit the file; view the file in text/hex/lister mode works as well; switching to generic viewing mode from edit mode results in a crash again. Any idea how to fix this? The bug is still present in git master. It occurs when NULL is passed as parent widget to the factory funtion of KOrganizerPart (can be seen from stack trace too). This could happen by calling KService::createInstance (QObject *parent=0, const QVariantList &args=QVariantList(), QString *error=0) . KOrganizerPart() then dereferences the null-pointer. While the crash can be avoided by passing a valid parent widget (as I have now done in the Krusader case *), this shouldn't happen and the factory function should cast parent to QWidget if possible - otherwise it should return 0. Other KParts seem to to that too. *) http://quickgit.kde.org/index.php?p=krusader.git&a=commit&h=7b1f74a467c8389335fc96fc03ede51e0e710549 Created attachment 73288 [details]
diff
Like this?
--- a/korganizer/korganizer_part.cpp
+++ b/korganizer/korganizer_part.cpp
@@ -49,7 +49,7 @@ K_PLUGIN_FACTORY( KOrganizerFactory, registerPlugin<KOrganizerPart>(); )
K_EXPORT_PLUGIN( KOrganizerFactory( createAboutData() ) )
KOrganizerPart::KOrganizerPart( QWidget *parentWidget, QObject *parent, const QVariantList & )
- : KParts::ReadOnlyPart(parent), mTopLevelWidget( parentWidget->topLevelWidget() )
+ : KParts::ReadOnlyPart( parent )
{
KGlobal::locale()->insertCatalog( "libkcalutils" );
KGlobal::locale()->insertCatalog( "calendarsupport" );
@@ -59,6 +59,11 @@ KOrganizerPart::KOrganizerPart( QWidget *parentWidget, QObject *parent, const QV
KGlobal::locale()->insertCatalog( "libincidenceeditors" );
KGlobal::locale()->insertCatalog( "libkpimutils" );
+ if ( parentWidget ) {
+ mTopLevelWidget = parentWidget->topLevelWidget();
+ } else {
+ mTopLevelWidget = (QWidget *)parent;
+ }
KOCore::self()->addXMLGUIClient( mTopLevelWidget, this );
On Sat, 18 Aug 2012 21:12:25 +0000 Allen Winter <winter@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=205713 > > Allen Winter <winter@kde.org> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |winter@kde.org > > --- Comment #17 from Allen Winter <winter@kde.org> --- > Like this? > > > --- a/korganizer/korganizer_part.cpp > +++ b/korganizer/korganizer_part.cpp > @@ -49,7 +49,7 @@ K_PLUGIN_FACTORY( KOrganizerFactory, > registerPlugin<KOrganizerPart>(); ) > K_EXPORT_PLUGIN( KOrganizerFactory( createAboutData() ) ) > > KOrganizerPart::KOrganizerPart( QWidget *parentWidget, QObject > *parent, const QVariantList & ) > - : KParts::ReadOnlyPart(parent), mTopLevelWidget( > parentWidget->topLevelWidget() ) > + : KParts::ReadOnlyPart( parent ) > { > KGlobal::locale()->insertCatalog( "libkcalutils" ); > KGlobal::locale()->insertCatalog( "calendarsupport" ); > @@ -59,6 +59,11 @@ KOrganizerPart::KOrganizerPart( QWidget > *parentWidget, QObject *parent, const QV > KGlobal::locale()->insertCatalog( "libincidenceeditors" ); > KGlobal::locale()->insertCatalog( "libkpimutils" ); > > + if ( parentWidget ) { > + mTopLevelWidget = parentWidget->topLevelWidget(); > + } else { > + mTopLevelWidget = (QWidget *)parent; > + } > > KOCore::self()->addXMLGUIClient( mTopLevelWidget, this ); > Of course you will have to check if parent is actually a QWidget. On Sun, 19 Aug 2012 13:16:24 +0200 jan <jan_lepper@gmx.de> wrote: > On Sat, 18 Aug 2012 21:12:25 +0000 > Allen Winter <winter@kde.org> wrote: > > > https://bugs.kde.org/show_bug.cgi?id=205713 > > > > Allen Winter <winter@kde.org> changed: > > > > What |Removed |Added > > ---------------------------------------------------------------------------- > > CC| |winter@kde.org > > > > --- Comment #17 from Allen Winter <winter@kde.org> --- > > Like this? > > > > > > --- a/korganizer/korganizer_part.cpp > > +++ b/korganizer/korganizer_part.cpp > > @@ -49,7 +49,7 @@ K_PLUGIN_FACTORY( KOrganizerFactory, > > registerPlugin<KOrganizerPart>(); ) > > K_EXPORT_PLUGIN( KOrganizerFactory( createAboutData() ) ) > > > > KOrganizerPart::KOrganizerPart( QWidget *parentWidget, QObject > > *parent, const QVariantList & ) > > - : KParts::ReadOnlyPart(parent), mTopLevelWidget( > > parentWidget->topLevelWidget() ) > > + : KParts::ReadOnlyPart( parent ) > > { > > KGlobal::locale()->insertCatalog( "libkcalutils" ); > > KGlobal::locale()->insertCatalog( "calendarsupport" ); > > @@ -59,6 +59,11 @@ KOrganizerPart::KOrganizerPart( QWidget > > *parentWidget, QObject *parent, const QV > > KGlobal::locale()->insertCatalog( "libincidenceeditors" ); > > KGlobal::locale()->insertCatalog( "libkpimutils" ); > > > > + if ( parentWidget ) { > > + mTopLevelWidget = parentWidget->topLevelWidget(); > > + } else { > > + mTopLevelWidget = (QWidget *)parent; > > + } > > > > KOCore::self()->addXMLGUIClient( mTopLevelWidget, this ); > > > > Of course you will have to check if parent is actually a QWidget. > PS: it whould probably be best to implement this behaviour in KService::createInstance(), analogous to KPluginFactory::create() which does this already: http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKPluginFactory.html#a93e83b1985db058c44e67515bdcae1f6 *** Bug 316675 has been marked as a duplicate of this bug. *** Git commit b149f5ea6568e3a0840889af705b3153c56f9452 by Allen Winter. Committed on 11/07/2013 at 18:00. Pushed by winterz into branch 'master'. in the ctor, be careful when setting the toplevelwidget FIXED-IN: 4.12 REVIEW: 111412 M +9 -1 korganizer/korganizer_part.cpp http://commits.kde.org/kdepim/b149f5ea6568e3a0840889af705b3153c56f9452 |