Bug 166824 - Plasma Panel Crashes when adding widgit
Summary: Plasma Panel Crashes when adding widgit
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: panel (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-17 12:45 UTC by Brad Opferman
Modified: 2008-08-06 22:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Crash report (6.73 KB, text/plain)
2008-07-18 19:11 UTC, Brad Opferman
Details
After I logout and log back in, and try to remove the extra panel, KDE crashes. (5.87 KB, text/plain)
2008-07-18 19:22 UTC, Brad Opferman
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***.