You are not logged in.

#1 2021-01-21 19:17:33

darkrai9292
Member
Registered: 2021-01-21
Posts: 3

Gnome applications hanging on launch, caused by a poll syscall

I've seen other users have this problem in the past, but none of the solutions posted so far have worked for me. Basically after an update all gnome applications seem to take a long time (>25s) to start, with the wait time going down after a bunch of launchs. So far strace has revealed that the hanging is caused by a poll syscall to a file descriptor created by eventfd timing out. I am still relatively new to the specifics of the unix operating system, and so I'm stuck.

So far I have tried as others have suggested:

1. Launching i3 with dbus-launch --exit-with-session i3
2. Explicitly setting the DISPLAY environment variable

Relevant strace output:

eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 11
write(11, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7ff4b93ae120, FUTEX_WAKE_PRIVATE, 1) = 0
write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x55dcb338a7f0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55dcb338a410, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55dcb33820d8, 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) = 1 ([{fd=11, revents=POLLIN}])
read(11, "\1\0\0\0\0\0\0\0", 16)        = 8
write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x55dcb338a7f0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55dcb338a410, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55dcb33820d8, 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
write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x55dcb338a7f0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55dcb338a410, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55dcb33820d8, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=11, events=POLLIN}], 1, 25000) = 0 (Timeout)
write(11, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x55dcb3526820, FUTEX_WAKE_PRIVATE, 2147483647) = 0
close(11)       

kernel: 5.10.7-arch1-1

I'm new to this forum so let me know if there is any information or formatting I got wrong. Any help is greatly appreciated!

Offline

#2 2021-01-23 14:11:18

jbh
Member
Registered: 2018-05-26
Posts: 8

Re: Gnome applications hanging on launch, caused by a poll syscall

I've been having potentially the same issue, across GTK apps, starting after an update a few days ago. Just for completeness, I've uploaded the output of
strace gedit: http://ix.io/2N2d
cat ~/.xinitrc: http://ix.io/jmE
printenv | grep DBUS: http://ix.io/2N2f

EDIT: I don't get this issue with gnome, only with kde plasma.

Last edited by jbh (2021-01-23 19:09:06)

Offline

#3 2021-01-26 01:26:31

kasama
Member
Registered: 2021-01-26
Posts: 1

Re: Gnome applications hanging on launch, caused by a poll syscall

I'm having possibly the same problem as OP, spanning all GTK applications I've tried (initially found in pavucontrol). Most online results I've found seem to point the finger at DBus.

I have tried all of OPs mentioned solutions plus:

- adding this line to my .xinitrc as recommended here

dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY

- checking if dbus is running

ps -aux | grep dbus

dbus         443  0.0  0.0   8000  4912 ?        Ss   21:10   0:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
roberto     1165  0.0  0.0   7472  4476 ?        Ss   21:10   0:01 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
roberto     1244  0.0  0.0   7148  4112 ?        S    21:10   0:00 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3

- checking if dbus is erroring out with

dbus-send --print-reply --session  --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.DBus.Introspectable.Introspect

- deleting ~/.cache directory

- adding xinitrc.d sources in my xinitrc as noted here

...
    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
...

relevant strace output for any GTK application I've tried looks similar. A file descriptor is opened via eventfd2, then "\1\0\0\0\0\0\0\0" is written to it, it's polled once successfully, then polled again, when it times out.

One thing to note is that it's trying to read 16 bytes from the file descriptor, but is only able to read 8. Although this is expected of a pipe fd, I figured it would be worth noting.

eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 10
write(10, "\1\0\0\0\0\0\0\0", 8)        = 8
poll([{fd=10, events=POLLIN}], 1, 25000) = 1 ([{fd=10, revents=POLLIN}])
read(10, "\1\0\0\0\0\0\0\0", 16)        = 8
poll([{fd=10, events=POLLIN}], 1, 25000) = 0 (Timeout)

Some resources I've found that may have useful information on similar problems in the past:
https://bbs.archlinux.org/viewtopic.php?id=234072
https://bbs.archlinux.org/viewtopic.php?id=239331
https://bugs.launchpad.net/ubuntu/+bug/1891245

Offline

#4 2021-01-26 04:12:02

darkrai9292
Member
Registered: 2021-01-21
Posts: 3

