Subject: bug#10669: More debugging

From: [email-masked]
Date: Tue, 8 May 2012 07:50:43 -0700 (PDT)

data point:

running 24.1.50.1 on Ubuntu 12.04 via cassou ppa.

I can trigger this with an init.el consisting solely of:

(custom-set-variables
 '(desktop-base-file-name "emacs.desktop")
 '(desktop-save t)
 '(desktop-save-mode t)
)

no other custom configuration file is present.
If i remove those lines from init.el and instead set the vars using setq in my personal config file things work ok. 

When the bug is triggered I have two emacs daemon processes running:
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
scytale      12847  0.0  0.1 200180  4884 pts/0    S+   15:24   0:00 /usr/bin/emacs --daemon
scytale      12848  0.0  0.3 209936 14540 ?        Ss   15:24   0:00 /usr/bin/emacs --daemon

I'm guessing the whole daemonize-fork-pass-fd dance is getting fouled up somehow.

I found a reference to what sounds like a very similar problem here:
http://forums.gentoo.org/viewtopic-p-5998467.html?sid=f177a9491dffb58f06b39b58ab4024d1#5998467

afaict this poster believed that in his case the problem was caused by two emacs processes trying to access the same emacs.desktop file. In my case neither of the two daemon processes have the file open by the time I can run lsof on them. 

I'll do some tracing/debugging when I get the chance.