Open Bug 1979283 Opened 3 months ago Updated 2 days ago

Firefox hangs on macos 26, when I open apps or spotlight

Categories

(Core :: Widget: Cocoa, defect, P3)

Firefox 141
defect

Tracking

()

UNCONFIRMED

People

(Reporter: bhawanisingh2k13, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Whiteboard: Workaround in comment 38)

Attachments

(5 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:141.0) Gecko/20100101 Firefox/141.0

Steps to reproduce:

I have firefox open and browsing the web
I open spotlight or apps in macos 26
Firefox hangs

Actual results:

Firefox hangs

Expected results:

Firefox should not hangs and should work. Every other app works but not firefox.

Attached file firefox.log

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Cocoa' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core

Could you please confirm which version of macOS 26 that you are using? You can find this by clicking on the Apple logo in the top left corner of your screen, "About This Mac" and then click on the text field next to macOS. It should show a version number, for example "26 (25A5316i)" or similar.

Severity: -- → S3
Flags: needinfo?(bhawanisingh2k13)
Priority: -- → P3

The version is Version 26.0 Beta (25A5316i)

Flags: needinfo?(bhawanisingh2k13)
Attached video firefox.mp4

Thank you for the video. Could you clarify if you are pressing the "Menu Items" section of the Spotlight search, or if you're just dismissing the Spotlight search? Possibly by pressing ESC?

Flags: needinfo?(bhawanisingh2k13)

I tried dismissing the Spotlight search by both clicking outside and by pressing ESC, both caused firefox to hang

Flags: needinfo?(bhawanisingh2k13)

I just updated to 26.0 Beta (25A5316i) and I do not see the "Menu Items" section in spotlight search like you do. Do you happen to know if you have customized your spotlight search at all? The callstack that you have provided does seem to indicate some issue with menu items, but I'm unable to reproduce at the moment.

Flags: needinfo?(bhawanisingh2k13)
Attached image image.png

I enabled from here, even after disabling every data source for spotlight, firefox still hangs

Flags: needinfo?(bhawanisingh2k13)

Are there tools/debuggers which I can attach to firefox and provide detailed debugging logs?

I have the exact same problem. Running Firefox 141.0 now, but the problem has been there ever since switching to the MacOS 26 Tahoe Developer Beta. It also still persists in the Public Beta (25A5316i).

Could you run mozregression to see if this might be a regression on our side? You can either choose to use the GUI tool, or simply run these three commands in a Terminal window:

sudo easy_install pip
sudo python3 -m pip install -U mozregression --ignore-installed
mozregression --good 2017-01-01

A number of Firefox versions will open in succession to narrow down when this started occurring. Simply type "good" or "bad" in Terminal based on whether or not a build reproduces the bug. Once finished, please post the output from the last run. It should give a last good and first bad revision as well as a link to look at the changesets in that range. Thank you!

Flags: needinfo?(pascal.scheu)
Flags: needinfo?(bhawanisingh2k13)

Not the original poster but I went ahead and ran mozregression and ran the build from 2021-01-01 since it was around the time M series Macs were officially supported. The build worked fine until I logged in. I went ahead and tested the very latest nightly and same thing - when I deleted the profile I was signed in to and used a new one, the spotlight issue did not occur. As soon as I logged in, I used command + space to open spotlight and immediately triggered the bug. Currently on the same MacOS build Version 26.0 Beta (25A5316i). I'm new to testing for Firefox - is there something as easy as mozregression but for browser settings? Otherwise I may play around and see if I can nail down what's causing the problem.

I ran the same test as described in the above comment (ran the build from 2021-01-01) and firefox started hanging as soon as I press cmd + space, after I login to firefox sync.

Flags: needinfo?(bhawanisingh2k13)

It sounds like this might not be reproducible in Safe Mode (Help > Troubleshoot Mode...). Could you please confirm? If this is the case, could you go through your extensions and temporarily disable them to see if this has any impact?

Flags: needinfo?(bhawanisingh2k13)

It would also be good to know if you can think of anything that might make it so that different menu items appear in the menu bar than in a fresh profile. For example, do you have bookmarks organized in some kind of unusual way? Are there any menu items that don't appear in a fresh profile?

Attached file Compositor Log

Troubleshoot Mode still allows the issue to be reproduced which is super strange to me. I don't see anything that changes between profiles. I'm again super unfamiliar with debugging Firefox but did manage to get a log which doesn't really show much except for the looping of the compositor that starts after I open spotlight (attached to the issue as Compositor Log). I will continue to keep looking into it a bit and if there are any suggestions, I'm more than happy to entertain them :)

OK, sorry for the spam but one more thing I've noticed is that if I load Firefox into a different profile first and then switch into my main profile that's logged into sync, I do not get the issue. However, if I load right into the profile that's logged in, I am able to consistently reproduce it.

I am facing the same issue. The issue started when Firefox is sync with Firefox account.

Duplicate of this bug: 1980768

