Merge lp:~brandontschaefer/unity/possible-crash--fixes into lp:unity

Proposed by Brandon Schaefer on 2012-04-24
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2012-04-24
Approved revision: 2329
Merged at revision: 2332
Proposed branch: lp:~brandontschaefer/unity/possible-crash--fixes
Merge into: lp:unity
Diff against target: 19 lines (+7/-1)
1 file modified
plugins/unityshell/src/unityshell.cpp (+7/-1)
To merge this branch: bzr merge lp:~brandontschaefer/unity/possible-crash--fixes
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2012-04-24 Approve on 2012-04-24
Review via email: mp+103224@code.launchpad.net

Commit message

UnityScreen: destroy the controllers before the window thread

Fixes crashes enabling/disabling plugins in CCSM

Description of the change

=== Problem ===
Lots of crashes in unity with ccsm and plugin

=== Fix ===
Make sure the smart ptr gets reset before the window thread is deleted.

To post a comment you must log in.
Brandon Schaefer (brandontschaefer) wrote :

So im tracking down the crash that wasn't fixed by this branch. Here are the only 2 crashes now from UnityPlugin and Wobbly Windows:

Caused when enabling/disabling Unity Plugin in ccsm
bamf_matcher_on_view_opened:

normal backtrace
http://paste.ubuntu.com/943691/

full backtrace
http://paste.ubuntu.com/943693/

Caused when enabling/disabling Wobbly Windows in ccsm
bamf_matcher_on_view_closed:

normal backtrace
http://paste.ubuntu.com/943698/

full backtrace
http://paste.ubuntu.com/943697/

What happens is either OpenView is emited twice on the same window or the CloseView is called twice on the same window. It was always the same window for open, or the same for close (if you cause the crash multiple times).

Marco Trevisan (Treviño) (3v1n0) wrote :

> So im tracking down the crash that wasn't fixed by this branch. Here are the
> only 2 crashes now from UnityPlugin and Wobbly Windows:
>
> Caused when enabling/disabling Unity Plugin in ccsm
> bamf_matcher_on_view_opened:
>
> normal backtrace
> http://paste.ubuntu.com/943691/
>
> full backtrace
> http://paste.ubuntu.com/943693/
>
> Caused when enabling/disabling Wobbly Windows in ccsm
> bamf_matcher_on_view_closed:
>
> normal backtrace
> http://paste.ubuntu.com/943698/
>
> full backtrace
> http://paste.ubuntu.com/943697/
>
>
> What happens is either OpenView is emited twice on the same window or the
> CloseView is called twice on the same window. It was always the same window
> for open, or the same for close (if you cause the crash multiple times).

This should be due to libbamf, that doesn't disconnect these signals on dispose, I'll look to that.

The unity side looks good to me.

review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :

Brandon, please check if the crashes are fixed using this libbamf version: http://go.3v1n0.net/IBB74t

Brandon Schaefer (brandontschaefer) wrote :

Sweeet that fixed the problem! Now I don't get any crashes when enabling and disabling unity plugin.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2012-04-22 19:09:53 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2012-04-24 06:32:22 +0000
4@@ -402,8 +402,14 @@
5
6 ::unity::ui::IconRenderer::DestroyTextures();
7 QuicklistManager::Destroy();
8- // We need to delete the launchers before the window thread.
9+ // We need to delete the controllers before the window thread.
10 launcher_controller_.reset();
11+ hud_controller_.reset();
12+ dash_controller_.reset();
13+ panel_controller_.reset();
14+ switcher_controller_.reset();
15+ shortcut_controller_.reset();
16+
17 delete wt;
18 reset_glib_logging();
19 }