GNU bug report logs -
#29067
26.0.90; "Invalid client frame" when doing save-buffers-kill-terminal
Previous Next
Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>
Date: Mon, 30 Oct 2017 17:11:01 UTC
Severity: normal
Found in version 26.0.90
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29067 in the body.
You can then email your comments to 29067 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
rudalics <at> gmx.at, bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Mon, 30 Oct 2017 17:11:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kaushal Modi <kaushal.modi <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
rudalics <at> gmx.at, bug-gnu-emacs <at> gnu.org
.
(Mon, 30 Oct 2017 17:11:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
X-Debbugs-CC: rudalics <at> gmx.at
Hello,
Normally (99.99% of the time), I run emacs using emacsclient.
Today I happened to run it with just emacs&. But then when I tried to quit
via save-buffers-kill-terminal, I got "Invalid client frame".
In files.el, we have:
(defun save-buffers-kill-terminal (&optional arg)
"Offer to save each buffer, then kill the current connection.
If the current frame has no client, kill Emacs itself using
`save-buffers-kill-emacs'.
With prefix ARG, silently save all file-visiting buffers, then kill.
If emacsclient was started with a list of filenames to edit, then
only these files will be asked to be saved."
(interactive "P")
(if (frame-parameter nil 'client)
(server-save-buffers-kill-terminal arg)
(save-buffers-kill-emacs arg)))
When I eval'ed (frame-parameter nil 'client), I got "Unprintable entity"!
So server-save-buffers-kill-terminal gets called incorrectly instead of
save-buffers-kill-emacs when I actually do not have the emacsclient or
daemon running.
I do not see this issue on emacs 25.3 using my same emacs config.
Copying Martin as he might have an idea what could have caused this
regression.
In GNU Emacs 26.0.90 (build 14, x86_64-pc-linux-gnu, GTK+ Version 2.24.23)
of 2017-10-26
Repository revision: 646e56e150ca08978d6ce736b12867b4958a0cd8
Windowing system distributor 'The X.Org Foundation', version 11.0.60900000
System Description: Red Hat Enterprise Linux Workstation release 6.6
(Santiago)
Recent messages:
Quit [4 times]
Ag finished
Mark saved where search started
Ag finished
nil
Entering debugger...
uncompressing files.el.gz...done
"Unprintable entity" [2 times]
Mark saved where search started
Mark set
"Unprintable entity"
Configured using:
'configure --with-modules
--prefix=/home/kmodi/usr_local/apps/6/emacs/emacs-26
'--program-transform-name=s/^ctags$/ctags_emacs/'
'CPPFLAGS=-I/home/kmodi/usr_local/6/include -I/usr/include/freetype2
-I/usr/include' 'CFLAGS=-ggdb3 -O0' 'CXXFLAGS=-ggdb3 -O0'
'LDFLAGS=-L/home/kmodi/usr_local/6/lib -L/home/kmodi/usr_local/6/lib64
-ggdb3'
PKG_CONFIG_PATH=/home/kmodi/usr_local/6/lib/pkgconfig:/home/kmodi/usr_local/6/lib64/pkgconfig:/cad/adi/apps/gnu/linux/x86_64/6/lib/pkgconfig:/cad/adi/apps/gnu/linux/x86_64/6/lib64/pkgconfig:/home/kmodi/stowed/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig:/lib64/pkgconfig'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11 MODULES
--
Kaushal Modi
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Mon, 30 Oct 2017 18:41:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 29067 <at> debbugs.gnu.org (full text, mbox):
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Mon, 30 Oct 2017 17:10:13 +0000
>
> Today I happened to run it with just emacs&. But then when I tried to quit via save-buffers-kill-terminal, I got
> "Invalid client frame".
Please show a Lisp backtrace from this error.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Mon, 30 Oct 2017 18:50:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 29067 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Oct 30, 2017 at 2:40 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> Please show a Lisp backtrace from this error.
>
Sorry, should have done that earlier; I just assumed it didn't hold any
information of value for this case.
Debugger entered--Lisp error: (error "Invalid client frame")
signal(error ("Invalid client frame"))
error("Invalid client frame")
server-save-buffers-kill-terminal(nil)
save-buffers-kill-terminal()
eval((save-buffers-kill-terminal) nil)
eval-expression((save-buffers-kill-terminal) nil nil 127)
funcall-interactively(eval-expression (save-buffers-kill-terminal) nil
nil 127)
call-interactively(eval-expression nil nil)
command-execute(eval-expression)
When I edebugged save-buffers-kill-terminal, I saw that (frame-parameter
nil 'client) was evaluating to non-nil as it was returning "Unprintable
entity". So it is executing the wrong clause of that if.
--
Kaushal Modi
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Tue, 31 Oct 2017 08:43:02 GMT)
Full text and
rfc822 format available.
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
> Today I happened to run it with just emacs&. But then when I tried to quit
> via save-buffers-kill-terminal, I got "Invalid client frame".
>
> In files.el, we have:
>
> (defun save-buffers-kill-terminal (&optional arg)
> "Offer to save each buffer, then kill the current connection.
> If the current frame has no client, kill Emacs itself using
> `save-buffers-kill-emacs'.
>
> With prefix ARG, silently save all file-visiting buffers, then kill.
>
> If emacsclient was started with a list of filenames to edit, then
> only these files will be asked to be saved."
> (interactive "P")
> (if (frame-parameter nil 'client)
> (server-save-buffers-kill-terminal arg)
> (save-buffers-kill-emacs arg)))
>
> When I eval'ed (frame-parameter nil 'client), I got "Unprintable entity"!
>
> So server-save-buffers-kill-terminal gets called incorrectly instead of
> save-buffers-kill-emacs when I actually do not have the emacsclient or
> daemon running.
>
> I do not see this issue on emacs 25.3 using my same emacs config.
Evaluate (frame-parameter nil 'client) first after starting emacs with
the -Q option and then with your customizations and tell us what you
get. In a non-client session this parameter should be always nil.
Thanks, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Wed, 01 Nov 2017 13:33:01 GMT)
Full text and
rfc822 format available.
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Tue, Oct 31, 2017 at 4:42 AM martin rudalics <rudalics <at> gmx.at> wrote:
>
> Evaluate (frame-parameter nil 'client) first after starting emacs with
> the -Q option and then with your customizations and tell us what you
> get. In a non-client session this parameter should be always nil.
>
Hello,
After bisecting my config, turns out that this issue happens only when I
restore my session using desktop. Copying Eli as he can throw in some light
on cross-compatibility of a desktop.el saved .desktop file between emacs
(non-daemon) and emacsclient (daemon) sessions.
I cannot share my whole .desktop file for obvious reasons, but I see this
in my .desktop file, which seems to be the culprit:
(setq desktop-saved-frameset [frameset 1 (23033 51555 32954 566000)
(desktop . "208") "kmodi <at> foo.company.com" nil nil ((((minibuffer . t)
(undecorated) (override-redirect) (font-backend xft x) (font .
"-unknown-PragmataPro-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1")
(font-parameter .
"-unknown-PragmataPro-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1")
(border-width . 0) (internal-border-width . 0) (right-divider-width . 1)
(bottom-divider-width . 0) (vertical-scroll-bars) (horizontal-scroll-bars)
(foreground-color . "#f7f7f7") (background-color . "#282828") (mouse-color
. "black") (border-color . "black") (screen-gamma) (line-spacing)
(left-fringe . 8) (right-fringe . 8) (no-special-glyphs)
(scroll-bar-foreground) (scroll-bar-background) (menu-bar-lines . 0)
(tool-bar-lines . 0) (title) (wait-for-wm . t) (tool-bar-position . top)
(inhibit-double-buffering) (icon-type . t) (auto-raise) (auto-lower)
(cursor-type . box) (scroll-bar-width . 0) (scroll-bar-height . 0) (alpha)
(no-focus-on-map) (no-accept-focus) (fullscreen) (visibility . t)
(skip-taskbar) (z-group) (display-type . color) (background-mode . dark)
(cursor-color . "white") (sticky) (client . "Unprintable entity")
(tty-type . "xterm-24bits") (tty . "/dev/pts/10") (display . ":1.0")
(frameset--id . "D44A-14E2-2416-0AA9") (frameset--mini t . t) (modeline .
t) (unsplittable) (icon-name) (explicit-name) (fullscreen-restore) (height
. 67) (width . 282) (left . 2560) (top . 0)) ((min-height . 4) (min-width .
10) (min-height-ignore . 2) (min-width-ignore . 4) (min-height-safe . 1)
(min-width-safe . 2) (min-pixel-height . 80) (min-pixel-width . 90)
(min-pixel-height-ignore . 40) (min-pixel-width-ignore . 36)
(min-pixel-height-safe . 20) (min-pixel-width-safe . 18)) leaf (pixel-width
. 2554) (pixel-height . 1320) (total-width . 284) (total-height . 66)
(normal-height . 1.0) (normal-width . 1.0) (buffer "setup-desktop.el"
(selected . t) (hscroll . 0) (fringes 8 8 nil) (margins nil) (scroll-bars
nil 0 t nil 0 t) (vscroll . 0) (dedicated) (point . 6143) (start .
4847))))])
Note the "(client . "Unprintable entity")" in there.
PS: I have removed the (environment . ..) form from that (setq
desktop-saved-frameset ..) for privary reasons and also it just added a lot
of noise. Also I don't believe that has anything to do with this issue.
I use emacsclient 99.99% percent of times. So my .desktop file is saves
from those sessions. When I started emacs (non-daemon), it did desktop-read
of that .desktop file saved from the last emacsclient session.
So it looks like emacsclient shouldn't save stuff to the .desktop file
(like the 'client parameter) that would cause a future non-daemon emacs
session to think that it's running in daemon mode.
So the root cause analysis would be to figure out what causes the client
parameter to be set to "Unprintable entity". Where is that client parameter
derived from? How can I help debug this further?
As a side, wouldn't doing (daemonp) check instead of (frame-parameter nil
'client) work?
--
Kaushal Modi
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Wed, 01 Nov 2017 13:41:02 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I need to add that I never saw this issue in my emacsclient sessions,
because in my config, I directly call (save-buffers-kill-emacs) if
(daemonp). So the (save-buffers-kill-terminal) never got executed when
running emacsclient with my config.
So I see this issue on emacsclient too if I do
M-x save-buffers-kill-terminal
So need to figure out what could cause that client parameter to be set to
"Unprintable entity".
--
Kaushal Modi
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Wed, 01 Nov 2017 13:52:01 GMT)
Full text and
rfc822 format available.
Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Wed, Nov 1, 2017 at 9:40 AM Kaushal Modi <kaushal.modi <at> gmail.com> wrote:
> So need to figure out what could cause that client parameter to be set to
> "Unprintable entity".
>
This is the further I good go in elisp land:
Evaluating:
(pp (frame-parameters (car (frame-list))))
gives (after removing buffer-list, buried-buffers-list, environment forms):
"((parent-id . 20506031)
(outer-window-id . \"52429003\")
(window-id . \"52429034\")
(top . 0)
(left . 2560)
(width . 282)
(height . 67)
(name . \"emacs [emacs-26] *scratch-emacs-lisp-mode**\")
(fullscreen-restore)
(explicit-name)
(icon-name)
(unsplittable)
(modeline . t)
(frameset--mini t . t)
(frameset--id . \"D44A-14E2-2416-0AA9\")
(display . \":1.0\")
(tty . \"/dev/pts/10\")
(tty-type . \"xterm-24bits\")
(sticky)
(cursor-color . \"white\")
(background-mode . dark)
(display-type . color)
(client . \"Unprintable entity\")
(z-group)
(skip-taskbar)
(visibility . t)
(fullscreen)
(no-accept-focus)
(no-focus-on-map)
(alpha)
(scroll-bar-height . 0)
(scroll-bar-width . 0)
(cursor-type . box)
(auto-lower)
(auto-raise)
(icon-type . t)
(inhibit-double-buffering)
(tool-bar-position . top)
(wait-for-wm . t)
(title)
(buffer-predicate)
(tool-bar-lines . 0)
(menu-bar-lines . 0)
(scroll-bar-background)
(scroll-bar-foreground)
(no-special-glyphs)
(right-fringe . 8)
(left-fringe . 8)
(line-spacing)
(screen-gamma)
(border-color . \"black\")
(mouse-color . \"black\")
(background-color . \"#282828\")
(foreground-color . \"#f7f7f7\")
(horizontal-scroll-bars)
(vertical-scroll-bars)
(bottom-divider-width . 0)
(right-divider-width . 1)
(internal-border-width . 0)
(border-width . 0)
(font-parameter .
\"-unknown-PragmataPro-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1\")
(font .
\"-unknown-PragmataPro-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1\")
(font-backend xft x)
(override-redirect)
(undecorated)
(parent-frame)
(minibuffer . t))
"
Now frame-parameters is a C function and somehow derives the client
parameter to be "Unprintable entity". Let me know how I can further debug
this.
--
Kaushal Modi
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Wed, 01 Nov 2017 17:44:01 GMT)
Full text and
rfc822 format available.
Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):
> So it looks like emacsclient shouldn't save stuff to the .desktop file
> (like the 'client parameter) that would cause a future non-daemon emacs
> session to think that it's running in daemon mode.
Right. So please add
(client . :never)
to 'frameset-persistent-filter-alist' (you probably have to remake your
autoloads afterwards) and look whether the problem is gone.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29067
; Package
emacs
.
(Wed, 01 Nov 2017 18:54:01 GMT)
Full text and
rfc822 format available.
Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Wed, Nov 1, 2017 at 1:43 PM martin rudalics <rudalics <at> gmx.at> wrote:
> Right. So please add
>
> (client . :never)
>
> to 'frameset-persistent-filter-alist' (you probably have to remake your
> autoloads afterwards) and look whether the problem is gone.
>
That worked!
Now (frame-parameter nil 'client) returns nowait in emacsclient and nil in
emacs.
Can you please commit the fix?
Thanks!
--
Kaushal Modi
[Message part 2 (text/html, inline)]
Reply sent
to
martin rudalics <rudalics <at> gmx.at>
:
You have taken responsibility.
(Thu, 02 Nov 2017 09:52:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Kaushal Modi <kaushal.modi <at> gmail.com>
:
bug acknowledged by developer.
(Thu, 02 Nov 2017 09:52:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 29067-done <at> debbugs.gnu.org (full text, mbox):
> Can you please commit the fix?
Done. server.el sets other parameters like 'environment' and
'server-dummy-buffer'. I suppose these shouldn't be preserved either
but didn't bother to do that. In any case I added a note to the frame
parameters documentation that applications should care about which of
their parameters they want to save and restore via the desktop library.
Closing this bug.
martin
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 30 Nov 2017 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 205 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.