I recently set up a new Ubuntu 24 computer with all latest software. Previously had Ubuntu 16. Now many programs are taking 25 seconds to start up. They all seem to be hanging while writing an 8-byte sequence to a pipe and waiting for an 8-byte response from another pipe.
For example, when I do strace shutter it sits here:
write(10, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x5a71512003e0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x5a7151207b90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x5a7151201dd8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x5a7151201dd8, FUTEX_WAKE_PRIVATE, 1) = 1
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK) = 11
write(10, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x5a71512003e0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x5a7151207b90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x5a7151201dd8, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=11, events=POLLIN}], 1, 25000
Similarly when I do strace kicad it sits here:
write(12, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x592172bd40b0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x592172bd8790, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x592172bd4988, FUTEX_WAKE_PRIVATE, 1) = 1
write(12, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x592172bd40b0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x592172bd8790, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x59216fc93ae0, FUTEX_WAKE_PRIVATE, 1) = 0
write(12, "\1\0\0\0\0\0\0\0", 8) = 8
write(12, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x592172bd4988, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x592172bd4988, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x592172bd4988, FUTEX_WAKE_PRIVATE, 1) = 0
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK) = 13
write(12, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x592172bd4988, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=13, events=POLLIN}], 1, 25000
In both cases, there is the pair of pipes, writing 8 bytes to one and reading from the other with a 25 second timeout. I do not see this sequence anywhere else except for the point where the software hangs. The pattern is too specific to just be a coincidence so this must be the same code in a library (wxWidgets?) used in both programs. Here is a stack dump of kicad during the hang:
#0 0x0000155551d1b4cd in __GI___poll (fds=0x555555b36410, nfds=1,
timeout=25000) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x000015555439566e in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x0000155554336f77 in g_main_loop_run ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x0000155552b501e2 in ?? () from /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4 0x0000155552aae8bc in g_initable_new_valist ()
from /lib/x86_64-linux-gnu/libgio-2.0.so.0
#5 0x0000155552aae9ab in g_initable_new ()
from /lib/x86_64-linux-gnu/libgio-2.0.so.0
#6 0x0000155552b5222b in g_dbus_proxy_new_for_bus_sync ()
from /lib/x86_64-linux-gnu/libgio-2.0.so.0
#7 0x0000155554d6c1a7 in ?? ()
from /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
#8 0x000015555470fe76 in wxModule::DoInitializeModule(wxModule*, wxVector<wxModule*>&) () from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#9 0x00001555547106b8 in wxModule::InitializeModules() ()
from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#10 0x00001555546f89dd in ?? () from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#11 0x00001555546f9195 in wxEntryStart(int&, wchar_t**) ()
from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#12 0x00001555546f94a0 in wxEntry(int&, wchar_t**) ()
from /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#13 0x000055555567effe in ?? ()
So maybe this is some kind of wxWidgets issue? Both of these programs have overblown UI graphics, so I'm guessing they use huge software packages like gtk3, dbus, and wxWidgets.
I was not able to get a stack dump of shutter yet, due to the way it launches processes.
Other software is running fine: emacs, xterm, fvwm2, and firefox start up quickly. I believe that these programs do not use wxWidgets.
Any thoughts on what is causing some programs to hang for 25 seconds?
Update: As suggested here I tried running the programs via dbus-launch. This appears to solve the 25 second delay. But the odd thing is that this issue was reported 5 years ago. Wouldn't this be enough time to fix these programs so that they integrate whatever missing functionality it is that dbus-launch provides?