Open Bug 1415923 Opened 3 years ago Updated 13 days ago

macOS: Firefox unresponsive/freezes after locking screen

Categories

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

x86_64
macOS
defect

Tracking

()

Tracking Status
firefox65 --- affected

People

(Reporter: sebastian, Unassigned, NeedInfo)

References

Details

(Keywords: perf, Whiteboard: [needs profile])

Attachments

(8 files)

MacOS X 10.12.6 (16G1036) - MacBookPro

Firefox becomes unresponsive / laggy after the screen was locked for some time. The UI responds with a multiple second delay until the browser is restarted. At first I though this was somehow related to my specific device. But now after switching to a new device I have the same problem again.

STR:

* Lock the screen - I usually execute "Lock" via the Alfred3 prompt). Note that it's "Lock" and not "Sleep".

* Wait some time - Usually I notice the behavior after longer breaks. It needs to be at least long enough so that macOS askes for the password again.


Not sure if it's important, but some details about my setup:
* Two external displays
* Two Firefox windows - One on an external screen and another one on the MacBook
* Some pages that are always open: GMail, Google Calendar, IRCCloud, Slack, Hangouts, GitHub, Bugzilla
I think I observed this first with ~Firefox 55/56? But I'm not 100% sure.
I've experienced this too during my use of Firefox 57.0beta on macOS 10.12.6. My steps to reproduce are the same (I even lock my computer the same way with Alfred 3). And it only happens after being locked for a while (I want to say at least 15-20 minutes).

After unlocking my computer, when Firefox is focused, it appears entirely unresponsive. However, when I Cmd+Tab to a different application, then Firefox registers my action. For example, if I click on another tab to switch to it, nothing happens. When I Cmd+Tab to another app, then Firefox switches to the tab I clicked on. I have to restart the browser to get it back to a working state.
Experiencing the same issue on Firefox 58.0b13 on MacOS 10.12.6, and also use Alfred 3's lock command.
I have started experiencing exactly the same issue as described above, Firefox 61.0.2 on MacOs 10.12.6.
After locking the screen for a longer period(15-20 minuts seems rights), with Firefox as the application in focus, Firefox is unresponsible when unlocking. Only way to resolve it is to restart the application.

I lock the screen the ordinary way, not using Alfred3.
I can also reproduce this when switching users on macOS.  Same
experience as a_waal that leaving Firefox in focus for 15-20 minutes
reproduces it.

To me this looks like a graphics related bug because the browser
itself responds to interaction.
Could someone please use the profiler and create a session? This might give us the necessary information where all the CPU time is being spent.

Steps:

1) Install the profiler addon: https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler#Getting_the_Gecko_Profiler_Add-on

2) Starting the profiler

3) Locking the screen for the necessary time to reproduce the problem

4) Unlock the screen and wait some seconds before capturing the profile (https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Reporting_a_Performance_Problem#Capturing_and_sharing_a_profile)

If you can please share the profile with us, that would be great.
I have had this problem for about a year or so on a 2011 iMac. The problem seems worse on a new iMac Pro.

1) Use Firefox in one Mac user account
2) Login to a new user account (without logging out of the first)
3) Use Firefox in 2nd user account
4) Fast switch back to 1st user account
5) Firefox appears unresponsive. Technically, it actually is responsive. For example, if I left a Youtube page up, I can click where the video would be and I can hear it start playing, but visually you do not see anything. Likewise, I can cmd+T a new tab and start typing a URL, and even hit enter. Nothing will appear to happen. However, if I quit Firefox and restore the previous session, that new tab and website that I entered will load. So it's functioning, but there is just some kind of UI freeze going on.
6) Functionality can be immediately restored if I switch back to 2nd user account and immediately switch back to 1st user account (in other words, if I switch to the 1st user account twice).
7) Switching back to 2nd user account after Firefox functionality has been restored to 1st user account renders 2nd user account Firefox unresponsive.

I installed the Gecko Profiler and captured the above. But 10 minutes after clicking "Capture Profile" it says "We were unable to connect to the Gecko profiler add-on within thirty seconds. This might be because the profile is big or your machine is slower than usual. Still waiting..." Tried it a second time and same result.
Same problem on iMac (27-inch, Late 2012) running Mojave (all recent versions as released).

Easy to reproduce and doesn't seem related to sleep/locking the computer.

1. Use Firefox in one Mac user account
2. Allow computer to sleep ===> All normal on wakeup
3. Lock screen (^Command-Q) ===> All normal on unlock
4. Switch to a new user account
5. Switch back to original account
6. Firefox unresponsive. Cannot use Gecko Profiler.

