Firefox loading S..l..o..w

openSuse 15.1
KDE desktop
Firefox 78.1

A week or so ago, firefox suddenly decided to load quite slow. I’m used to click…pop. Now I have click…(7 seconds)… pop
I don’t know of any changes I made before noticing this.
If I log in as a different user, it is the same amount of time to load.
I tried the refresh process firefox recommended without any change.

When I click on the firefox icon, I get the bouncing icon that finally goes away (it normally does after about 5 seconds) and it still takes nearly 2 seconds longer to load. Once up, it operates normally.

Is there a way to start firefox and watch what is happening while it’s loading?

Bart

I’m currently using Firefox 78.0.2esr (openSUSE Leap 15.2) and not observing any startup issues. Try launching from a terminal, or perhaps with safemode enabled

firefox -safe-mode

Didn’t make any difference.

My wife’s computer doesn’t have this problem and my laptop doesn’t have a problem. If I log in as another user on my machine, I still have the problem. It’s something on my computer. And it’s annoying!

Bart

Ok, but I thought you might post back with output after launching from the terminal.

I opened a treminal and entered, as you suggested, firefox -safe-mode. After about 7 seconds, firefox appeared on my screen but there was no output on the terminal. That’s why I didn’t post anything.

Let me try it again…

Yup! After firefox appears on my screen, I get the prompt back.

Bart

$ strace firefox

WOW! Stuff just scrolled off the top of the window! There’s a TON of connection timed out and resource not available messages. At first look, it seems like it’s trying a lot of commands over and over. Any idea what I’m looking for?

Bart

Why can’t I redirect the output to a file with:

bart@UNIVAC:~> strace firefox > /home/bart/strace-output

It creates the file but it has nothing in it.

Bart

No idea. Do a first pass exploring stuff, then check out man strace how to filter syscall categories, for instance. I usually grep around.

It’s because it writes to stderr (fd 2). Instead use strace -o filename ..., or use this snippet to mark output with a timestamp:

strace firefox 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S]"), $0 }' 

Well, finally!

After putting up with this issue for far too long, and thanks to awerlang, I found out what was going on. I had to add to the suggested command and redirect it to a file as there was over 22,000 lines of messages. I opened the file in a text editor so I could use the search function and found that firefox was trying to access a file in /tmp/firefox over and over but was denied access to that file.

Looking at the permissions for that directory, I found that it was owned by root and the group was also root. However, the permissions were for read/write for owner, group and others. Looking further though, the directory was not set to set the same permissions for files created in that folder. As soon as I changed that setting firefox loads like it should.

Looking at other computers on my system, there is a different path shown. It is my feeling that, as my computer has been upgraded since version 13 something and the others have had a fresh install for version 15, that the file paths had changed and firefox was using an older path on my system but they had missed setting the permissions properly during an update.

Anyway, it’s fixed! Thank you all for your help with this annoying problem.

Bart

I am not quite undrstand what is/was wrong in your system, but because tinkering with ownership and/or permission of system files (like /tmp) is rather dangerous, here is what it should be:

boven:~ # ll -d /tmp
drwxrwxrwt 16 root root 340 Oct 28 09:45 /tmp
boven:~ # 

Mind the last character of the persmissions: t.

Assuming that, “/tmp” has been mounted correctly, the protections on “/tmp” have to be as follows:


 > LANG=C stat /tmp
  File: /tmp
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 811h/2065d      Inode: 2           Links: 41
Access: (1777/drwxrwxrwt)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-10-28 12:16:55.402737721 +0100
Modify: 2020-10-28 12:22:19.898330898 +0100
Change: 2020-10-28 12:22:19.898330898 +0100
 Birth: -
 > 

NB: the “T” bit …

Any user directories present in the directory “/tmp/” – especially those used by Mozilla/Firefox – usually have protections as follows:


 > LANG=C stat /tmp/mozilla_???0
  File: /tmp/mozilla_???0
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 811h/2065d      Inode: 81922       Links: 2
Access: (0700/drwx------)  Uid: ( 1000/     ???)   Gid: (  100/   users)
Access: 2020-10-26 12:53:38.362153364 +0100
Modify: 2020-10-16 09:46:06.737240565 +0200
Change: 2020-10-26 12:53:38.362153364 +0100
 Birth: -
 > 

The file permissions on /tmp are as you recommend. Thay is, the t is there at the end.
However,
there are no /tmp/mozilla* folders in /tmp. My system has only a /tmp/firefox folder there that relates to firefox. The permissions are drwxrwxrwt
If I set them to drwx------ as you show, then firefox is back to taking 5 or more seconds to load.

I ran

strace firefox 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S]"), $0 }'>straceoutput

and in the output was the section

stat("/tmp/firefox", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat("/tmp/firefox/.parentlock", 0x7ffdc6428800) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/tmp/firefox/.parentlock", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
lstat("/tmp/firefox/lock", 0x7ffdc64281f0) = -1 EACCES (Permission denied)
uname({sysname="Linux", nodename="UNIVAC", ...}) = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=647, ...}) = 0
getpid()                                = 10981
symlink("192.168.3.5:10981", "/tmp/firefox/lock") = -1 EACCES (Permission denied)
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=791902000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792021000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792084000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792147000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792211000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792275000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792339000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792403000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb7b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=792467000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
stat("/tmp/firefox", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat("/tmp/firefox/.parentlock", 0x7ffdc6428800) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/tmp/firefox/.parentlock", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
lstat("/tmp/firefox/lock", 0x7ffdc64281f0) = -1 EACCES (Permission denied)
uname({sysname="Linux", nodename="UNIVAC", ...}) = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=647, ...}) = 0
getpid()                                = 10981
symlink("192.168.3.5:10981", "/tmp/firefox/lock") = -1 EACCES (Permission denied)
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=892793000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=892967000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=893078000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=893185000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=893252000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=893319000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=893386000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0616dbb1b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1596814602, tv_nsec=893453000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f062c14f450, FUTEX_WAKE_PRIVATE, 1) = 0

This block was repeated 50 plus times over the course of nearly 4 seconds. I keep seeing the permission denied message when the file in /tmp/firefox was trying to be accessed. As I stated, it takes about 5 seconds for firefox to come up on my screen and only about 1 second when I allow access.

Perhaps I should just backup my boolmarks, uninstall firefox, do a find as root for anything that has firefox or mozill* on my system and remove it and then reinstall firefox. The fact that my system has a firefox directory and none of my other computers have one but rather a mozilla directory leads me to think my system is too old.

I see you’ve already tried starting in “safe mode”, but you could, with firefox closed, try temporarily renaming your firefox profile from “~/.mozilla” to, for example, “~/.mozilla-saved” Then restart firefox to see if the problem persists.

Yes, but, who is the owner of “/tmp/firefox”?

  • If it’s “root” then, it needs “group” and “other” (“world”) “rwx” permissions …

Yes, both owner and group were root. But rwx was not set on the firefox file. I changed it and firefox worked correctly, but I understood the previous postings to say that it should not be that way. Anyhow, I had some other issues and did a wipe of / and a fresh install.

Thanks
Bart

Maybe /tmp/firefox is gone for good now. I do not have it. In any case, as long as root does not use firefox (which root of course should never do), I do not see how such a file can be created.