You are not logged in.

#1 2022-11-02 10:02:03

doragasu
Member
Registered: 2012-03-03
Posts: 160

[SOLVED] Huge startup delay on some desktop applications

I have a desktop with a Ryzen 3700X and 32 GiB RAM that works really well with Arch most of the time, but I have a problem causing some applications to have a HUGE startup delay (30+ seconds, with some cases like Telegram desktop client taking almost 2 minutes).

Some applications suffering this startup delay problem:
* firefox
* telegram-desktop
* file-roller
* inkscape

Some applications that do not have this problem
* kicad
* freecad
* chromium
* pcmanfm
* gimp
* prusa-slicer

I am having a hard time trying to figure out what is causing this huge delay. When this startup freeze occurs, the application does not take any CPU. Straceing all affected applications show them waiting for an event that never arrives on a poll() with a 25 second timeout. This is e.g. from a file-roller strace (and this happens twice on that strace):

eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 13
write(6, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x7f6db8015740, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f6db80154d0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f6db800d0c8, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=13, events=POLLIN}], 1, 25000) = 0 (Timeout)

But all other applications having the problem show a similar poll with the 25 second timeout. This happens the same on i3-wm (Xorg) and sway-wm (Wayland). I have suspected fontconfig, but could not make the problem go away by playing with font configuration. Also revised my /etc/hosts config (as this is listed as a possible cause of startup delays of Firefox in the wiki).

So I am clueless now and this problem is very annoying sad

Last edited by doragasu (2022-11-02 15:33:57)

Offline

#2 2022-11-02 11:25:12

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

Re: [SOLVED] Huge startup delay on some desktop applications

What;s the output of...

hostnamectl

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

#3 2022-11-02 11:53:17

doragasu
Member
Registered: 2012-03-03
Posts: 160

Re: [SOLVED] Huge startup delay on some desktop applications

jalon ~ $ hostnamectl
 Static hostname: zen2
       Icon name: computer-desktop
         Chassis: desktop ?️
      Machine ID: <redacted>
         Boot ID: <redacted>
Operating System: Arch Linux                      
          Kernel: Linux 6.0.5-arch1-1
    Architecture: x86-64
 Hardware Vendor: ASUSTeK COMPUTER INC.
  Hardware Model: PRIME X570-P
Firmware Version: 1005

Offline

#4 2022-11-02 13:04:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED] Huge startup delay on some desktop applications

waiting for an event that never arrives on a poll() with a 25 second timeout

That's some dbus timeout.
flatpak/xdg-portal is known to cause this

This happens the same on i3-wm (Xorg) and sway-wm (Wayland)

Depending on how you start the session, your session bus might be broken (see the last link below for startx/xinit)

Offline

#5 2022-11-02 15:33:38

doragasu
Member
Registered: 2012-03-03
Posts: 160

Re: [SOLVED] Huge startup delay on some desktop applications

Wow thanks, you nailed it! I don't have flatpak installed in my system, but had xdg-desktop-portal xdg-desktop-portal-gtk and xdg-desktop-portal-wlr. I removed them (and also rtkit that depended on them) and now applications start instantly as they should!

I don't know why I had them installed, but so far it seems everything runs fine without them.

Again, thanks!

Offline

#6 2022-11-02 15:55:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED] Huge startup delay on some desktop applications

The xdg-portal-stuff is only relevant for flatschpak, iirc the software management tools of the bigger DEs (gnome-software/kde discover?) draw that as optional dependency.

Offline

#7 2022-11-02 17:23:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,300

Re: [SOLVED] Huge startup delay on some desktop applications

It's also used for screen sharing on wayland (... and native file dialogs in browsers), likely the more direct issue is having multiple portal implementations/afaik the gtk one tends to be problematic/logically unmaintained. Does the issue return if you opt for just -wlr ?

Offline

#8 2022-11-03 17:09:28

doragasu
Member
Registered: 2012-03-03
Posts: 160

Re: [SOLVED] Huge startup delay on some desktop applications

Reinstalled xdg-portal and xdg-portal-gtk and the bug happens again (even without the -wlr package).

Offline

#9 2022-11-03 17:19:37

doragasu
Member
Registered: 2012-03-03
Posts: 160

Re: [SOLVED] Huge startup delay on some desktop applications

Curiously enough, today I was talking to a friend that is suffering the same problem, but he needs those packages in order for Cura slicer to work (if he uninstalls them, Cura is not able to open file dialogs).

Offline

#10 2022-11-03 17:24:25

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,300

Re: [SOLVED] Huge startup delay on some desktop applications

which is why I mentioned the -gtk package is likely causing issues and you should try -wlr on it's own (at least on sway) FWIW I have none of these issues on KDE with the -kde portal.

Offline

#11 2022-11-03 17:34:14

doragasu
Member
Registered: 2012-03-03
Posts: 160

Re: [SOLVED] Huge startup delay on some desktop applications

Oh I understood the other way around. Tried installing xdg-desktop-portal and xdg-desktop-portal-wlr and it seems it works under sway (I have not tested under i3). Thanks (although I think I will uninstall them since I think I don't need them).

Offline

Board footer

Powered by FluxBB