Re: Gnome applications hanging on launch, caused by a poll syscall

That's interesting, I've also found the same forum posts you've posted, thanks for putting them here. The issue for me seems to be caused by xdg-desktop-portal hanging according to the journal. I noticed that each time I try to launch the portal it seems to get better, and once I do manage to get it successfully started the original issue seems to disappear, until a restart.

However I still haven't found a solution, it's definitely related to dbus since even reinstalling xdg-desktop-portal didn't seem to do it for me. Furthermore it seems like once xdg-desktop-portal starts, there is a warning about pipewire? I feel like this is unrelated.

I feel like kasama is right about it being an issue with dbus, I'm not sure how to resolve this though I need to spend some time figuring out what a dbus is.

Offline

#5 2021-02-19 15:29:44

ludocode
Member
Registered: 2021-02-19
Posts: 2

Re: Gnome applications hanging on launch, caused by a poll syscall

I'm glad I finally found this post. I use i3 and this issue is happening to me as well. It's been driving me crazy for the past couple weeks. Any GNOME app hangs on startup with a 25 second poll() timeout on an eventfd. pavucontrol and thunar are the most painful ones for me but everything from GNOME has this hang.

I tried everything above, plus uninstalling pulseaudio. Nothing works. None of the previous threads have the solution. It's definitely not the old issue with pulseaudio.

I built debug versions of gnome-chess, gtk3 and glib from source. Here's a stack trace of the hanging poll():

#0  0x00007ffff66f537f in poll () from /usr/lib/libc.so.6
#1  0x00007ffff7ee8541 in g_poll (fds=0x5555556b0950, nfds=1, timeout=25000) at ../glib/gpoll.c:125
#2  0x00007ffff7ed50b6 in g_main_context_poll (context=0x5555556b5c20, timeout=25000, priority=2147483647, fds=0x5555556b0950, n_fds=1) at ../glib/gmain.c:4422
#3  0x00007ffff7ed48f7 in g_main_context_iterate (context=0x5555556b5c20, block=1, dispatch=1, self=0x5555555edc90) at ../glib/gmain.c:4114
#4  0x00007ffff7ed4de3 in g_main_loop_run (loop=0x5555556b0a40) at ../glib/gmain.c:4317
#5  0x00007ffff7365d31 in initable_init (initable=0x55555569f920, cancellable=0x0, error=0x7fffffffd7d0) at ../gio/gdbusproxy.c:1903
#6  0x00007ffff728f95a in g_initable_init (initable=0x55555569f920, cancellable=0x0, error=0x7fffffffd7d0) at ../gio/ginitable.c:128
#7  0x00007ffff728fba3 in g_initable_new_valist (object_type=93824993108128, first_property_name=0x7ffff73d9c23 "g-flags", var_args=0x7fffffffd600, cancellable=0x0, error=0x7fffffffd7d0) at ../gio/ginitable.c:248
#8  0x00007ffff728fa22 in g_initable_new (object_type=93824993108128, cancellable=0x0, error=0x7fffffffd7d0, first_property_name=0x7ffff73d9c23 "g-flags") at ../gio/ginitable.c:162
#9  0x00007ffff7366200 in g_dbus_proxy_new_sync (connection=0x55555562d0b0, flags=G_DBUS_PROXY_FLAGS_NONE, info=0x0, name=0x7ffff7ad4d80 "org.freedesktop.portal.Desktop", object_path=0x7ffff7ad4d60 "/org/freedesktop/portal/desktop", 
    interface_name=0x7ffff7b43520 "org.freedesktop.portal.Inhibit", cancellable=0x0, error=0x7fffffffd7d0) at ../gio/gdbusproxy.c:2093
#10 0x00007ffff7aa1705 in gtk_application_get_proxy_if_service_present (connection=<optimized out>, flags=flags@entry=G_DBUS_PROXY_FLAGS_NONE, bus_name=bus_name@entry=0x7ffff7ad4d80 "org.freedesktop.portal.Desktop", 
    object_path=object_path@entry=0x7ffff7ad4d60 "/org/freedesktop/portal/desktop", interface=interface@entry=0x7ffff7b43520 "org.freedesktop.portal.Inhibit", error=error@entry=0x7fffffffd7d0) at gtkapplication-dbus.c:132
