Running gedit through sudo has a long startup delay
- Operating System: Fedora 35 Beta
- Gedit version: 41.alpha
-
Installed from: Official Fedora repositories, package
gedit-2:41~alpha-2.fc35
Immediately after boot and login, running gedit
through sudo
hangs.
sudo
prompts for password as expected, then nothing happens.
After waiting for maybe 10 seconds, the gedit window opens and everything works normally.
If the command is aborted with Ctrl-C
after the password has been entered, but before the gedit window shows up,
and the same command ran again,
gedit starts normally without any delay.
This seems to be related to if sudo
needs to prompt for password or not,
because if I close and reopen the terminal,
sudo
starts to prompt for password again
and the problem reappears.
I have not been able to reproduce the delay for any other program than gedit.
Some time after boot, this does not happen anymore. I have not been able to discern if there is something going in in the background that eventually fixes the problem or if some action that I take sooner or later.
I tried to analyze this with strace
,
even if I do not understand that tool very well.
Here are the last lines printed before the hangup:
$ sudo strace gedit test.file
...
futex(0x55bed1097560, FUTEX_WAKE_PRIVATE, 1) = 0
write(6, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x55bed10a20c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55bed1097560, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x55bed1097560, FUTEX_WAKE_PRIVATE, 1) = 0
write(6, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x55bed10a20c8, FUTEX_WAKE_PRIVATE, 1) = 1
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK) = 10
write(10, "\1\0\0\0\0\0\0\0", 8) = 8
write(6, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x55bed10ac340, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55bed10ac0d0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x55bed10a20c8, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=10, events=POLLIN}], 1, 24998) = 1 ([{fd=10, revents=POLLIN}])
read(10, "\1\0\0\0\0\0\0\0", 16) = 8
poll([{fd=10, events=POLLIN}], 1, 24996
When gedit finally starts,
the last line gets appended with some more output
including the string (Timeout)
,
so that it and a couple of following lines look like this:
poll([{fd=10, events=POLLIN}], 1, 24996) = 0 (Timeout)
write(10, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x55bed1202090, FUTEX_WAKE_PRIVATE, 2147483647) = 0
close(10)