Would you be able to go to System Settings, then search for Spotlight search categories, disable Menu Items towards the bottom of the categories, restart Firefox and see if this issue still reproduces? This would at least isolate the issue to menu items.

Flags: needinfo?(masum)

(In reply to Stephen A Pohl [:spohl] from comment #22)

Would you be able to go to System Settings, then search for Spotlight search categories, disable Menu Items towards the bottom of the categories, restart Firefox and see if this issue still reproduces? This would at least isolate the issue to menu items.

I just tried this and it had no effect. The hang persists.

(In reply to Alex from comment #23)

(In reply to Stephen A Pohl [:spohl] from comment #22)

Would you be able to go to System Settings, then search for Spotlight search categories, disable Menu Items towards the bottom of the categories, restart Firefox and see if this issue still reproduces? This would at least isolate the issue to menu items.

I just tried this and it had no effect. The hang persists.

Can confirm.

Flags: needinfo?(pascal.scheu)

(In reply to Alex from comment #23)

(In reply to Stephen A Pohl [:spohl] from comment #22)

Would you be able to go to System Settings, then search for Spotlight search categories, disable Menu Items towards the bottom of the categories, restart Firefox and see if this issue still reproduces? This would at least isolate the issue to menu items.

I just tried this and it had no effect. The hang persists.

Yup, I even disabled all options in results from apps and results from system, still the same issue

Flags: needinfo?(bhawanisingh2k13)

(In reply to Bhawani from comment #25)

(In reply to Alex from comment #23)

(In reply to Stephen A Pohl [:spohl] from comment #22)

Would you be able to go to System Settings, then search for Spotlight search categories, disable Menu Items towards the bottom of the categories, restart Firefox and see if this issue still reproduces? This would at least isolate the issue to menu items.

I just tried this and it had no effect. The hang persists.

Yup, I even disabled all options in results from apps and results from system, still the same issue

Delete all bookmark, the It should work. Thanks me later. :D

Flags: needinfo?(masum)

(In reply to Masum Talukder from comment #26)

(In reply to Bhawani from comment #25)

(In reply to Alex from comment #23)

(In reply to Stephen A Pohl [:spohl] from comment #22)

Would you be able to go to System Settings, then search for Spotlight search categories, disable Menu Items towards the bottom of the categories, restart Firefox and see if this issue still reproduces? This would at least isolate the issue to menu items.

I just tried this and it had no effect. The hang persists.

Yup, I even disabled all options in results from apps and results from system, still the same issue

Delete all bookmark, the It should work. Thanks me later. :D

I deleted the bookmarks, but it still hangs (not indefinitely) for a couple of seconds, and after that input/scroll does not respond for 10-15 seconds.

Also I updated to latest beta Version 26.0 Beta (25A5327h)

(In reply to Bhawani from comment #27)

(In reply to Masum Talukder from comment #26)

(In reply to Bhawani from comment #25)

(In reply to Alex from comment #23)

(In reply to Stephen A Pohl [:spohl] from comment #22)

Would you be able to go to System Settings, then search for Spotlight search categories, disable Menu Items towards the bottom of the categories, restart Firefox and see if this issue still reproduces? This would at least isolate the issue to menu items.

I just tried this and it had no effect. The hang persists.

Yup, I even disabled all options in results from apps and results from system, still the same issue

Delete all bookmark, the It should work. Thanks me later. :D

I deleted the bookmarks, but it still hangs (not indefinitely) for a couple of seconds, and after that input/scroll does not respond for 10-15 seconds.

Also I updated to latest beta Version 26.0 Beta (25A5327h)

When I removed all bookmark, It worked for me. Make sure no other device are logged in !

(In reply to Masum Talukder from comment #26)

Delete all bookmark, the It should work. Thanks me later. :D

Before deleting all bookmarks it would be great to isolate which bookmark may have caused this. We may be able to work around whatever is making Spotlight trip up.

I don't know about anyone else but for me it appears to be related to bug 1631239 where I had an infinite looping unfiled folder. When I removed that, Firefox appeared to work as you'd expect. I don't mind removing this since I have been putting random bookmarks in FF for decades despite not ever really going back to them so most of it can almost certainly be deleted but it'd be interesting to hear if this is the same thing causing the issue for others.

(In reply to [:Littlejth] from comment #30)

I don't know about anyone else but for me it appears to be related to bug 1631239 where I had an infinite looping unfiled folder. When I removed that, Firefox appeared to work as you'd expect. I don't mind removing this since I have been putting random bookmarks in FF for decades despite not ever really going back to them so most of it can almost certainly be deleted but it'd be interesting to hear if this is the same thing causing the issue for others.

Thank you for this pointer! I have been able to recreate a bookmark structure that reproduces this hang. I'm going to investigate if there is anything that we can do on our end to prevent this bug. Otherwise, I'm going to file with Apple.

Depends on: 1631239

(In reply to [:Littlejth] from comment #30)

I don't know about anyone else but for me it appears to be related to bug 1631239 where I had an infinite looping unfiled folder. When I removed that, Firefox appeared to work as you'd expect. I don't mind removing this since I have been putting random bookmarks in FF for decades despite not ever really going back to them so most of it can almost certainly be deleted but it'd be interesting to hear if this is the same thing causing the issue for others.

Yeah this fixed the issue, no more lag,hang or anything now.

Attached file RecursiveMenuItems.zip

I have reported this bug to Apple as FB19444013:

Title:
(macOS 26 Tahoe) Spotlight search of menu items in third party apps can cause third party apps to hang

Which are are you seeing an issue with?
Spotlight

What type of issue are you reporting?
Application Slow/Unresponsive

What type of result did you expect to see Spotlight provide?
Menu Items

Description:
We (Mozilla) would like to report a hang that our users may encounter in Firefox. This issue may also affect other third-party apps that dynamically create menu items in their apps. The issue occurs due to Spotlight’s recursive enumeration of menu items in third-party apps: If menu items are created dynamically, infinite recursion may occur, resulting in these apps to hang.

In Firefox’s case, it is possible for users to create bookmark folders that may reference themselves, which are then reflected in the menu bar as menu items. We are tracking this issue on Mozilla’s side at https://bugzilla.mozilla.org/show_bug.cgi?id=1979283.

Please find attached sample code that reproduces the issue:

  1. Create a new macOS Xcode project with the language set to Objective-C.
  2. Replace AppDelegate.h, AppDelegate.m and main.m with the files provided in the attachment uploaded to this bug.
  3. Build and run the app.
  4. Once the app is running, trigger Spotlight search, then dismiss and return to the sample app.

Actual result:
The app will be unresponsive and the beach ball cursor will appear.

Expected result:
No hang.

(In reply to Stephen A Pohl [:spohl] from comment #33)

In Firefox’s case, it is possible for users to create bookmark folders that may reference themselves,

Whoa what!?

I think we should change the code which creates these menu items to not create those items. There's no point letting a user build up an infinite stack of menus.

I followed up in bug 1631239 comment 10 to see if we can prevent that at the bookmarks level. Are you saying that we should prevent this at the widget layer as well or instead?

Flags: needinfo?(mstange.moz)

Ah I see. I'll follow up over there. I'm not sure what the defense at the widget layer should be - actually maybe we should just have an additional depth limit.

Flags: needinfo?(mstange.moz)

Hello,
Any updates or news on this bug ?

Thank you

(In reply to Pierre from comment #37)

Hello,
Any updates or news on this bug ?

Thank you

On an individual basis, the best thing to do is to check your bookmarks and ensure that there are no cycles. This will prevent the hang.

Ah great, thank you, it worked. Glad to no longer have this issue :)

Whiteboard: Workaround in comment 38

I've never intentionally created a recursive bookmark, but hit this bug as I've upgraded to MacOS 26.

Had an "unfiled" bookmark folder which itself contained "unfiled". When removing this from itself, the hang seems to stop, so I'd consider this a workaround.

That being said, it sounds sane to have an escape hatch in place so that we either discover loops (potentially "unsolvable" problem, I know) or stop at a certain depth, at least in this context.

Duplicate of this bug: 1988943
Duplicate of this bug: 1989509
See Also: → 1982717
Blocks: macos-26
Duplicate of this bug: 1989336

I can reproduce this bug following Bhawani steps.
MacOS is 26.0.1 and Firefox is 143.0.3.
Started happening once I updated to MacOS 26 standard release (Non beta)

Sorry, followed to bug 1631239 and fixed bookmarks. Now I can't reproduce it anymore

Duplicate of this bug: 1991301

Still happens to me. Tahoe 26.0.1, firefox "143.0.4 (aarch64)", mac mini M4 16Gb ram.

Disabling the spotlight keyboard shortcut and installing alfred instead I think helped 🙃.

(In reply to shuri from comment #47)

Still happens to me. Tahoe 26.0.1, firefox "143.0.4 (aarch64)", mac mini M4 16Gb ram.

Disabling the spotlight keyboard shortcut and installing alfred instead I think helped 🙃.

Please see comment 38 for a possible workaround. This seems to have worked for everyone so far.

(In reply to Stephen A Pohl [:spohl] from comment #48)

(In reply to shuri from comment #47)

Still happens to me. Tahoe 26.0.1, firefox "143.0.4 (aarch64)", mac mini M4 16Gb ram.

Disabling the spotlight keyboard shortcut and installing alfred instead I think helped 🙃.

Please see comment 38 for a possible workaround. This seems to have worked for everyone so far.

Thank you! Is there a simple way to find and remove the recursions?

(In reply to shuri from comment #49)

Thank you! Is there a simple way to find and remove the recursions?

Unfortunately not at the moment. An improvement on Firefox's side is being discussed in bug 1631239.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: