From: Chris Hunt <chrahunt@gmail.com>
To: 44642@debbugs.gnu.org
Subject: bug#44642: 27.1; read-string does not signal on EOF after calling server-eval-at
Date: Sat, 14 Nov 2020 11:46:42 -0500 [thread overview]
Message-ID: <CAH+Wm48AXTVFD7r835aA-+ZVu8ZogDWwSgTbP0K4gULNLZsVRw@mail.gmail.com> (raw)
Running the following shell script demonstrates the bug:
#+begin_src shell
#!/bin/sh
cd "$(mktemp -d)"
export RPC_SERVER_NAME="$PWD/emacs"
emacs --quick "--fg-daemon=$RPC_SERVER_NAME" >stdout.log 2>stderr.log &
sleep 1
cat <<EOF > script.el
(require 'server)
(setq command (read-string ""))
(message "Received '%s'" command)
(when (string= command "test")
(message "Sending request to server")
(let ((result (server-eval-at (getenv "RPC_SERVER_NAME") "hello from
server")))
(message "Response received from server '%s'" result)))
;; This should signal, since EOF.
(read-string "")
EOF
echo '[script] test 1'
echo notest | \
emacs --quick --batch --script "$PWD/script.el"
echo '[script] test 1 complete'
echo '[script] test 2'
echo test | \
emacs --quick --batch --script "$PWD/script.el"
echo '[script] test 2 complete'
#+end_src
Test 1 demonstrates the expected behavior, the second call to
`read-string' results
in an error and the non-daemon emacs process exits.
Test 2 demonstrates the bug. When `server-eval-at' is called, the
subsequent `read-string'
does not result in an error, and does not appear to return. The
non-daemon emacs process
does not exit.
On my machine, this outputs:
#+begin_src text
[script] test 1
Received ’notest’
Error reading from stdin
[script] test 1 complete
[script] test 2
Received ’test’
Sending request to server
Response received from server ’hello from server’
#+end_src
and hangs. According to `top', the non-daemon process is consuming
100% of a CPU core.
xbacktrace in gdb of the non-daemon emacs shows
#+begin_src text
"read-string" (0xb5783470)
"eval-buffer" (0xb5783660)
"load-with-code-conversion" (0xb5783928)
"load" (0xb5783c18)
"command-line-1" (0xb5784260)
"command-line" (0xb5784ac8)
"normal-top-level" (0xb5784e20)
#+end_src
Previously posted to https://emacs.stackexchange.com/q/61676/29147 and
https://lists.gnu.org/archive/html/help-gnu-emacs/2020-11/msg00405.html
In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
of 2020-11-08 built on desktop
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.5 LTS
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Configured using:
'configure --prefix /home/chris/.local/evm/emacs-27.1 --without-gif'
Configured features:
XPM JPEG TIFF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM MODULES THREADS PDUMPER GMP
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 44962 7821)
(symbols 48 5981 1)
(strings 32 15464 1865)
(string-bytes 1 512027)
(vectors 16 10063)
(vector-slots 8 131781 12876)
(floats 8 19 27)
(intervals 56 187 0)
(buffers 1000 11))
next reply other threads:[~2020-11-14 16:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-14 16:46 Chris Hunt [this message]
2020-11-14 18:47 ` bug#44642: 27.1; read-string does not signal on EOF after calling server-eval-at Eli Zaretskii
2020-11-14 19:42 ` Chris Hunt
2020-11-14 19:58 ` Eli Zaretskii
2020-11-14 20:40 ` Chris Hunt
2020-11-14 20:50 ` Chris Hunt
2020-11-14 21:43 ` Andreas Schwab
2020-11-15 3:25 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAH+Wm48AXTVFD7r835aA-+ZVu8ZogDWwSgTbP0K4gULNLZsVRw@mail.gmail.com \
--to=chrahunt@gmail.com \
--cc=44642@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.