Freeze when minimizing windows

Bug #905417 reported by Michael Terry on 2011-12-16
26
This bug affects 6 people
Affects Status Importance Assigned to Milestone
BAMF
Medium
Unassigned
Unity
Invalid
Medium
Unassigned
4.0
Fix Released
Undecided
Unassigned
bamf (Ubuntu)
Medium
Canonical Desktop Experience Team
Nominated for Precise by David Barth
unity (Ubuntu)
High
Canonical Desktop Experience Team
Nominated for Precise by David Barth

Bug Description

I was testing the Unity 0.26 SRU (in precise) when I hit a freeze a couple times.

Both times it was when minimizing a maximized window. Not 100% reproducable, but it happens often.

seb128 also reports it happening to him in oneiric.

Related branches

Sebastien Bacher (seb128) wrote :

Stacktrace of the hang:

#3 0x00d33d98 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#4 0x00d328fd in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#5 0x00d1a614 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#6 0x00d1bb14 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#7 0x00d2c37f in dbus_pending_call_block ()
   from /lib/i386-linux-gnu/libdbus-1.so.3
#8 0x00c64fde in ?? () from /usr/lib/i386-linux-gnu/libdbus-glib-1.so.2
#9 0x00c681fd in dbus_g_proxy_call ()
   from /usr/lib/i386-linux-gnu/libdbus-glib-1.so.2
#10 0x076c3fdc in bamf_view_get_children ()
   from /usr/lib/i386-linux-gnu/libbamf3.so.0
#11 0x01672f7b in BamfLauncherIcon::OwnsWindow(unsigned long) ()
   from /usr/lib/compiz/libunityshell.so
#12 0x0167301a in BamfLauncherIcon::OnWindowMinimized(unsigned int) ()
   from /usr/lib/compiz/libunityshell.so
#13 0x01679a1d in sigc::internal::slot_call1<sigc::bound_mem_functor1<void, BamfLauncherIcon, unsigned int>, void, unsigned int>::call_it(sigc::internal::slot_rep*, unsigned int const&) () from /usr/lib/compiz/libunityshell.so
#14 0x015dd82d in PluginAdapter::Notify(CompWindow*, CompWindowNotify) ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/compiz/libunityshell.so
#15 0x0163b302 in UnityWindow::windowNotify(CompWindowNotify) ()
   from /usr/lib/compiz/libunityshell.so
#16 0x0807d7e3 in CompWindow::windowNotify(CompWindowNotify) ()
#17 0x01642adf in compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::minimize() () from /usr/lib/compiz/libunityshell.so
#18 0x01642bce in compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::minimize() () from /usr/lib/compiz/libunityshell.so
#19 0x01642bce in compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::minimize() () from /usr/lib/compiz/libunityshell.so
...

Changed in unity (Ubuntu):
importance: Undecided → High
Changed in unity:
importance: Undecided → High
Changed in unity (Ubuntu):
assignee: nobody → Canonical Desktop Experience Team (canonical-dx-team)
Sebastien Bacher (seb128) wrote :

It was not an issue in the tarball before Sam's fixes, could well be due to https://code.launchpad.net/~smspillaz/unity/unity4.0_fix_881190/+merge/85886

Changed in unity:
assignee: nobody → Sam Spilsbury (smspillaz)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed
Sam Spilsbury (smspillaz) wrote :

Hmm. I think there was a case where we were not returning in a function, and this might cause bamf to throw up. Ideally bamf should probably safeguard against invalid xid's.

Can you post the full stacktrace ?

Sam Spilsbury (smspillaz) wrote :

(I've since fixed the not-returning in the function part).

Also it would be nice to know what applications trigger this. I was running this code for about 3 hours and never saw this.

Sam Spilsbury (smspillaz) wrote :

Ah fun, based on some reading of the code I did it looks like this is a race condition where a window is destroyed, and then we make a bamf call on it, and during the time when we go to make that bamf call to fake re-minimize the window (required), "Closed" has already been emitted but we haven't yet gotten around to processing it, so the client side BamfView * points to an object which has already been destroyed bamfdaemon side, so bamfdaemon just doesn't return because the view doesn't exist.

Fun.

I see three solutions to this problem:

1) Hack around it and don't allow windowNotify to be called for destroyed windows in unity, that solution isn't perfect since another plugin could easily trigger the same effect if unity doesn't disable its windowNotify handler in time, and we may need to use the windowNotify handler in the destructor for other reasons..
2) Make libbamf use dbus_g_proxy_call_timeout to handle the situation where the server never replies
3) Make the server reply with an error if some client tried to make a proxy call with a proxy client that doesn't exist server-side because it was destroyed.

