Firefox locks up after downloading file
Firefox runs fine most of the time. If I right-click to download an image, or click a link to download a PDF or other file, or Save HTML, I see the "Save file" dialog, click Save and then Firefox freezes up for a while, maybe a minute or two. Pages won't scroll. I can't switch tabs. I can bring up a different firefox window and it redraws its contents, but I can't scroll or do anything else.
This didn't happen a month ago, then one day after a system upgrade, it happens every time. I'm using FF 123.0.1 on Arch Linux. 64GB RAM, so it's not a memory shortage. I have upgraded one or two times more since the upgrade when this appeared. Chromium is not affected, Thunderbird is fine, and all other software continues to be fine as before, including when saving files. Only FF has this problem.
What is the problem and solution? Are there ways to gather more info to diagnose the problem, if needed?
All Replies (9)
Try changing widget.use-xdg-desktop-portal.file-picker to 0 in about:config then restart the browser.
Try using native Wayland by setting the MOZ_ENABLE_WAYLAND=1 environment variable.
Does it still happen with the flatpak package?
I have set that file_picker value to 0 and to 1. For 1, a file dialog never shows up, and as far as I can tell, a file never is saved. 0 works just like 2. One time I restarted Firefox in Troubleshoot Mode, I forgot how I managed to do that, but it ran fine. Files saved immediately and the page scrolled and tabs switched like normal. Apparently the Troubleshoot Mode turns itself off next time Firefox restarts. If I could turn it on permanently, I'll be happy except maybe for whatever side effects it has I'll learn about the hard way later.
Sounds like a job for strace. To see what happens after downloading a file run the below. Close the browser and then run the cmd and repeat the process that causes the lock up.
strace -t -o firefox_debug.txt firefox &
At the end of the file firefox_debug.txt you should see the reason for the lock up. Sometimes the results are easy to read, but there are times where Devs need to translate.
What OS? What Desktop? X11 or Wayland?
There's a list of what "Troubleshoot Mode" turns off. I worked through it one by one, didn't finish, but found that hardware acceleration, when turned off, makes the problem go away.
Okay, I can turn it off and leave it off. But I vaguely remember having to turn it on for some reason two or three years ago. It's especially puzzling how, with it on for a couple years, this problem came up only around a month ago.
Endret
You can try Firefox from the official Mozilla server if you currently use a version from the repositories of your Linux distribution to see if it behaves differently.
Daren Scot Wilson said
this problem came up only around a month ago.
You can test older versions with mozregression to find when it first started.
I'm using Arch Linux. AFIK, using X11 no Wayland. Maybe some package update turned on the Hardware Acceleration, but I doubt that. More likely I changed it for some reason now forgotten. It could have been on a long time, but some FF update introduced a bug. I have a zillion files and browsers up to work on stuff, but when I have time, I'll try mozregression and try running with strace with HW Acceleration on, but I won't be getting to it today or tomorrow.
Daren Scot Wilson said
I can bring up a different firefox window and it redraws its contents
Install Developer Edition (early beta) and you may be able to recover by clicking the "Trigger Device Reset" button in about:support (when the problem occurs, the label appears as "gpu-device-reset" and the button as "undefined").