You are not logged in.

#1 2022-04-10 08:24:27

musbur
Member
Registered: 2022-01-14
Posts: 46

[SOLVED] Firefox takes 30 seconds to start

Hello,

like the subject says: Whenever I start Firefox, it takes literally more than half a minute to start up. Here's what I tried, all without success:
- Delete cache/data
- Create a new user on same system to start with a completely clean slate
- Unmount all NFS drives
- Close and immediately restart Firefox (second time takes just as long as first)

Nothing makes the slightest bit of diference. The rest of the system runs fine, also other large and slowish apps (Gimp, KDEnlive, Digikam) don't show any similar symptoms

Of course I don't know which activity coincides with the onset of the problem. It's one of those things that needs to happen a few times to start to annoy you, and by that time you don't remember what I did before. At least I don't.

Last edited by musbur (2022-04-11 15:59:23)

Offline

#2 2022-04-10 10:30:32

-thc
Member
Registered: 2017-03-15
Posts: 486

Re: [SOLVED] Firefox takes 30 seconds to start

It sounds vaguely like firefox cannot reach some network resources.

Do you have a dual stack IPv4/IPv6 environment? Check if all servers are also reachable via IPv6.

Do you have a DNS or URL filter (DNS black hole, router blacklist etc.)? Does it block access to firefox' "internal" network?

Offline

#3 2022-04-10 12:45:15

seth
Member
Registered: 2012-09-03
Posts: 50,009

Re: [SOLVED] Firefox takes 30 seconds to start

There was https://bbs.archlinux.org/viewtopic.php … 0#p2030390 and "30 seconds" is suspiciously close to the 25s dbus timeout (repo FF or a flatpak?)
You could also strace firefox to see where it hangs.

Online

#4 2022-04-10 18:09:22

musbur
Member
Registered: 2022-01-14
Posts: 46

Re: [SOLVED] Firefox takes 30 seconds to start

seth wrote:

There was https://bbs.archlinux.org/viewtopic.php … 0#p2030390 and "30 seconds" is suspiciously close to the 25s dbus timeout (repo FF or a flatpak?)
You could also strace firefox to see where it hangs.

Yeah, I already thought of that, too. Turns out that the startup hangs at a poll() system call that times out after 25 seconds. I found that starting up evince takes 50 seconds to start because it does the same call twice. Maybe this gives some insight:

~$ strace evince > strace_evince 2>&1
~$ egrep '= 11|poll.*fd=11' strace_evince

[...]
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 11
poll([{fd=11, events=POLLIN}], 1, 25000) = 1 ([{fd=11, revents=POLLIN}])
poll([{fd=11, events=POLLIN}], 1, 25000) = 0 (Timeout)
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 11
poll([{fd=11, events=POLLIN}], 1, 25000) = 1 ([{fd=11, revents=POLLIN}])
poll([{fd=11, events=POLLIN}], 1, 25000) = 0 (Timeout)
[...]

One whole "usage cycle" of such a file descriptor created by eventfd2 looks like this:

eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 11
write(11, "\1\0\0\0\0\0\0\0", 8)        = 8
write(10, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x56288ba9c030, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x56288bae3170, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x56288ba951d8, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=11, events=POLLIN}], 1, 25000) = 1 ([{fd=11, revents=POLLIN}])
read(11, "\1\0\0\0\0\0\0\0", 16)        = 8
poll([{fd=11, events=POLLIN}], 1, 25000) = 0 (Timeout)
write(11, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x56288bb65720, FUTEX_WAKE_PRIVATE, 2147483647) = 0
close(11)                               = 0

Does this make sense to anybody?

Offline

#5 2022-04-10 18:10:28

musbur
Member
Registered: 2022-01-14
Posts: 46

Re: [SOLVED] Firefox takes 30 seconds to start

-thc wrote:

It sounds vaguely like firefox cannot reach some network resources.

Do you have a dual stack IPv4/IPv6 environment? Check if all servers are also reachable via IPv6.

Do you have a DNS or URL filter (DNS black hole, router blacklist etc.)? Does it block access to firefox' "internal" network?

It doesn't seem to be limited to firefox. Evince (PDF viewer) even takes 50 seconds, see my other answer in this thread.

Offline

#6 2022-04-10 18:23:42

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Firefox takes 30 seconds to start

25 seconds is the default dbus timeout.
How are you starting your session?
Can you post the output of...

loginctl

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2022-04-10 18:48:44

musbur
Member
Registered: 2022-01-14
Posts: 46

Re: [SOLVED] Firefox takes 30 seconds to start

I'm using dwm without a graphical login. The session is started by .xsession. There's nothing funny in my startup; in fact when I create a completely "blank" user with an empty home dir and do "sx firefox" it does the same thing.

~$ loginctl
SESSION  UID USER SEAT  TTY
      1 1000 dh   seat0 tty1

1 sessions listed.

Last edited by musbur (2022-04-10 18:53:05)

Offline

#8 2022-04-10 19:15:50

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Firefox takes 30 seconds to start

So you aren't launching the required dbus session then. Read...
https://wiki.archlinux.org/title/Xinit


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2022-04-11 15:59:01

musbur
Member
Registered: 2022-01-14
Posts: 46

Re: [SOLVED] Firefox takes 30 seconds to start

Slithery wrote:

So you aren't launching the required dbus session then. Read...
https://wiki.archlinux.org/title/Xinit

Yup, that did it. I installed xinit which gave me startx. When I replaced "sx" with "startx" in my .zprofile, everything worked fine. Thanks a lot!

BUT.... why did it work before? Just a few weeks ago I had something where I ran Evince all the time and it started up without delay.

Offline

#10 2022-04-11 19:11:39

seth
Member
Registered: 2012-09-03
Posts: 50,009

Re: [SOLVED] Firefox takes 30 seconds to start

You can use dbus-monitor to track what service is being called by those programs on startup.
But having a broken session is never good and has more implications (w/o the active session you can't shut down the system as regular user, you have insufficient permissions on some devices etcetc.)
To be sure, please post the updated output of "loginctl session-status" and see the last link below (because whether sx or startx - /etc/X11/xinit/xinitrc.d/50-systemd-user.sh is what logind-activates your session)

Online

Board footer

Powered by FluxBB