Out of all the three, solution 3 is the least hacky but might take some co-ordination in the SRU to get right. Solution 1 is doable, but I wouldn't recommend it for unity trunk.

Changed in bamf:
assignee: nobody → Jason Smith (jassmith)
Changed in bamf:
assignee: Jason Smith (jassmith) → Marco Trevisan (Treviño) (3v1n0)

seb128, you experienced this on Precise, but is this affecting also Oneiric, isn't it (asking due to the SRU thing)?

Changed in unity:
status: New → Triaged
Changed in bamf:
status: New → Triaged
Omer Akram (om26er) wrote :

yes its a bug in 4.26.0 as well that's why it was removed from the staging ppa, once we'll have the fix for that we'll patch bamf and get unity 4.26.0 into oneiric-proposed

Omer, I can't reproduce this, so it's quite hard to be sure of fixing it.

Once you find a way to reproduce or you've a full stack trace, please ping me.

Set as invalid as it doesn't happen anymore to the reporter too.

Changed in bamf:
status: Triaged → Won't Fix
Changed in unity:
status: Triaged → Invalid
Changed in bamf:
status: Won't Fix → Invalid
Changed in unity (Ubuntu):
status: Confirmed → Invalid
Omer Akram (om26er) wrote :

that doesn't happen anymore because the commit that caused the issue was reverted in Unity. the real cause is still there and needs fixing

Changed in bamf:
status: Invalid → New
David Barth (dbarth) wrote :

Agreed, the cause and possible remedies have been outlined by sam in comment #6.

In terms of scope, I would recommend targeting only Precise.

Changed in bamf (Ubuntu):
assignee: nobody → Canonical Desktop Experience Team (canonical-dx-team)
importance: Undecided → Medium
status: New → Triaged
Changed in bamf:
importance: Undecided → Medium
Changed in unity:
importance: High → Medium
status: Invalid → Triaged
assignee: Sam Spilsbury (smspillaz) → Marco Trevisan (Treviño) (3v1n0)
milestone: none → 5.6.0

Actually I'm not sure that the problem is still there, at least on the daemon side considering that when I rewrote bamfdaemon to gdbus I also fixed some issues related to the closed views... So I need to check it again on the library side.

Didier Roche (didrocks) on 2012-03-12
Changed in unity:
milestone: 5.6.0 → 5.8.0
Didier Roche (didrocks) on 2012-03-23
Changed in unity:
milestone: 5.8.0 → 5.10.0
Jason Warner (jasoncwarner) wrote :

Not sure if related, but I was going to file a new bug when I found this one. When I minimize a fully maximized window, there are times when Unity/Compiz will crash and respawn. I can't reproduce on a regular basis, but it happened enough times in a few days that I knew something was up.

I did notice that it happened most on Chrome and Firefox, but that could just be because I tend to maximize and minimize them the most.

Daniel van Vugt (vanvugt) wrote :

This might be bug 918329... ?

Didier Roche (didrocks) on 2012-04-12
Changed in unity:
milestone: 5.10.0 → 5.12.0

I've never experienced this recently (or in the past)... What about you guys recently?

Didier Roche (didrocks) on 2012-04-27
Changed in unity:
milestone: 5.12.0 → 5.14.0
José Lou Chang (obake) wrote :
Changed in unity:
status: Triaged → Invalid
Changed in bamf:
assignee: Marco Trevisan (Treviño) (3v1n0) → nobody
Changed in unity:
assignee: Marco Trevisan (Treviño) (3v1n0) → nobody
Changed in bamf:
status: New → Invalid
Changed in unity:
milestone: 5.14.0 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers