When running "emacs filename" while su'd to root from a non-root account, I get the following error on my terminal: (emacs:5199): GLib-WARNING **: In call to g_spawn_sync(), exit status of a child process was requested but SIGCHLD action was set to SIG_IGN and ECHILD was received by waitpid(), so exit status can't be returned. This is a bug in the program calling g_spawn_sync(); either don't request the exit status, or don't set the SIGCHLD action. Emacs also takes several seconds to appear, which seems slower than it should be; not sure if that is related. Version: emacs-24.2-6.fc18.x86_64 glib2-2.34.2-2.fc18.x86_64
I have tried to simulate that problem but without success. Please describe me how to reproduce that problem?
Hmm, I cannot reproduce using the same steps I used before; perhaps there is something else that needs to happen to cause this. I also occasionally see slow startup when starting from the Gnome Shell favorites list. I expect this error is being output, but I don't see a ~/.xsession-errors. Is that still where output from GUI apps gets recorded? I will be on the lookout for this and see if I can isolate the trigger.
Currently running emacs-24.2-19.fc18.x86_64. Today this is happening when just running "emacs FILENAME" on the command line for a regular user. Emacs uses very little CPU while I am waiting for it to appear, and it does not appear to be in disk-wait according to "top".
(And I do not see any error/warning output.)
I discovered today that having the network plugged in makes a critical difference. With no network, Emacs starts up nearly instantly. After plugging in an Ethernet cable and waiting 10 seconds after the connection is established, Emacs takes 5-15 seconds to start up, even when invoked in exactly the same way.
Finally figured out how to reproduce this problem! It is happening because something is making DNS requests for my hostname. But when the contents of /etc/hostname are not a valid DNS name, it takes a few seconds for the DNS query to fail. Emacs startup hangs while it's waiting for that to happen. I can solve this problem by adding an entry for my hostname in /etc/hosts, under 127.0.0.1. Testing today with emacs-24.3-9.fc19.x86_64, confirming this is still a problem on Fedora 19.
I can confirm Christopher's observations: on CentOS 6.5, with emacs-nox.x86_64 1:23.1-25.el6, emacs indeed started up slowly, but when I added my hostname to /etc/hosts, it starts quickly.
I can confirm this on fedora 20 as of today. Adding the hostname to the localhost line of /etc/hosts gets rid of the laggy start time. I'm attaching and strace from when it takes a long time to start (hostname *not* it /etc/hosts).
Created attachment 884686 [details] strace -o output.txt emacs -nw This strace was generated with a completely fresh f20 x64 install- no yum update. just yum install emacs after install. No .emacs either. Behaves the same if I do a yum update to today's current stuff also.
I can also confirm this bug for the current version of fedora 20. The fix also works for me.
I think that this is not an emacs bug. Emacs will not modify /etc/hosts file at all. Should emacs check whether DNS name is valid or not? I think that the question is for upstream. I will open the issue for this case.
The issue was address to upstream http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18142 But from my point of view this is not emacs bug.
This issue wouldn't be handled by emacs upstream. Therefore closing the bug as NOTABUG.
FUUUUUUUUUUUUUUUUUUUUU