Firefox hangs temporarily everytimes it receives the focus

Bug #964584 reported by Éric Piel on 2012-03-25
This bug affects 6 people
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)

Bug Description

In 12.04 beta, with unity, every times firefox gets the focus, it blocks for a couple of seconds (~10 second on my laptop) while loading all the processors fully.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: firefox 11.0+build1-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-20.32-generic 3.2.12
Uname: Linux 3.2.0-20-generic x86_64
AddonCompatCheckDisabled: False
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 1.95-0ubuntu1
Architecture: amd64
 /dev/snd/controlC0: piel 1633 F.... pulseaudio
BuildID: 20120313141247
Channel: release
Date: Sun Mar 25 16:44:54 2012
ForcedLayersAccel: False
 auto lo
 iface lo inet loopback
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120301)
Profiles: Profile0 (Default) - LastVersion=11.0/20120313141247 (Running)
RunningIncompatibleAddons: False
SourcePackage: firefox
UpgradeStatus: No upgrade log present (probably fresh install) 04/22/2011
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: 68MSP Ver. F.10 30C9
dmi.board.vendor: Hewlett-Packard
dmi.board.version: KBC Version 75.28
dmi.chassis.asset.tag: CZC8031BZF
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.modalias: dmi:bvnHewlett-Packard:bvr68MSPVer.F.10:bd04/22/2011:svnHewlett-Packard:pnHPCompaq2510p:pvrF.10:rvnHewlett-Packard:rn30C9:rvrKBCVersion75.28:cvnHewlett-Packard:ct10:cvr: HP Compaq 2510p
dmi.product.version: F.10
dmi.sys.vendor: Hewlett-Packard

Éric Piel (pieleric) wrote :
Éric Piel (pieleric) wrote :

After trying many different conditions, it seems that it depends on the number of bookmarks. I have more than 2000 bookmarks. If I delete them, firefox doesn't hang.

Note also this happens without any add-ons (but the Ubuntu ones).

Éric Piel (pieleric) wrote :

Disabling global-menubar plugin fixes the problem as well. So it seems it could be related to global-menubar not handling correctly a large set of bookmarks (which are displayed in the menu).

Chris Coulson (chrisccoulson) wrote :

Nothing has changed in Firefox for a while now, so I guess this is triggered by HUD changes last week. Could you attach gdb to Firefox and get a backtrace whilst it is hung?

Note that we deliberately don't export dbusmenu objects for a menu until it appears on screen for the first time, to avoid this type of issue with large menus (which also affects Chrome too - see bug 801699, which is pretty much the same issue), as we used to get reports of Firefox hanging for 10-15 seconds when opening the bookmarks menu for the first time

Launchpad Janitor (janitor) wrote :

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

Changed in firefox (Ubuntu):
status: New → Confirmed
Chris Coulson (chrisccoulson) wrote :

Would someone on x86_64 mind installing this addon? There is a catch though - it will only work in the current Firefox beta (from

This contains a bunch of changes which might slightly improve the speed of building menus (buried amongst the refactoring in However, I don't expect those to make all that much difference here and without being able to recreate the problem, I'm not even sure where the performance issues are.

With this version of the addon installed, could you also please try running Firefox with GLOBAL_MENU_NO_ICONS=1 in the environment and see if that makes a difference?

Changed in firefox (Ubuntu):
status: Confirmed → Incomplete
Chris Coulson (chrisccoulson) wrote :

How many bookmarks do you have btw?

Nick Moffitt (nick-moffitt) wrote :

Deleting all my bookmarks cleared this up for me. Thanks for the workaround!

I really only had maybe like 50 bookmarks, maybe less. I feel like I hit the delete key about 30 times, perhaps.

Éric Piel (pieleric) wrote :

It's indeed probably due to something special in 12.04 because on a relatively similar configuration with 11.10 and firefox 11 (firefox sync'd), this bug is not present.

So I've tried disabling the icons with "GLOBAL_MENU_NO_ICONS=1 firefox" but it didn't change anything. That said, I'm a bit doubting whether it really worked because the icons were still present in the menu.

As for the backtrace, see the attached file (i've taken two bt at different times). It seems like all the time is spent in dbusmenu_menuitem_get_id() ... Is this hinting you on something?

Now I'm going to try the included XPI with firefox-beta, and report later...

Éric Piel (pieleric) wrote :

I can report that the XPI provided (with firefox 12 beta) displays the same bug. The only (subtle) difference is that now it also displays this warning on the console:
 (firefox:14531): LIBDBUSMENU-GTK-CRITICAL **: dbusmenu_menuitem_property_set_shortcut: assertion `gtk_accelerator_valid(key, modifier)' failed

Chris Coulson (chrisccoulson) wrote :

That error is present in all versions :)

What about with GLOBAL_MENU_NO_ICONS=1 with the xpi attached to this bug?

Chris Coulson (chrisccoulson) wrote :

Also, could you please get a backtrace with debugging symbols installed? You need firefox-dbg, libglib2.0-0-dbg, libdbusmenu-glib4-dbgsym and libdbusmenu-gtk4-dbgsym (instructions for adding the debug symbol repo are


Éric Piel (pieleric) wrote :

GLOBAL_MENU_NO_ICONS=1 with the XPI attached does indeed remove the icons from the menu. However this doesn't help with respect to the freezes.

I'll upload a more readable backtrace as soon as the debugging symbols are installed on my laptop.

Chris Coulson (chrisccoulson) wrote :

Thanks, so this is basically the same underlying problem as bug 801699. The issue is that it takes ages to find the node for each event coming from the HUD, although this doesn't explain why it's happening on focus changing.

Perhaps Ryan can help figure out whether those events are actually coming from the HUD :-)

Chris Coulson (chrisccoulson) wrote :

Ok, I've reproduced this now. I've managed to create a bookmarks setup which takes the HUD around 8 minutes to mine (I created a folder with 49 bookmarks in, duplicated it randomly and ended up with a 13*22*26 tree of folders, which is quite a lot of bookmarks)

This is triggered with the first search in the HUD for Firefox. What I found after closing the HUD though and waiting 8 minutes for Firefox to become responsive again, is that it would then trigger every time I focused Firefox again.

Chris Coulson (chrisccoulson) wrote :

A more realistic use case of 8000 bookmarks takes around a minute of CPU :(

Éric Piel (pieleric) wrote :

With the latest updates of firefox and the globalmenu addon, I'm not seeing this bug anymore.

To post a comment you must log in.