You are not logged in.

#1 2018-08-05 21:15:30

Digwer
Member
Registered: 2017-01-07
Posts: 10

[SOLVED]gtk3 apps slow start

Hello,

Got a problem with gtk3 apps (evince, gedit, gtk3-demo etc.): the start of the apps is painfully slow - around half minute. Can't really tell since when this is started.

First of all, started straced evince "strace -r evince" and noticed what was taking so long:

     ...
     0.001237 poll([{fd=11, events=POLLIN}], 1, 25000) = 1 ([{fd=11, revents=POLLIN}])
     0.000245 read(11, "\1\0\0\0\0\0\0\0", 16) = 8
     0.000031 poll([{fd=11, events=POLLIN}], 1, 24999) = 0 (Timeout)
    25.024476 write(11, "\1\0\0\0\0\0\0\0", 8) = 8
     0.000231 futex(0x55a56dbf7a30, FUTEX_WAKE_PRIVATE, 2147483647) = 0
     0.000197 close(11)                 = 0
     0.002580 write(6, "\1\0\0\0\0\0\0\0", 8) = 8
     ...

Honestly: can't tell anything from this output (even after reading some "man 2 poll"), but I hope that this will help someone.

What I tried:
Deleted everything from ~/.config/gtk-3.0/
Deleted ~/.cache/ folder
Downgraded video drivers.

However, noticed that running apps as superuser "sudo evince" - it starts as quick as it should.

I do assume that there is something obvious that I'm missing, and asking Your help.

Thank You for reading the problem. If there is something unclear or You need more information about anything else, feel free to ask. Seriously. Any thought also would help.

Last edited by Digwer (2018-08-06 12:14:43)

Offline

#2 2018-08-05 22:11:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]gtk3 apps slow start

Please post (link to) the full strace as that excerpt is far too limited - most notably, you have trimmed the opening of file descriptor 11, so it's not clear what file (or file-like) that is waiting on.  But as a wild guess, I'd suspect it might be a theme-related input.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-08-06 03:59:37

Digwer
Member
Registered: 2017-01-07
Posts: 10

Re: [SOLVED]gtk3 apps slow start

Sorry about that.
Here the full strace

Offline

#4 2018-08-06 06:04:11

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED]gtk3 apps slow start

That strace doesn't include fd 11 and is interrupted before reaching it, so it's not the same strace and we've no indication whether or where it stalls.

Offline

#5 2018-08-06 08:34:06

Digwer
Member
Registered: 2017-01-07
Posts: 10

Re: [SOLVED]gtk3 apps slow start

Yes, it is different strace than I mentioned in the #1 post.
The strace in #3 post is just another one. The last line was the one causing "timeout", so pressed ^C.

poll([{fd=8, events=POLLIN}], 1, 25000^C) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)

My bad - I should have mentioned it.

Offline

#6 2018-08-06 10:36:08

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED]gtk3 apps slow start

It's waiting for some event notifier (which it has just read, though) - could be dbus.
What's the output of

loginctl session-status

Does this also happen to eg. gtk3-demo?

Offline

#7 2018-08-06 10:40:03

Digwer
Member
Registered: 2017-01-07
Posts: 10

Re: [SOLVED]gtk3 apps slow start

Here You go:

$loginctl session-status
c1 - tadas (1000)
           Since: Sun 2018-08-05 22:55:57 EEST; 14h ago
          Leader: 578
            Seat: seat0; vc1
             TTY: tty1
         Service: login; type tty; class user
           State: closing
            Unit: session-c1.scope
                  ├─ 1396 /usr/bin/pulseaudio --start --log-target=syslog
                  ├─ 1666 tmux
                  ├─ 1667 -bash
                  ├─ 2449 -bash
                  ├─ 4270 -bash
                  ├─ 4622 loginctl session-status
                  ├─ 4623 less
                  ├─15167 dbus-launch --autolaunch f56f1625e8c74ec7b3f0eb1762a765f7 --binary-syntax --close-stderr
                  ├─15168 /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
                  ├─15170 /usr/lib/at-spi-bus-launcher
                  ├─15175 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
                  ├─15177 /usr/lib/at-spi2-registryd --use-gnome-session
                  ├─15185 /usr/lib/xdg-desktop-portal
                  ├─15190 /usr/lib/xdg-document-portal
                  ├─15194 /usr/lib/xdg-permission-store
                  └─15205 /usr/lib/xdg-desktop-portal-gtk