Wondering if this is a different bug to the one originally raised and if so, should a new bug be raised?

I can confirm that this bug is replicable by switching users in Mojave.

Sorry, hit save too soon. 2018 MacBook Pro 15", Mojave with latest updates, Firefox Quantum 65.0. The lack of responsiveness happens every time I use fast switch between users.

I should note that this bug doesn’t reproduce when WebRender is
enabled (flip gfx.webrender.all in about:config to true and restart
Firefox).

(In reply to Andreas Tolfsen ⦗:ato⦘ from comment #11)

I should note that this bug doesn’t reproduce when WebRender is
enabled (flip gfx.webrender.all in about:config to true and restart
Firefox).

Thanks, does that require Nightly? Not listed in config for 65.0.1

Reproducible for me even with gfx.webrender.all enabled. Firefox cpu usage is >100% for a couple of minutes after waking up the Mac.

I experience the unresponsiveness after locking as well (MacOS Mojave 10.14.5, Firefox 67.0.4 but also with earlier versions). Nothing in Firefox reacts to clicks including the menu (except for the "Firefox" menu). Might be interesting to know that I have the same problem exists in Thunderbird 60. But I have not witnessed this in any other application.

(In reply to Brandon from comment #7)

II installed the Gecko Profiler and captured the above. But 10 minutes after clicking "Capture Profile" it says "We were unable to connect to the Gecko
profiler add-on within thirty seconds. This might be because the profile is big or your machine is slower than usual. Still waiting..." Tried it a
second time and same result.

(reference comment 6)

Before starting the profiler, change the profile interval from 1ms to something like 20 or 30 (don't forget to hit apply)

Flags: needinfo?(xracoonx)
Flags: needinfo?(roman.shevtsov)
Flags: needinfo?(brandonadams)
Keywords: perf
Blocks: 1515260

Using MacOS Mojave 10.14.6 and Firefox 68.01.

I had a good number of tabs open in Firefox; my computer went to sleep when it became idle.
When I logged in, none of the tabs and address bar was responding.

My workaround has been to just shut down and re-open Firefox again.

Product: Firefox → Core

Just another curiosity about this bug, or at least how it manifest on my system (macOS latest updates):

It seems that Firefox responds to clicks but does not refresh the UI. For example, if I click on a tab, Firefox does now show the newly selected tab. However, if I drag the address bar, it shows the newly selected address transparent under the cursor. So, it seems that Firefox still responds but does not refresh the main window.

None of the additional circumstances note in the report, i.e.

  • Two external displays
  • Two Firefox windows - One on an external screen and another one on the MacBook
  • Some pages that are always open: GMail, Google Calendar, IRCCloud, Slack, Hangouts, GitHub, Bugzilla

is relevant to reproduce the problem on my side. Though for me it is not just a multiple second delay but the UI is not refreshed at all.

Some more strangeness: I can actually get Firefox to update its UI by focusing another application's window and switching back to Firefox. For example, if I click on non-active tab on Firefox, press Alt-Tab to focus the next application, press Alt-Tab again to focus Firefox again, then Firefox shows the content of that tab. It's still non-functional in that it does not update on clicks though. Updates will only happen after focusing another application.

Whiteboard: [needs profile]

Just chiming in to report I've experienced this as well, across multiple Mac machines, OS versions and Firefox versions. The steps to reproduce and setup is more or less identical to OP.

While this bug thread isn't exactly blowing up with popular demand, this issue appears to be affecting a non-trivial share of Firefox users on Mac, see eg

https://old.reddit.com/r/programming/comments/doib7b/firefox_70/f5on6tb

My guess is that Mac users who experience this when trying out Firefox simply conclude Firefox is a dud and go right back to Chrome without commenting on this thread. Who knows how large a share of potential userbase gets lost as a result?

Really hope a fix for this gets released soon!

Chiming in to note that I just switched over to FF from Chrome on Mac, and the issue is happening here as well when switching between user accounts. FF appears to accept clicks and shows menu actions (e.g., confirmation if Cmd-Q is invoked), but the main window is blank and does not update at all. Quitting and restarting after changing user accounts is required here.

Component: General → Widget: Cocoa
Priority: -- → P2

My problem is pretty much exactly the same as Brandon's (Comment 7). I am using Firefox 75.0 (but have been having the same problem for awhile now, so certainly going back a bunch of versions), and I am on Mac OS X 10.11.6 (El Capitan), on a Mac mini mid-2011. Not sure this is relevant, but I have a lot of tabs open on one user, fewer on the second user, various Firefox extensions on both. I don't think that matters, because it happens when switching in both directions (user 1 to 2, or user 2 to 1).

I cope by fast switching from user 1 to user 2 (Firefox unresponsive), then switching back to user 1, then back to user 2 (Firefox responds normally).

It's annoying...

Flags: needinfo?(roman.shevtsov)

I am still experiencing the problem of my FF browser freezing.
-> MacBook Pro ; macOS Catalina (10.15.4) ; Firefox 76.0.1 (64-bit)
-> Connected to external monitor only (i.e. the MacBook lid is closed)
-> 2 active users, both with FF browser opened
-> logged in FF with the same user account (synchronising account info)
-> using the LastPass plugin and the Facebook container.
Note: I have also experienced the 'freezing' without being logged in to my FF account and without any of the plugins activated.

Observed behaviour:
My FF browser keeps freezing when unlocking and/or switching accounts; I believe that the problem mainly (only?) occurs after a certain period of inactivity.
Alternatively clicking on the desktop and the FF browser allows me to close FF tabs or perform one single action (at the time) in the selected tab.
I need to close FF completely and restart, which is extremely annoying as very often I am in a remote session.

Does a workaround/fix exist for this problem?

I am really surprised that Mozilla seems to completely fail (or ignores?) to fix the root cause of this problem. Until then I will go back to some other shitty browser.

It's more than annoying, it sh*t!

/F

(In reply to fre.and.fri@gmail.com from comment #21)

Just chiming in to report I've experienced this as well, across multiple Mac machines, OS versions and Firefox versions. The steps to reproduce and setup is more or less identical to OP.

While this bug thread isn't exactly blowing up with popular demand, this issue appears to be affecting a non-trivial share of Firefox users on Mac, see eg

https://old.reddit.com/r/programming/comments/doib7b/firefox_70/f5on6tb

My guess is that Mac users who experience this when trying out Firefox simply conclude Firefox is a dud and go right back to Chrome without commenting on this thread. Who knows how large a share of potential userbase gets lost as a result?

Really hope a fix for this gets released soon!

This problem has been around for years; it's classified as a P2. Wondering if anyone actually does something about them or if they just wait until the issues goes away by itself...

It would still be great to get a profile when Firefox is under such a situation. Documentation and step-by-step assistance can be found at https://profiler.firefox.com/. Please share such a profile with us. Thanks.

I have the same problem on 76.0.1 macOS catalina 10.15.4
Firefox is alive but the display is frozen.
I can make a new tab, but the screen does not refresh.
I can make a new window and the window works ok

Hi there,

New member and long-time user of Firefox.

I've been having this issue for a while now. I always thought it was to do with my 9-year-old MacBook Air, but I have a new MacBook Pro 2020 model which I got this week and have had the exact same thing happen today:

I've been using Firefox for maybe 20 minutes. I have about 4 tabs open. I put the computer to sleep and come back it in a bit. Firefox window is frozen (I can still see the current tab but when I click on another tab, nothing happens. I can minimise the app and maximise it again, but that's it. I keep trying a tab and nothing happens. After a few minutes, it changes to another tab but then stays stuck on that one. Usually on my old MacBook Air, it'd start working again, but today on the MB Pro, it wouldn't, so I had to quit the app completely.

I saw another bug thread about this, which I found via a Google search...but that thread was closed. I think that thread was blaming PowerNap in Max OSX, but I don't have PowerNap enabled at all. Unlike the user in the post above, I can't even make a new tab whilst it's frozen, I just can't do anything except minimising the app to the dock and then clicking on it again. There wasn't a crash as such, so I don't even have a crash report.

I'm on Mac OSX Catalina 10.15.6. Has anyone got to the bottom of the problem, at all? I really like Firefox but if this is going to keep on happening, I may have to switch to Safari or Chrome.

Thanks,

-Zak

Zak, would you mind to attach a sample from the Firefox parent process through the Activity Monitor to that bug while Firefox is in such a state? That might already give us an idea what's going wrong. Thanks a lot.

Flags: needinfo?(zakashraf)

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #29)

Zak, would you mind to attach a sample from the Firefox parent process through the Activity Monitor to that bug while Firefox is in such a state? That might already give us an idea what's going wrong. Thanks a lot.

Hi Henrik,

Thank you for responding.

Can you please advise how I can get a sample from the Firefox parent process? This is my first time on this forum, and reporting a Firefox bug at that. Also, can I only get the sample when the issue occurs? The issue occurred again the other day, but I could only minimise the app to dock and then bring it back up again. Occasionally it'd switch to one tab very slowly but then it'd get stuck on that one. This is in Catalina. On my old MBA 11" which is on High Sierra, after a few minutes it'd become useable again. Not in Catalina, though - I have to quit the app and reopen it.

Best,

-Zak

Sure, I can do. Yes, the issue has to happen in Firefox when you want to sample the process. So here the steps:

  1. Open the Activity Monitor and set a filter (search term) for Firefox
  2. Try to get Firefox into the freeze state
  3. Select the Firefox process in the Activity Monitor that doesn't contain Web Content
  4. Click the gear icon in the toolbar and select Sample Process
  5. A new window opens. Wait until the sampling is done, and click Save...
  6. Upload the created file as attachment to this bug

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #31)

Sure, I can do. Yes, the issue has to happen in Firefox when you want to sample the process. So here the steps:

  1. Open the Activity Monitor and set a filter (search term) for Firefox
  2. Try to get Firefox into the freeze state
  3. Select the Firefox process in the Activity Monitor that doesn't contain Web Content
  4. Click the gear icon in the toolbar and select Sample Process
  5. A new window opens. Wait until the sampling is done, and click Save...
  6. Upload the created file as attachment to this bug

Thanks Henrik. Just a few questions:

  1. Should I have Activity Monitor open all the time whilst I'm waiting for the bug to happen, or can I open it after the issue occurs?
  2. On point 3 above which asks me to select the Firefox process in the Activity monitor which doesn't contain 'web content', when the problem occurs, are you expecting there to be just one process which doesn't contain 'Web Content'? I ask because whilst I type this and look at activity monitor, I see a number of 'web content' processes, one for 'webextensions', one for 'priveleged content' and one process which is just 'Firefox' which has the Firefox logo next to it. Is it the latter you're referring to, or should I be looking for a process which appears when it's broken?

Best,

-Zak

Flags: needinfo?(zakashraf)

It doesn't matter when you open it. So feel free to do so whenever you want. And regarding the correct Firefox process you are correct that there are more then just only web content processes. So indeed you have to record the samples for the plain Firefox process. For verification it should usually also have the lowest PID given that it spawns all the other ones.

Provided for Henrik.

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #33)

It doesn't matter when you open it. So feel free to do so whenever you want. And regarding the correct Firefox process you are correct that there are more then just only web content processes. So indeed you have to record the samples for the plain Firefox process. For verification it should usually also have the lowest PID given that it spawns all the other ones.

Hi Henrik,

So Firefox froze a short moment ago, my system had only been on the login screen for a few minutes and when I'd returned, it was stuck. However, I think by the time I saved the process, it had started working again. In any case, I've attached it to this thread. Please let me know if this is okay, or if I need to try to save a process again when it's frozen.

Thanks,

-Zak

I see the same problem with 80.0.1 on Mojave. It usually happens when switching back to my user account, where a Firefox session was open some time. I'm attaching a screenshot of the profiler, which is somewhat difficult to obtain, because Firefox is unresponsive, I press shift-control-1, try to switch tabs, then press shift-control-2, then minimize and un-minimize again, after repeating a couple of times, I get to see what's in the screenshot. Also the sample from Activity Monitor.

Screenshot of profiler.

Attached file Sample of Firefox.txt

Sample from Activity Monitor.

(In reply to Zak from comment #35)

So Firefox froze a short moment ago, my system had only been on the login screen for a few minutes and when I'd returned, it was stuck. However, I think by the time I saved the process, it had started working again. In any case, I've attached it to this thread. Please let me know if this is okay, or if I need to try to save a process again when it's frozen.

So you clearly have to get Firefox into that hang state and only sample then. Otherwise the expected information will not be found in the output. Also what I forgot, can you both please save the output after having selected "Per cent of parent" in the drop down?

It might be related to the screen saver. When I lower the screen saver timeout to 1 minute, open Firefox, switch to another user, then wait 2 minutes, then switch back, I can reliably reproduce the freeze.

When I start the profiler before switching, I can't reproduce the freeze. Somehow, the running profiler prevents the freeze.

Starting the profiler after the freeze also seems to get the freeze "unstuck".

I'm attaching a new set of sample and profiler screenshot.

Display: Per Cent of Parent doesn't seem to affect the saved file, only the display on screen. Attaching a screenshot, too.

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #39)

(In reply to Zak from comment #35)

So Firefox froze a short moment ago, my system had only been on the login screen for a few minutes and when I'd returned, it was stuck. However, I think by the time I saved the process, it had started working again. In any case, I've attached it to this thread. Please let me know if this is okay, or if I need to try to save a process again when it's frozen.

So you clearly have to get Firefox into that hang state and only sample then. Otherwise the expected information will not be found in the output. Also what I forgot, can you both please save the output after having selected "Per cent of parent" in the drop down?

Thanks, Henrik. I'll aim to do this next time, and can hopefully save in time before it fixes itself.

(In reply to daniel from comment #40)

It might be related to the screen saver. When I lower the screen saver timeout to 1 minute, open Firefox, switch to another user, then wait 2 minutes, then switch back, I can reliably reproduce the freeze.

When I start the profiler before switching, I can't reproduce the freeze. Somehow, the running profiler prevents the freeze.

Starting the profiler after the freeze also seems to get the freeze "unstuck".

I'm attaching a new set of sample and profiler screenshot.

Interesting, thanks for the feedback. If the Activity Monitor app fixes the issue, that is rather weird. When you refer to screensaver here, are you responding to an actual screensaver? I have screensaver turned off, but my monitor light goes off after a minute or two.

(In reply to Zak from comment #46)

Interesting, thanks for the feedback. If the Activity Monitor app fixes the issue, that is rather weird. When you refer to screensaver here, are you responding to an actual screensaver? I have screensaver turned off, but my monitor light goes off after a minute or two.

Not the activity monitor app, but the Firefox profiler. When it's enabled and gathering data (with shift-ctrl-1) before switching users, it seems to prevent the freeze.

In System Preferences / Desktop & Screen Saver / Screen Saver tab, I have "Flurry" selected, Start after: 1 Minute, ( ) Show with clock, ( ) Use random screen saver. This is on the user account that runs firefox, not the user account I'm switching to. After switching users, I keep interacting (like opening Activity Monitor, draging around its window), the screen saver never gets visible. I would assume the screen saver of the background user should not trigger at all, but for some reason, it seems to help reproduce the problem.

(In reply to daniel from comment #47)

(In reply to Zak from comment #46)

Interesting, thanks for the feedback. If the Activity Monitor app fixes the issue, that is rather weird. When you refer to screensaver here, are you responding to an actual screensaver? I have screensaver turned off, but my monitor light goes off after a minute or two.

Not the activity monitor app, but the Firefox profiler. When it's enabled and gathering data (with shift-ctrl-1) before switching users, it seems to prevent the freeze.

In System Preferences / Desktop & Screen Saver / Screen Saver tab, I have "Flurry" selected, Start after: 1 Minute, ( ) Show with clock, ( ) Use random screen saver. This is on the user account that runs firefox, not the user account I'm switching to. After switching users, I keep interacting (like opening Activity Monitor, draging around its window), the screen saver never gets visible. I would assume the screen saver of the background user should not trigger at all, but for some reason, it seems to help reproduce the problem.

Thanks for explaining.

FAO Henrik

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #39)

(In reply to Zak from comment #35)

So Firefox froze a short moment ago, my system had only been on the login screen for a few minutes and when I'd returned, it was stuck. However, I think by the time I saved the process, it had started working again. In any case, I've attached it to this thread. Please let me know if this is okay, or if I need to try to save a process again when it's frozen.

So you clearly have to get Firefox into that hang state and only sample then. Otherwise the expected information will not be found in the output. Also what I forgot, can you both please save the output after having selected "Per cent of parent" in the drop down?

Hi Henrik,

I just had the hanging issue now, and thankfully opening Activity Monitor didn't cure it, so I was able to save the process and selected 'per cent of parent' in the dropdown. Please see my latest attachment.

I'm hoping this helps in finding a solution to this problem.

Best,

-Zak

Here's how I can reproduce the freeze reliably with 81.0 on Mojave, with all add-ons disabled:

  1. I have two user accounts ("mine" and "other").
  2. My account has a 1 minute screen saver timeout (as described above).
  3. Starting on my account, I close all Firefox instances, and start a fresh one.
  4. First I open https://bugzilla.mozilla.org/show_bug.cgi?id=1415923
  5. Then I open http://old.reddit.com/ in a second tab, so this is the visible tab
  6. I switch to the other account
  7. I wait 2 minutes, doing nothing
  8. I switch back to my account
  9. I still see the open tab, but when I try to click on the first one, nothing happens. Stuck. When I focus another application, Firefox processes some events, but still doesn't react to further clicks. It looks like it's processing one event when it looses focus, nothing else.

This is a Mac mini (Late 2014) with an Intel Iris graphics card, the Activity Monitor Sample Process output shows Intel related gl* in the stack of the Compositor thread, after step 5), in case that matters.

After updating Mac OS 10.15.7, I am having this problem multiple times a day

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