Bug 166824

Summary: Plasma Panel Crashes when adding widgit
Product: [Unmaintained] plasma4 Reporter: Brad Opferman <bardo88>
Component: panelAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Crash report
After I logout and log back in, and try to remove the extra panel, KDE crashes.

Description Brad Opferman 2008-07-17 12:45:30 UTC
Version:            (using KDE 4.0.98)
Installed from:    Ubuntu Packages
OS:                Linux

If I add a panel and open up the +Widgit, then remove the panel and add the widgit, plasma will crash.

Basically when adding a widgit to a panel that doesnt exist, plama will crash and take my Kmenu from my main panel with it.  I then have to readd that after the crash.
Comment 1 Christophe Marin 2008-07-17 13:12:58 UTC
Please read the following page and provide a useful backtrace for this crash : http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports

Also mention which widget you try to add.
Comment 2 Brad Opferman 2008-07-17 13:45:27 UTC
I tried adding multiple widgets including the Kmenu and Clock.
Comment 3 Brad Opferman 2008-07-17 20:19:59 UTC
I should also note that I installed to virtualbox, with guest addons with Kubuntu 8.04 Remix.
Comment 4 Aaron J. Seigo 2008-07-17 20:37:23 UTC
SVN commit 833976 by aseigo:

watch for containment destruction; for people who like torturing plasma in weird nd wonderful ways
BUG:166824


 M  +15 -0     appletbrowser.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=833976
Comment 5 Mario Oschwald 2008-07-17 21:10:44 UTC
very frustrating for newbies, when the boss checks in the fix, just when I had my almost identical patch ready ;-)

Anyway - your patch introduces a crash by leaving the containment as null pointer. You trigger it by clicking the Add Widget Button after the panel is removed. 

Two solutions seem possible:

-deactivate the Add Widget Button (you can then still drag an applet to another containment)
-destroy the AppletBrowser completely (This is what I did even though it is kinda hackish, because only the AppletBrowserWidget keeps a pointer to the containment and I had to assume that destroying its parent would do the trick, this wouldn't work when that widget is embedded deeper or elsewhere)

I like the 2nd approach more because deactivating the button would mean finding
all the paths, where that widget is reused with another containment and activating the button then again.
Comment 6 Aaron J. Seigo 2008-07-17 21:30:36 UTC
"You trigger it by clicking the Add Widget Button after the panel is removed." 

incorrect:

void AppletBrowserWidget::addApplet()
{
    if (!d->containment) {
        return;
    }
Comment 7 Mario Oschwald 2008-07-17 21:36:56 UTC
sry, my analysis was wrong - the connection is never made:

QObject::connect: No such slot Plasma::AppletBrowserWidget::containmentDestroyed()

because the slot is defined in the AppletBrowserWidgetPrivate, this causes the containment not to be set to 0

even if this connection is made correctly, wouldn't that mean that the add Widget button is just going to do nothing in that case? Should be grayed out then I guess.
Comment 8 Aaron J. Seigo 2008-07-17 22:35:05 UTC
> the connection is never made

your svn checkout is not up to date =)

> wouldn't that mean that the add Widget button is just going
> to do nothing in that case?

currently, yes.

> Should be grayed out then I guess. 

what i think would make even more sense (at least for the plasma workspace) would be to re-associate itself with the containment that is associated with the screen the dialog is on.

in a more generic fashion, having a "default containment for this browser" is what we'd want.
Comment 9 Brad Opferman 2008-07-18 19:11:44 UTC
Created attachment 26242 [details]
Crash report

This is a crash report. Version 4.00.98 (KDE 4.0.98 (4.1 RC1))
Comment 10 Brad Opferman 2008-07-18 19:19:31 UTC
Also, when I logout and log back in I find a panel behind my main panel that extends to touch the right side(my main panel seems to be slightly stunted and only progresses 4/5 the way across the screen).  When I remove this panel kde crashes.
Comment 11 Brad Opferman 2008-07-18 19:22:57 UTC
Created attachment 26243 [details]
After I logout and log back in, and try to remove the extra panel, KDE crashes.
Comment 12 Brad Opferman 2008-08-06 22:30:06 UTC
I still seem to encounter this problem with KDE 4.1 final.
Comment 13 Aaron J. Seigo 2008-08-06 22:36:52 UTC
Brad: your crash is not the same as this bug. please open a new bug, but only after making doubly sure all your plasma applets are up to date. the backtrace you provided is not completely useful (see link at the end of this comment), but it looks a lot like a binary incompatibility problem due to stale applets (perhaps from a beta or other-pre-release) hanging around.

http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports
Comment 14 Aaron J. Seigo 2008-08-06 22:57:14 UTC
*** Bug has been marked as fixed ***.