Aug 06 00:08:01 ux305c org.a11y.Bus[15168]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Activating service name='org.freedesktop.portal.Desktop' requested by ':1.3' (uid=0 pid=15163 comm="evince ")
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Activating service name='org.freedesktop.portal.Documents' requested by ':1.4' (uid=0 pid=15185 comm="/usr/lib/xdg-desktop-portal ")
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Activating service name='org.freedesktop.impl.portal.PermissionStore' requested by ':1.5' (uid=0 pid=15190 comm="/usr/lib/xdg-document-portal ")
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Successfully activated service 'org.freedesktop.impl.portal.PermissionStore'
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Successfully activated service 'org.freedesktop.portal.Documents'
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Activating service name='org.freedesktop.impl.portal.desktop.gtk' requested by ':1.4' (uid=0 pid=15185 comm="/usr/lib/xdg-desktop-portal ")
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Successfully activated service 'org.freedesktop.impl.portal.desktop.gtk'
Aug 06 00:08:01 ux305c dbus-daemon[15168]: [session uid=0 pid=15166] Successfully activated service 'org.freedesktop.portal.Desktop'
Aug 06 00:08:03 ux305c sudo[15158]: pam_unix(sudo:session): session closed for user root

And, yes, the same with gkt3-demo.

Offline

#8 2018-08-06 10:46:32

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED]gtk3 apps slow start

State: closing

Bad. Also that's no graphical session?

Offline

#9 2018-08-06 11:28:15

Digwer
Member
Registered: 2017-01-07
Posts: 10

Re: [SOLVED]gtk3 apps slow start

No, there is graphical session. Running awesomewm. .xinitrc :

nm-applet &

# Make sure this is before the 'exec' command or it won't be sourced.
[ -f /etc/xprofile ] && source /etc/xprofile
[ -f ~/.xprofile ] && source ~/.xprofile
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources

exec awesome

Tried running again the command again it's active:

$loginctl session-status
c3 - tadas (1000)
           Since: Sun 2018-08-05 23:11:29 EEST; 15h ago
          Leader: 3529 (login)
            Seat: seat0; vc1
             TTY: tty1
         Service: login; type tty; class user
           State: active
            Unit: session-c3.scope
                  ├─3529 login -- tadas
                  ├─3591 /bin/sh /usr/bin/startx
                  ├─3619 xinit /home/tadas/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.YbTZdw2338
                  ├─3620 /usr/lib/Xorg -nolisten tcp :0 vt1 -keeptty -auth /tmp/serverauth.YbTZdw2338
                  ├─3623 xf86-video-intel-backlight-helper intel_backlight
                  ├─3627 awesome
                  ├─3628 nm-applet
                  ├─4309 /usr/lib/firefox-developer-edition/firefox
                  ├─4402 /usr/lib/firefox-developer-edition/firefox -contentproc -childID 1 -isForBrowser -prefsLen 20200 -schedulerPrefs 0001,2 -parentBuildID 20180803111934 -greomni /usr/lib/firefox-developer-e>
                  ├─5483 st
                  ├─5484 /bin/bash
                  ├─5520 st
                  ├─5523 /bin/bash
                  ├─5740 /usr/lib/firefox-developer-edition/firefox -contentproc -childID 3 -isForBrowser -prefsLen 23998 -schedulerPrefs 0001,2 -parentBuildID 20180803111934 -greomni /usr/lib/firefox-developer-e>
                  ├─5998 loginctl session-status
                  └─5999 less

Aug 05 23:11:29 ux305c systemd[1]: Started Session c3 of user tadas.
Aug 05 23:11:29 ux305c login[3529]: LOGIN ON tty1 BY tadas

But, yea, nice catch. Not really sure why the status was closing.

EDIT:
Rebooted the PC and the state is still active. Not sure how it was closing. The problem still exist.

Last edited by Digwer (2018-08-06 11:32:00)

Offline

#10 2018-08-06 11:48:51

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

Re: [SOLVED]gtk3 apps slow start

You're missing a vital section from your ~/.xinitrc that means your session isn't being started correctly, read...
https://wiki.archlinux.org/index.php/Xinit#xinitrc

Not sure if this is the cause of your problem but it needs fixing either way.


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

#11 2018-08-06 12:11:20

Digwer
Member
Registered: 2017-01-07
Posts: 10

Re: [SOLVED]gtk3 apps slow start

Slithery wrote:

Not sure if this is the cause of your problem

Yes it is! Finally, now the system call doesn't timeout anymore.
I can't believe I made mistake in a such place.

Adding the default section in .xinitrc solved it. Now .xinitrc looks:

nm-applet &

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

# Make sure this is before the 'exec' command or it won't be sourced.
[ -f /etc/xprofile ] && source /etc/xprofile
[ -f ~/.xprofile ] && source ~/.xprofile
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources

exec awesome

Thanks, Trilby, seth and Slithery.

Offline

#12 2021-01-24 06:19:34

thorsten
Member
From: Germany
Registered: 2010-02-24
Posts: 168

Re: [SOLVED]gtk3 apps slow start

With a recent gtk3 update, I had a similar issue. As noted by Slithery, the issue was that I didn't source the files from /etc/X11/xinit/xinitrc.d and in my case, the crucial file to source was

/etc/X11/xinit/xinitrc.d/50-systemd-user.sh

which adds DISPLAY/XAUTHORITY environments to the system user session.

Offline

#13 2021-01-24 13:51:11

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED]gtk3 apps slow start

Closing this old solved topic.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

Board footer

Powered by FluxBB