GNU bug report logs -
#29070
26.0.90; (file-attributes dir) => nil, even though (and (file-exists-p dir) (file-directory-p dir)) => t
Previous Next
Reported by: rrandresf <at> gmail.com
Date: Mon, 30 Oct 2017 20:03:01 UTC
Severity: normal
Found in version 26.0.90
Done: Andreas Schwab <schwab <at> linux-m68k.org>
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 29070 in the body.
You can then email your comments to 29070 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 20:03:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
rrandresf <at> gmail.com
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 30 Oct 2017 20:03:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi. after compiling the pretest. I do emacs -Q then M-x server-start then
I am getting:
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (error "‘/tmp/emacs1000’ is not a safe directory because it is a file")
signal(error ("‘/tmp/emacs1000’ is not a safe directory because it is a file"))
error("`%s' is not a safe directory because %s" "/tmp/emacs1000" "it is a file")
server-ensure-safe-dir("/tmp/emacs1000")
server-start(nil)
funcall-interactively(server-start nil)
call-interactively(server-start record nil)
command-execute(server-start record)
execute-extended-command(nil "server-start" nil)
funcall-interactively(execute-extended-command nil "server-start" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
--8<---------------cut here---------------end--------------->8---
Regards
In GNU Emacs 26.0.90 (build 1, arm-unknown-linux-gnueabihf, X toolkit, Xaw3d scroll bars)
of 2017-10-30 built on chulpaca
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: Debian GNU/Linux 9.2 (stretch)
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
server-ensure-safe-dir: ‘/tmp/emacs1000’ is not a safe directory because it is a file
C-x M-x is undefined
Configured using:
'configure --build=arm-linux-gnueabihf --prefix=/usr
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
--disable-silent-rules '--libdir=${prefix}/lib/arm-linux-gnueabihf'
'--libexecdir=${prefix}/lib/arm-linux-gnueabihf'
--disable-maintainer-mode --disable-dependency-tracking --prefix=/usr
--sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var
--with-x-toolkit=lucid --mandir=/usr/share/man
--pdfdir=/usr/share/doc/emacs --with-sound --without-gconf --with-xft
--without-xwidgets --with-gameuser=:games 'CFLAGS=-g -O2
-fdebug-prefix-map=/home/soni/abs/emacs-26.0.90=. -fstack-protector-strong
-Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time
-D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'
Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 LCMS2
Important settings:
value of $LC_COLLATE: C
value of $LC_MESSAGES: en_US.UTF-8
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 seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils server elec-pair
time-date mule-util 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 menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame 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 minibuffer
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 dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting x-toolkit x
multi-tty make-network-process emacs)
Memory information:
((conses 8 96243 9175)
(symbols 24 20650 1)
(miscs 20 39 160)
(strings 16 29484 1575)
(string-bytes 1 753255)
(vectors 8 14215)
(vector-slots 4 506728 10982)
(floats 8 51 66)
(intervals 28 274 11)
(buffers 528 11))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 20:15:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 29070 <at> debbugs.gnu.org (full text, mbox):
On Mon, Oct 30, 2017 at 4:02 PM, <rrandresf <at> gmail.com> wrote:
>
> Hi. after compiling the pretest. I do emacs -Q then M-x server-start then
> I am getting:
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (error "‘/tmp/emacs1000’ is not a safe directory because it is a file")
So is /tmp/emacs1000 a file and not a directory? Or is the message incorrect?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 21:27:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Emacs has created a directory. It creates it with 'server-start'
--
Andrés Ramirez Ramos
Development Engineer
Web:rrandresf.googlepages.com
On Mon, Oct 30, 2017 at 2:14 PM, Noam Postavsky
<npostavs <at> users.sourceforge.net> wrote:
> On Mon, Oct 30, 2017 at 4:02 PM, <rrandresf <at> gmail.com> wrote:
>>
>> Hi. after compiling the pretest. I do emacs -Q then M-x server-start then
>> I am getting:
>> --8<---------------cut here---------------start------------->8---
>> Debugger entered--Lisp error: (error "‘/tmp/emacs1000’ is not a safe directory because it is a file")
>
> So is /tmp/emacs1000 a file and not a directory? Or is the message incorrect?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 21:40:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 29070 <at> debbugs.gnu.org (full text, mbox):
On Mon, Oct 30, 2017 at 5:25 PM, rrandresf <at> gmail.com
<rrandresf <at> gmail.com> wrote:
> Emacs has created a directory. It creates it with 'server-start'
What does evaluating (file-attributes "/tmp/emacs1000" 'integer) give
you? Does it start with t or nil?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 22:42:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 29070 <at> debbugs.gnu.org (full text, mbox):
(t 2 1000 1000
(23031 33692 430033 322000)
(23031 41122 259655 752000)
(23031 41122 259655 752000)
60 "drwx------" t 545119 28)
On Mon, Oct 30, 2017 at 3:38 PM, Noam Postavsky
<npostavs <at> users.sourceforge.net> wrote:
> On Mon, Oct 30, 2017 at 5:25 PM, rrandresf <at> gmail.com
> <rrandresf <at> gmail.com> wrote:
>> Emacs has created a directory. It creates it with 'server-start'
>
> What does evaluating (file-attributes "/tmp/emacs1000" 'integer) give
> you? Does it start with t or nil?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 23:08:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 29070 <at> debbugs.gnu.org (full text, mbox):
"rrandresf <at> gmail.com" <rrandresf <at> gmail.com> writes:
> (t 2 1000 1000
> (23031 33692 430033 322000)
> (23031 41122 259655 752000)
> (23031 41122 259655 752000)
> 60 "drwx------" t 545119 28)
>
I can't work out how you could be getting this error, the message you
posted should only occur if the car of the attribute list is not t:
(unsafe (cond
((not (eq t (car attrs)))
(format "it is a %s" (if (stringp (car attrs))
"symlink" "file")))
Could you do M-x load-library RET server.el RET to load the source and
get a more detailed backtrace please. It should like something like
this:
Debugger entered--Lisp error: (error "‘/tmp/foo’ is not a safe directory because it is a file")
signal(error ("‘/tmp/foo’ is not a safe directory because it is a file"))
error("`%s' is not a safe directory because %s" "/tmp/foo" "it is a file")
(progn (error "`%s' is not a safe directory because %s" dir unsafe))
(if unsafe (progn (error "`%s' is not a safe directory because %s" dir unsafe)))
(let* ((uid (nth 2 attrs)) (w32 (eq system-type 'windows-nt)) (unsafe (cond ((not ....
(let ((attrs (file-attributes dir 'integer))) (if attrs nil (let* ((old (default-file-...
server-ensure-safe-dir("/tmp/foo")
...
And then hit 'v' on the "(let" lines to show local variables, so that it
looks like this:
Debugger entered--Lisp error: (error "‘/tmp/foo’ is not a safe directory because it is a file")
signal(error ("‘/tmp/foo’ is not a safe directory because it is a file"))
error("`%s' is not a safe directory because %s" "/tmp/foo" "it is a file")
(progn (error "`%s' is not a safe directory because %s" dir unsafe))
(if unsafe (progn (error "`%s' is not a safe directory because %s" dir unsafe)))
(let* ((uid (nth 2 attrs)) (w32 (eq system-type 'windows-nt)) (unsafe (cond ((not (eq t (car attr...
dir = "/tmp/foo"
attrs = (nil 1 1000 1000 (23031 44726 989651 161000) (23031 44726 989651 161000) (23031 44726 989651 161000) 0 "-rw-r--r--" t 3014718 2052)
uid = 1000
w32 = nil
unsafe = "it is a file"
(let ((attrs (file-attributes dir 'integer))) (if attrs nil (let* ((old (default-file-modes)))...
dir = "/tmp/foo"
attrs = (nil 1 1000 1000 (23031 44726 989651 161000) (23031 44726 989651 161000) (23031 44726 989651 161000) 0 "-rw-r--r--" t 3014718 2052)
server-ensure-safe-dir("/tmp/foo")
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 23:37:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 29070 <at> debbugs.gnu.org (full text, mbox):
On Mon, 30 Oct 2017 17:07:27 -0600,
Noam Postavsky wrote:
>
> "rrandresf <at> gmail.com" <rrandresf <at> gmail.com> writes:
>
> > (t 2 1000 1000
> > (23031 33692 430033 322000)
> > (23031 41122 259655 752000)
> > (23031 41122 259655 752000)
> > 60 "drwx------" t 545119 28)
Noam above was wrong: what I got was nil (tried it on another emacs,
sorry)
> Could you do M-x load-library RET server.el RET to load the source and
> get a more detailed backtrace please. It should like something like
> this:
btw: I have done also (setq server-name "pe")
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (error "‘/tmp/emacs1000’ is not a safe directory because it is a file")
signal(error ("‘/tmp/emacs1000’ is not a safe directory because it is a file"))
error("`%s' is not a safe directory because %s" "/tmp/emacs1000" "it is a file")
(progn (error "`%s' is not a safe directory because %s" dir unsafe))
(if unsafe (progn (error "`%s' is not a safe directory because %s" dir unsafe)))
(let* ((uid (nth 2 attrs)) (w32 (eq system-type 'windows-nt)) (unsafe (cond ((not (eq t (car attrs))) (format "it is a %s" (if (stringp (car attrs)) "symlink" "file"))) ((and w32 (= 0 uid)) (display-warning 'server (format-message "Using `%s' to store Emacs-server authentication files.\nDirectories on FAT32 filesystems are NOT secure against tampering.\nSee variable `server-auth-dir' for details." (file-name-as-directory dir)) :warning) nil) ((and (/= uid (user-uid)) (or (not w32) (/= uid 544) (/= (user-uid) 500))) (format "it is not owned by you (owner = %s (%d))" (user-full-name (user-uid)) (user-uid))) (w32 nil) ((/= 0 (logand 63 (file-modes dir))) (format "it is accessible by others (%03o)" (file-modes dir))) (t nil)))) (if unsafe (progn (error "`%s' is not a safe directory because %s" dir unsafe))))
dir = "/tmp/emacs1000"
attrs = nil
uid = nil
w32 = nil
unsafe = "it is a file"
(let ((attrs (file-attributes dir 'integer))) (if attrs nil (let* ((old (default-file-modes))) (unwind-protect (progn (progn (set-default-file-modes 448) 448) (make-directory dir t)) (let* ((v old)) (progn (set-default-file-modes v) v)))) (setq attrs (file-attributes dir 'integer))) (let* ((uid (nth 2 attrs)) (w32 (eq system-type 'windows-nt)) (unsafe (cond ((not (eq t (car attrs))) (format "it is a %s" (if (stringp (car attrs)) "symlink" "file"))) ((and w32 (= 0 uid)) (display-warning 'server (format-message "Using `%s' to store Emacs-server authentication files.\nDirectories on FAT32 filesystems are NOT secure against tampering.\nSee variable `server-auth-dir' for details." (file-name-as-directory dir)) :warning) nil) ((and (/= uid (user-uid)) (or (not w32) (/= uid 544) (/= (user-uid) 500))) (format "it is not owned by you (owner = %s (%d))" (user-full-name (user-uid)) (user-uid))) (w32 nil) ((/= 0 (logand 63 (file-modes dir))) (format "it is accessible by others (%03o)" (file-modes dir))) (t nil)))) (if unsafe (progn (error "`%s' is not a safe directory because %s" dir unsafe)))))
dir = "/tmp/emacs1000"
attrs = nil
server-ensure-safe-dir("/tmp/emacs1000")
(if leave-dead (progn (if (eq t leave-dead) nil (server-log (message "Server stopped"))) (setq server-process nil)) (server-ensure-safe-dir server-dir) (if server-process (progn (server-log (message "Restarting server")))) (let* ((old (default-file-modes))) (unwind-protect (progn (progn (set-default-file-modes 448) 448) (add-hook 'suspend-tty-functions 'server-handle-suspend-tty) (add-hook 'delete-frame-functions 'server-handle-delete-frame) (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function) (add-hook 'kill-emacs-hook 'server-force-stop t) (setq server-process (apply (function make-network-process) :name server-name :server t :noquery t :sentinel (function server-sentinel) :filter (function server-process-filter) :use-external-socket t :coding 'raw-text-unix (if server-use-tcp (list :family 'ipv4 :service (or server-port t) :host (or server-host 'local) :plist '(:authenticated nil)) (list :family 'local :service server-file :plist '(:authenticated t))))) (if server-process nil (error "Could not start server process")) (process-put server-process :server-file server-file) (if server-use-tcp (progn (let ((auth-key (server-get-auth-key))) (process-put server-process :auth-key auth-key) (let ((temp-file server-file) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp file*")))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (set-buffer-multibyte nil) (setq buffer-file-coding-system 'no-conversion) (insert (format-network-address (process-contact server-process :local)) " " (number-to-string (emacs-pid)) "\n" auth-key)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))) (let* ((v old)) (progn (set-default-file-modes v) v)))))
(let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)) (server-file (expand-file-name server-name server-dir))) (if server-process (progn (condition-case nil (progn (delete-process server-process)) (error nil)))) (if (not (eq t (server-running-p server-name))) (condition-case nil (progn (let (delete-by-moving-to-trash) (delete-file server-file))) (error nil)) (setq server-mode nil) (display-warning 'server (concat "Unable to start the Emacs server.\n" (format "There is an existing Emacs server, named %S.\n" server-name) (substitute-command-keys "To start the server in this Emacs process, stop the existing\nserver or call `\\[server-force-delete]' to forcibly disconnect it.")) :warning) (setq leave-dead t)) (while server-clients (server-delete-client (car server-clients))) (if leave-dead (progn (if (eq t leave-dead) nil (server-log (message "Server stopped"))) (setq server-process nil)) (server-ensure-safe-dir server-dir) (if server-process (progn (server-log (message "Restarting server")))) (let* ((old (default-file-modes))) (unwind-protect (progn (progn (set-default-file-modes 448) 448) (add-hook 'suspend-tty-functions 'server-handle-suspend-tty) (add-hook 'delete-frame-functions 'server-handle-delete-frame) (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function) (add-hook 'kill-emacs-hook 'server-force-stop t) (setq server-process (apply (function make-network-process) :name server-name :server t :noquery t :sentinel (function server-sentinel) :filter (function server-process-filter) :use-external-socket t :coding 'raw-text-unix (if server-use-tcp (list :family 'ipv4 :service (or server-port t) :host (or server-host 'local) :plist '(:authenticated nil)) (list :family 'local :service server-file :plist '(:authenticated t))))) (if server-process nil (error "Could not start server process")) (process-put server-process :server-file server-file) (if server-use-tcp (progn (let ((auth-key (server-get-auth-key))) (process-put server-process :auth-key auth-key) (let ((temp-file server-file) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp file*")))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (set-buffer-multibyte nil) (setq buffer-file-coding-system 'no-conversion) (insert (format-network-address (process-contact server-process :local)) " " (number-to-string (emacs-pid)) "\n" auth-key)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))) (let* ((v old)) (progn (set-default-file-modes v) v))))))
leave-dead = nil
inhibit-prompt = nil
server-dir = "/tmp/emacs1000"
server-file = "/tmp/emacs1000/pe"
(progn (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)) (server-file (expand-file-name server-name server-dir))) (if server-process (progn (condition-case nil (progn (delete-process server-process)) (error nil)))) (if (not (eq t (server-running-p server-name))) (condition-case nil (progn (let (delete-by-moving-to-trash) (delete-file server-file))) (error nil)) (setq server-mode nil) (display-warning 'server (concat "Unable to start the Emacs server.\n" (format "There is an existing Emacs server, named %S.\n" server-name) (substitute-command-keys "To start the server in this Emacs process, stop the existing\nserver or call `\\[server-force-delete]' to forcibly disconnect it.")) :warning) (setq leave-dead t)) (while server-clients (server-delete-client (car server-clients))) (if leave-dead (progn (if (eq t leave-dead) nil (server-log (message "Server stopped"))) (setq server-process nil)) (server-ensure-safe-dir server-dir) (if server-process (progn (server-log (message "Restarting server")))) (let* ((old (default-file-modes))) (unwind-protect (progn (progn (set-default-file-modes 448) 448) (add-hook 'suspend-tty-functions 'server-handle-suspend-tty) (add-hook 'delete-frame-functions 'server-handle-delete-frame) (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function) (add-hook 'kill-emacs-hook 'server-force-stop t) (setq server-process (apply (function make-network-process) :name server-name :server t :noquery t :sentinel (function server-sentinel) :filter (function server-process-filter) :use-external-socket t :coding 'raw-text-unix (if server-use-tcp (list :family 'ipv4 :service (or server-port t) :host (or server-host 'local) :plist '(:authenticated nil)) (list :family 'local :service server-file :plist '(:authenticated t))))) (if server-process nil (error "Could not start server process")) (process-put server-process :server-file server-file) (if server-use-tcp (progn (let ((auth-key (server-get-auth-key))) (process-put server-process :auth-key auth-key) (let ((temp-file server-file) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp file*")))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (set-buffer-multibyte nil) (setq buffer-file-coding-system 'no-conversion) (insert (format-network-address (process-contact server-process :local)) " " (number-to-string (emacs-pid)) "\n" auth-key)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))) (let* ((v old)) (progn (set-default-file-modes v) v)))))))
[no locals]
(if (or (not server-clients) (cond ((and (daemonp) (null (cdr (frame-list))) (eq (selected-frame) terminal-frame)) leave-dead) (inhibit-prompt t) (t (yes-or-no-p "The current server still has clients; delete them? ")))) (progn (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)) (server-file (expand-file-name server-name server-dir))) (if server-process (progn (condition-case nil (progn (delete-process server-process)) (error nil)))) (if (not (eq t (server-running-p server-name))) (condition-case nil (progn (let (delete-by-moving-to-trash) (delete-file server-file))) (error nil)) (setq server-mode nil) (display-warning 'server (concat "Unable to start the Emacs server.\n" (format "There is an existing Emacs server, named %S.\n" server-name) (substitute-command-keys "To start the server in this Emacs process, stop the existing\nserver or call `\\[server-force-delete]' to forcibly disconnect it.")) :warning) (setq leave-dead t)) (while server-clients (server-delete-client (car server-clients))) (if leave-dead (progn (if (eq t leave-dead) nil (server-log (message "Server stopped"))) (setq server-process nil)) (server-ensure-safe-dir server-dir) (if server-process (progn (server-log (message "Restarting server")))) (let* ((old (default-file-modes))) (unwind-protect (progn (progn (set-default-file-modes 448) 448) (add-hook 'suspend-tty-functions 'server-handle-suspend-tty) (add-hook 'delete-frame-functions 'server-handle-delete-frame) (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function) (add-hook 'kill-emacs-hook 'server-force-stop t) (setq server-process (apply (function make-network-process) :name server-name :server t :noquery t :sentinel (function server-sentinel) :filter (function server-process-filter) :use-external-socket t :coding 'raw-text-unix (if server-use-tcp (list :family 'ipv4 :service (or server-port t) :host (or server-host 'local) :plist '(:authenticated nil)) (list :family 'local :service server-file :plist '(:authenticated t))))) (if server-process nil (error "Could not start server process")) (process-put server-process :server-file server-file) (if server-use-tcp (progn (let ((auth-key (server-get-auth-key))) (process-put server-process :auth-key auth-key) (let ((temp-file server-file) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp file*")))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (set-buffer-multibyte nil) (setq buffer-file-coding-system 'no-conversion) (insert (format-network-address (process-contact server-process :local)) " " (number-to-string (emacs-pid)) "\n" auth-key)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))) (let* ((v old)) (progn (set-default-file-modes v) v))))))))
server-start(nil)
funcall-interactively(server-start nil)
call-interactively(server-start record nil)
command-execute(server-start record)
execute-extended-command(nil "server-start" "server-start")
funcall-interactively(execute-extended-command nil "server-start" "server-start")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
--8<---------------cut here---------------end--------------->8---
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Mon, 30 Oct 2017 23:53:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 29070 <at> debbugs.gnu.org (full text, mbox):
andrés ramírez <rrandresf <at> gmail.com> writes:
> Noam above was wrong: what I got was nil (tried it on another emacs,
> sorry)
> btw: I have done also (setq server-name "pe")
>
> Debugger entered--Lisp error: (error "‘/tmp/emacs1000’ is not a safe directory because it is a file")
> signal(error ("‘/tmp/emacs1000’ is not a safe directory because it is a file"))
> error("`%s' is not a safe directory because %s" "/tmp/emacs1000" "it is a file")
> (progn (error "`%s' is not a safe directory because %s" dir unsafe))
> (if unsafe (progn (error "`%s' is not a safe directory because %s" dir unsafe)))
> (let* ((uid (nth 2 attrs)) (w32 (eq system-type 'windows-nt))...
> dir = "/tmp/emacs1000"
> attrs = nil
Hmm, I think that means it doesn't exist (could you double check that by
running 'ls /tmp/emacs1000' in the shell?). Since
server-ensure-safe-dir tries to create it if it doesn't exist, something
must be deleting it directly after, does that sound plausible?
> uid = nil
> w32 = nil
> unsafe = "it is a file"
> (let ((attrs (file-attributes dir 'integer))) (if attrs nil (let...
> dir = "/tmp/emacs1000"
> attrs = nil
> server-ensure-safe-dir("/tmp/emacs1000")
> (if leave-dead...
> (let* ((server-dir ...
> leave-dead = nil
> inhibit-prompt = nil
> server-dir = "/tmp/emacs1000"
> server-file = "/tmp/emacs1000/pe"
> (progn (let* ((server-...
> [no locals]
> (if (or (not server-clien...
> server-start(nil)
> funcall-interactively(server-start nil)
> call-interactively(server-start record nil)
> command-execute(server-start record)
> execute-extended-command(nil "server-start" "server-start")
> funcall-interactively(execute-extended-command nil "server-start" "server-start")
> call-interactively(execute-extended-command nil nil)
> command-execute(execute-extended-command)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 00:19:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 29070 <at> debbugs.gnu.org (full text, mbox):
On Mon, 30 Oct 2017 17:52:22 -0600,
Noam Postavsky wrote:
> Hmm, I think that means it doesn't exist (could you double check that by
> running 'ls /tmp/emacs1000' in the shell?). Since
> server-ensure-safe-dir tries to create it if it doesn't exist, something
> must be deleting it directly after, does that sound plausible?
It does not seem plausible.
Noam. I have those 2 other emacs sessions from anothir binary running
--8<---------------cut here---------------start------------->8---
GNU Emacs 26.0.50 (build 1, arm-unknown-linux-gnueabihf, X toolkit, Xaw3d scroll bars)
of 2017-07-15
--8<---------------cut here---------------end--------------->8---
This is the binary we are debugging:
--8<---------------cut here---------------start------------->8---
GNU Emacs 26.0.90 (build 1, armv7l-unknown-linux-gnueabihf, X toolkit, Xaw3d scroll bars)
of 2017-10-30
--8<---------------cut here---------------end--------------->8---
--8<---------------cut here---------------start------------->8---
Welcome to the Emacs shell
~ $ ls /tmp/emacs1000
ns server
~ $
--8<---------------cut here---------------end--------------->8---
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 00:43:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 29070 <at> debbugs.gnu.org (full text, mbox):
andrés ramírez <rrandresf <at> gmail.com> writes:
> ~ $ ls /tmp/emacs1000
> ns server
> ~ $
Hmm, doesn't make sense that it could be disappearing in the middle and
still have other stuff inside. So that suggests that something is wrong
with the file-attributes function. Does (file-attributes
"/tmp/emacs1000") consistently give you nil if you evaluate it multiple
times? What about (file-exists-p "/tmp/emacs1000")? (file-directory-p
"/tmp/emacs1000")?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 02:00:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Noam.
> Hmm, doesn't make sense that it could be disappearing in the middle and
> still have other stuff inside. So that suggests that something is wrong
> with the file-attributes function. Does (file-attributes
> "/tmp/emacs1000") consistently give you nil if you evaluate it multiple
> times? What about (file-exists-p "/tmp/emacs1000")? (file-directory-p
> "/tmp/emacs1000")?
Yes. Consistently gave me 'nil'. I have evaluated more than 20 times
--8<---------------cut here---------------start------------->8---
Welcome to the Emacs shell
~/abs/emacs-26.0.90/build-arm $ (file-attributes "/tmp/emacs1000")
~/abs/emacs-26.0.90/build-arm $ (file-attributes "/tmp/emacs1000")
~/abs/emacs-26.0.90/build-arm $ (file-exists-p "/tmp/emacs1000")
t
~/abs/emacs-26.0.90/build-arm $ (file-exists-p "/tmp/emacs1000")
t
~/abs/emacs-26.0.90/build-arm $ (file-directory-p "/tmp/emacs1000")
t
~/abs/emacs-26.0.90/build-arm $ (file-directory-p "/tmp/emacs1000")
t
~/abs/emacs-26.0.90/build-arm $ (pp (file-attributes "/tmp/emacs1000"))
nil
~/abs/emacs-26.0.90/build-arm $
--8<---------------cut here---------------end--------------->8---
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 02:12:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 29070 <at> debbugs.gnu.org (full text, mbox):
retitle 29070 26.0.90; (file-attributes dir) => nil, even though (and (file-exists-p dir) (file-directory-p dir)) => t
quit
andrés ramírez <rrandresf <at> gmail.com> writes:
> Yes. Consistently gave me 'nil'. I have evaluated more than 20 times
> ~/abs/emacs-26.0.90/build-arm $ (file-directory-p "/tmp/emacs1000")
> t
> ~/abs/emacs-26.0.90/build-arm $ (pp (file-attributes "/tmp/emacs1000"))
> nil
Okay, can you run under gdb, and step through Ffile_attributes to see
where it's going wrong?
Changed bug title to '26.0.90; (file-attributes dir) => nil, even though (and (file-exists-p dir) (file-directory-p dir)) => t' from '26.0.90; emacs-26.0.90 pretest'
Request was from
Noam Postavsky <npostavs <at> users.sourceforge.net>
to
control <at> debbugs.gnu.org
.
(Tue, 31 Oct 2017 02:12:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 02:33:01 GMT)
Full text and
rfc822 format available.
Message #43 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Noam.
> Okay, can you run under gdb, and step through Ffile_attributes to see
> where it's going wrong?
The task is not so easy. When starting emacs "Ffile_attributes" is
called multiple times. I just need to stop the breakpoint when
'Lisp_Object filename' = "/tmp/emacs1000". How coul I code that
condition inside the function?
In the meantime. I have tried the same source code (pretest) on another equal machine with
another distro (archlinux). The issue is not present on the archlinux
distro.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 02:50:02 GMT)
Full text and
rfc822 format available.
Message #46 received at 29070 <at> debbugs.gnu.org (full text, mbox):
andrés ramírez <rrandresf <at> gmail.com> writes:
> Hi Noam.
>> Okay, can you run under gdb, and step through Ffile_attributes to see
>> where it's going wrong?
> The task is not so easy. When starting emacs "Ffile_attributes" is
> called multiple times. I just need to stop the breakpoint when
> 'Lisp_Object filename' = "/tmp/emacs1000". How coul I code that
> condition inside the function?
gdb --args ./emacs -Q
(gdb) run
Let Emacs startup, then hit C-z in the terminal which runs gdb. This
will stop Emacs, and give you back a gdb prompt.
(gdb) break Ffile_attributes
(gdb) continue
Now that you have a breakpoint in Ffile_attributes, you can call it from
Emacs.
> In the meantime. I have tried the same source code (pretest) on another equal machine with
> another distro (archlinux). The issue is not present on the archlinux
> distro.
You mentioned other Emacs versions on the same machine. Is it only
26.0.90 which shows this problem (and only on the one machine)?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 03:06:01 GMT)
Full text and
rfc822 format available.
Message #49 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Noam.
> gdb --args ./emacs -Q
> (gdb) run
I have been able of debug it. The error seems to be inside this function. When doing M-x
server-start. Any other tip for debugging it?
--8<---------------cut here---------------start------------->8---
return file_attributes (AT_FDCWD, SSDATA (encoded), Qnil, filename,
id_format);
--8<---------------cut here---------------end--------------->8---
Is it ok to pass this code?
--8<---------------cut here---------------start------------->8---
if (err != 0)
return unbind_to (count, Qnil);
--8<---------------cut here---------------end--------------->8---
> You mentioned other Emacs versions on the same machine. Is it only
> 26.0.90 which shows this problem (and only on the one machine)?
Yes. You are Right 26.0.90 is the only one that exhibits this
problem. It is debian jessie.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 03:23:02 GMT)
Full text and
rfc822 format available.
Message #52 received at 29070 <at> debbugs.gnu.org (full text, mbox):
andrés ramírez <rrandresf <at> gmail.com> writes:
> Hi Noam.
>> gdb --args ./emacs -Q
>> (gdb) run
>
> I have been able of debug it. The error seems to be inside this function. When doing M-x
> server-start. Any other tip for debugging it?
>
> return file_attributes (AT_FDCWD, SSDATA (encoded), Qnil, filename,
> id_format);
>
> Is it ok to pass this code?
>
> if (err != 0)
> return unbind_to (count, Qnil);
What do you mean by "to pass"? Do you mean that err is not 0, so you
execute the return statement? Or err is 0, so you go past it?
Since you are getting nil, I guess the you mean the first thing. What
is 'err' at that point? Is it the 'openat' or the 'fstat' call which
failed?
(gdb) p err
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 03:28:02 GMT)
Full text and
rfc822 format available.
Message #55 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Noam.
>
> Since you are getting nil, I guess the you mean the first thing. What
> is 'err' at that point? Is it the 'openat' or the 'fstat' call which
> failed?
>
> (gdb) p err
fstat
err= 9
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 10:32:02 GMT)
Full text and
rfc822 format available.
Message #58 received at 29070 <at> debbugs.gnu.org (full text, mbox):
andrés ramírez <rrandresf <at> gmail.com> writes:
>> (gdb) p err
>
> fstat
> err= 9
According to [1] this means "bad file descriptor". But please step
through file_attributes and check which of 'fopenat' or 'fstat' produced
the error.
[1]: http://www.ioplex.com/~miallen/errcmp.html
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 12:14:01 GMT)
Full text and
rfc822 format available.
Message #61 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Noam.
> > fstat
> > err= 9
>
> According to [1] this means "bad file descriptor". But please step
> through file_attributes and check which of 'fopenat' or 'fstat' produced
> the error.
>
> [1]: http://www.ioplex.com/~miallen/errcmp.html
if (fstat (namefd, &s) != 0)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 13:13:01 GMT)
Full text and
rfc822 format available.
Message #64 received at 29070 <at> debbugs.gnu.org (full text, mbox):
What is the kernel version you are running?
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 13:39:01 GMT)
Full text and
rfc822 format available.
Message #67 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Andreas.
> What is the kernel version you are running?
--8<---------------cut here---------------start------------->8---
Linux chulpaca 3.4.113-sun8i #18 SMP PREEMPT Thu Jun 15 02:16:06 CEST 2017 armv7l GNU/Linux
--8<---------------cut here---------------end--------------->8---
Btw.
I am sharing config.log. from 26.0.50
--8<---------------cut here---------------start------------->8---
https://transfer.sh/14mN4H/config.log
--8<---------------cut here---------------end--------------->8---
And also config.log from pretest
--8<---------------cut here---------------start------------->8---
https://transfer.sh/Oe48v/config.log
--8<---------------cut here---------------end--------------->8---
It seems something have changed on configure between 26.0.50 and pretest
AR
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 14:28:02 GMT)
Full text and
rfc822 format available.
Message #70 received at 29070 <at> debbugs.gnu.org (full text, mbox):
On Okt 31 2017, andrés ramírez <rrandresf <at> gmail.com> wrote:
> Hi Andreas.
>> What is the kernel version you are running?
>
> Linux chulpaca 3.4.113-sun8i #18 SMP PREEMPT Thu Jun 15 02:16:06 CEST 2017 armv7l GNU/Linux
That kernel does not support fstat on the O_PATH fd. Please try this
patch:
diff --git a/src/dired.c b/src/dired.c
index 28d1cffb44..f192cf5c49 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -953,7 +953,14 @@ file_attributes (int fd, char const *name,
{
record_unwind_protect_int (close_file_unwind, namefd);
if (fstat (namefd, &s) != 0)
- err = errno;
+ {
+ err = errno;
+ /* The Linux kernel only supports fstat on O_PATH file
+ descriptors since version 3.6. Handle this error like
+ missing support for O_PATH. */
+ if (err == EBADF)
+ err = EINVAL;
+ }
else
{
err = 0;
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 15:20:01 GMT)
Full text and
rfc822 format available.
Message #73 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Andreas.
>
> That kernel does not support fstat on the O_PATH fd. Please try this
> patch:
That patch did the trick. Thanks. I have an additional question.
I have another older machine:
--8<---------------cut here---------------start------------->8---
Linux Nokia-N900 2.6.28-omap1 #1 PREEMPT Sat Nov 28 18:02:37 CET 2015 armv7l GNU/Linux
--8<---------------cut here---------------end--------------->8---
I have not compiled there yet. This patch would fix compilation there also?
AR
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Tue, 31 Oct 2017 20:23:01 GMT)
Full text and
rfc822 format available.
Message #76 received at 29070 <at> debbugs.gnu.org (full text, mbox):
On Okt 31 2017, andrés ramírez <rrandresf <at> gmail.com> wrote:
> I have another older machine:
>
> Linux Nokia-N900 2.6.28-omap1 #1 PREEMPT Sat Nov 28 18:02:37 CET 2015 armv7l GNU/Linux
>
> I have not compiled there yet. This patch would fix compilation there also?
Which compilation problem?
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Wed, 01 Nov 2017 01:01:02 GMT)
Full text and
rfc822 format available.
Message #79 received at 29070 <at> debbugs.gnu.org (full text, mbox):
Hi Andreas.
>
> Which compilation problem?
No problem. It compiled fine. And worked as expected.
Thanks guys.
Reply sent
to
Andreas Schwab <schwab <at> linux-m68k.org>
:
You have taken responsibility.
(Wed, 01 Nov 2017 20:49:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
rrandresf <at> gmail.com
:
bug acknowledged by developer.
(Wed, 01 Nov 2017 20:49:02 GMT)
Full text and
rfc822 format available.
Message #84 received at 29070-done <at> debbugs.gnu.org (full text, mbox):
Thanks for testing.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#29070
; Package
emacs
.
(Wed, 01 Nov 2017 23:48:01 GMT)
Full text and
rfc822 format available.
Message #87 received at 29070 <at> debbugs.gnu.org (full text, mbox):
andrés ramírez <rrandresf <at> gmail.com> writes:
> No problem. It compiled fine. And worked as expected.
>
> Thanks guys.
In addition to Anreads' fix, I modified the error message for this case,
so we won't claim that the directory is a file for nil file-attributes.
For reference, the relevant commit are:
[1: 8453423c7c]: 2017-11-01 21:44:49 +0100
Avoid wrong value from file-attributes on Linux kernel before 3.6
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8453423c7c5e1886a301fb61c4077650f59e670b
[2: dc0a25c2f9]: 2017-11-01 19:39:34 -0400
Give a more sensible message if file-attributes fails (Bug#29070)
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dc0a25c2f9b44c697194bd0ec21c942125160544
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 203 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.