This just started happening to me recently on Leap 15. But it wasn’t happening before, and I’m unsure what caused it to start.
Running X applications in the “foreground” from a shell (in a konsole, xterm, etc. window) results in the X window for the applications immediately displaying as they’re supposed to.
However, when I run certain X applications (e.g. emacs, xemacs, gkrellm, etc.) in the “background” from a shell, then I get a hang of exactly 10 seconds. For example: “emacs &” (without quotes). During this hang while I wait for the X window to appear, that shell is completely frozen. I can’t do anything with it at all (e.g. Ctl-C). However, I can type freely in a shell window in another tab in the same window. So it seems to be something relating to the shell that’s holding up the application.
Digging a bit deeper, I decided to run “strace -r app &” to see if I could get any clues. Here’s an excerpt of what I see when I run “strace -r emacs &”:
...
0.000045 mprotect(0x5618e68fc000, 8192, PROT_READ) = 0
0.000016 mprotect(0x7fab743a1000, 4096, PROT_READ) = 0
0.000014 munmap(0x7fab74364000, 248226) = 0
0.000038 openat(AT_FDCWD, "/dev/tty", O_RDWR|O_NONBLOCK) = -1 EBUSY (Device or resource busy)
5.116922 ioctl(0, TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
0.000102 fstat(0, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 3), ...}) = 0
0.000139 brk(NULL) = 0x5618e83f0000
0.000064 brk(0x5618e8411000) = 0x5618e8411000
0.000021 readlink("/proc/self/fd/0", "/dev/pts/3", 4095) = 10
0.000031 stat("/dev/pts/3", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 3), ...}) = 0
0.000020 openat(AT_FDCWD, "/dev/pts/3", O_RDWR|O_NONBLOCK) = -1 EBUSY (Device or resource busy)
5.119610 stat("/usr/lib/locale/locale-archive", 0x7fffd7f39900) = -1 ENOENT (No such file or directory)
...
Notice the 2 calls that take 5 seconds each. It looks like it might be hanging while trying to open “/dev/tty” and “/dev/pts/3”.
However, when I do an “strace emacs” without putting this in the background, then the open of “/dev/tty” succeeds immediately and it never tries to open /dev/pts/…
Does anyone have any ideas as to what’s going on here? Or what I can do to try and fix it? --Thanks.