#11 0x00007ffff7aa1ec2 in gtk_application_impl_dbus_startup (impl=0x555555672c20, register_session=0) at gtkapplication-dbus.c:461
#12 0x00007ffff77ab34b in gtk_application_impl_startup (impl=<optimized out>, register_session=<optimized out>) at gtkapplicationimpl.c:70
#13 0x00007ffff77aa0c2 in gtk_application_startup (g_application=<optimized out>) at gtkapplication.c:307
#14 0x0000555555575eac in chess_application_real_startup (base=0x5555555fa320) at ../src/gnome-chess.vala:148
#15 0x00007ffff71b55dc in g_cclosure_marshal_VOID__VOIDv (closure=0x5555555f4430, return_value=0x0, instance=0x5555555fa320, args=0x7fffffffe0e0, marshal_data=0x555555575e2a <chess_application_real_startup>, n_params=0, param_types=0x0)
    at ../gobject/gmarshal.c:165
#16 0x00007ffff71b2705 in g_type_class_meta_marshalv (closure=0x5555555f4430, return_value=0x0, instance=0x5555555fa320, args=0x7fffffffe0e0, marshal_data=0x88, n_params=0, param_types=0x0) at ../gobject/gclosure.c:1034
#17 0x00007ffff71b2251 in _g_closure_invoke_va (closure=0x5555555f4430, return_value=0x0, instance=0x5555555fa320, args=0x7fffffffe0e0, n_params=0, param_types=0x0) at ../gobject/gclosure.c:873
#18 0x00007ffff71cf826 in g_signal_emit_valist (instance=0x5555555fa320, signal_id=6, detail=0, var_args=0x7fffffffe0e0) at ../gobject/gsignal.c:3404
#19 0x00007ffff71d0ac9 in g_signal_emit (instance=0x5555555fa320, signal_id=6, detail=0) at ../gobject/gsignal.c:3551
#20 0x00007ffff731579f in g_application_register (application=0x5555555fa320, cancellable=0x0, error=0x7fffffffe250) at ../gio/gapplication.c:2204
#21 0x00007ffff7313862 in g_application_real_local_command_line (application=0x5555555fa320, arguments=0x7fffffffe2e8, exit_status=0x7fffffffe2d8) at ../gio/gapplication.c:1106
#22 0x00007ffff77a809f in gtk_application_local_command_line (application=0x5555555fa320, arguments=0x7fffffffe2e8, exit_status=0x7fffffffe2d8) at gtkapplication.c:343
#23 0x00007ffff7315ece in g_application_run (application=0x5555555fa320, argc=1, argv=0x7fffffffe488) at ../gio/gapplication.c:2528
#24 0x000055555558cd1e in chess_application_main (args=0x7fffffffe488, args_length1=1) at ../src/gnome-chess.vala:2555
#25 0x000055555558cd67 in main (argc=1, argv=0x7fffffffe488) at ../src/gnome-chess.vala:2545

It seems pretty clear from the stack trace that it's a dbus issue. It calls gtk_application_impl_dbus_startup() which calls gtk_application_get_proxy_if_service_present() which calls g_dbus_proxy_new_sync() which goes on to hang. I of course have dbus running, I have the correct .xinitrc.d/ stuff in my .xinitrc which calls dbus-update-activation-environment, I've tried calling dbus-update-activation-environment as above manually, etc. Nothing works.

Offline

#6 2021-02-19 16:51:53

pguillot
Member
Registered: 2021-02-19
Posts: 1

Re: Gnome applications hanging on launch, caused by a poll syscall

Same problem on my 2012 Archlinux install. Find the solution for me in this thread : https://bbs.archlinux.org/viewtopic.php … 4#p1934134

Offline

#7 2021-02-23 17:56:54

darkrai9292
Member
Registered: 2021-01-21
Posts: 3

Re: Gnome applications hanging on launch, caused by a poll syscall

Yep removing the portal worked for me. Thanks

Offline

#8 Yesterday 01:24:24

ludocode
Member
Registered: 2021-02-19
Posts: 2

Re: Gnome applications hanging on launch, caused by a poll syscall

Ohhh finally, removing the portals worked for me too. No idea how I got them installed in the first place. @pguillot you're a lifesaver, thanks!

Offline

Board footer

Powered by FluxBB