Subject: 23.0.60; desktop.el don't check if pid in his lock file is always in use

From: Thierry Volpiatto <[email-masked]>
Date: Tue, 02 Dec 2008 22:43:43 +0100

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

When killing emacs --daemon or emacs brutally with killall for example,
when reloading emacs or emacs --daemon, emacs ask if we want to load
desktop file or not (pid is already in use...).
I think emacs should check if the PID that is in his lock file is always
in use.
i made a quick hack for that:
That go after line 967 in desktop.el in function desktop-read.

,----
| (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner)))
`----

I can make a patch if you want, just tell me.

This bug is not really a bug if we consider using emacs normally:
we have just to answer yes or no.
But that particularly anoying with new feature emacs --daemon.
If this one is started as a service it can hang the system and booting
the machine come impossible until file .emacs.desktop.lock is removed.
(Gentoo provide an init script to start emacs --daemon as service with openrc)

Thank you.
Thierry

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.0.60/etc/DEBUG for instructions.

In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.14.5)
 of 2008-12-02 on tux
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure  '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--without-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--with-freetype' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=i686 -pipe -O2' 'LDFLAGS=-Wl,-O1''

Important settings:
  value of $LC_ALL: fr_FR.UTF-8
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_FR.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: ERC

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  icomplete-mode: t
  icicle-mode: t
  delete-selection-mode: t
  minibuffer-depth-indicate-mode: t
  auto-image-file-mode: t
  partial-completion-mode: t
  shell-dirtrack-mode: t
  display-wireless-mode: t
  display-battery-mode: t
  display-time-mode: t
  diff-auto-refine-mode: t
  recentf-mode: t
  savehist-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
m e ! ) <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> C-e 
<return> A n y SPC <backspace> w a y SPC i SPC w i 
l l SPC s u b m i t SPC a SPC b u g SPC a l s o . <return> 
T h a n k s . <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <right> <right> 
<right> <backspace> <left> <left> <left> <left> <left> 
g m a n e . <right> <right> <right> <right> <right> 
<right> <left> . <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<tab> <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <tab> <tab> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <down> 
<down> <down> <down> <down> <down> C-SPC C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-x r s a C-g C-g C-c C-c y 
q q n <return> <return> q <return> <return> q q y <switch-frame> 
h k B s t : <backspace> <left> <left> <left> <left> 
<left> H i ! SPC <right> <right> <right> <right> <right> 
<return> M-x e m a c s - s u b m i <tab> <backspace> 
<backspace> <backspace> <backspace> <backspace> <tab> 
b u g <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
b u g <S-iso-lefttab> <down> <down> <down> <down> <down> 
C-g M-x r e p o r t - e <tab> b u g <return>

Recent messages:
Scoring...done
Generating summary...done
No more unread articles
No more unread newsgroups
Are you sure you want to quit reading news? (y or n) 
Wrote /home/thierry/.newsrc
Saving /home/thierry/.newsrc.eld...
Wrote /home/thierry/.newsrc.eld
Saving /home/thierry/.newsrc.eld...done
Computing completion candidates... [5 times]

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France