GNU bug report logs - #29231
26.0.90; invald file name for symbolic files

Previous Next

Package: emacs;

Reported by: Vincent Zhang <vincent_chueng <at> hotmail.com>

Date: Thu, 9 Nov 2017 17:43:02 UTC

Severity: normal

Merged with 28865

Found in version 26.0.90

Done: Alan Third <alan <at> idiocy.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 29231 in the body.
You can then email your comments to 29231 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Thu, 09 Nov 2017 17:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincent Zhang <vincent_chueng <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 09 Nov 2017 17:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vincent Zhang <vincent_chueng <at> hotmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.0.90; invald file name for symbolic files
Date: Thu, 9 Nov 2017 17:41:42 +0000
[Message part 1 (text/plain, inline)]
In Emacs 24 an 25, the symbolic file names are same as other files (e.g.
'~/xxx), but in Emacs 26, the file name is '~/xxx/', thus 'ido' or 'ivy'
handles files incorrectly. In fact, it will recognize it as a folder and
create a new file.


In GNU Emacs 26.0.90 (build 1, x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))
of 2017-10-12 built on builder10-9.local
Windowing system distributor 'Apple', version 10.3.1561
Recent messages:
Auto-saving...done
Mark set
Send this bug report to the Emacs maintainers? (y or n) y
Sending...
Mark set [2 times]
Sending via mail...
Quit
mwheel-scroll: Beginning of buffer [3 times]
C-c RET C-g is undefined
Buffer *unsent mail to bug-gnu-emacs* modified; kill anyway? (y or n) y

Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Important settings:
  value of $LANG: en_CN.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  counsel-mode: t
  ivy-mode: t
  server-mode: t
  save-place-mode: t
  spaceline-info-mode: t
  smooth-scrolling-mode: t
  delete-selection-mode: t
  global-hl-line-mode: t
  show-paren-mode: t
  winner-mode: t
  window-numbering-mode: t
  popwin-mode: t
  eyebrowse-mode: t
  browse-url-dwim-mode: t
  global-emojify-mode: t
  emojify-mode: t
  dumb-jump-mode: t
  savehist-mode: t
  shell-dirtrack-mode: t
  global-aggressive-indent-mode: t
  aggressive-indent-mode: t
  drag-stuff-global-mode: t
  drag-stuff-mode: t
  global-hungry-delete-mode: t
  hungry-delete-mode: t
  ace-pinyin-global-mode: t
  ace-pinyin-mode: t
  global-anzu-mode: t
  anzu-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  global-company-mode: t
  company-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  indent-guide-global-mode: t
  indent-guide-mode: t
  volatile-highlights-mode: t
  global-auto-revert-mode: t
  diff-hl-flydiff-mode: t
  global-diff-hl-mode: t
  which-key-mode: t
  projectile-rails-global-mode: t
  projectile-mode: t
  flycheck-pos-tip-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  diff-auto-refine-mode: t
  recentf-mode: t
  rainbow-mode: t
  elisp-slime-nav-mode: t
  display-line-numbers-mode: t
  goto-address-prog-mode: t
  subword-mode: t
  symbol-overlay-mode: t
  highlight-parentheses-mode: t
  rainbow-delimiters-mode: t
  fic-mode: t
  whitespace-mode: t
  editorconfig-mode: t
  electric-pair-mode: t
  persistent-scratch-autosave-mode: t
  desktop-save-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-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
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(network-stream starttls mailalias smtpmail shadow sort mail-extr
emacsbug message rfc822 mml mml-sec epa epg mm-decode mm-bodies
mm-encode mailabbrev gmm-utils mailheader sendmail smex ivy-hydra
bookmark pp company-c-headers counsel-projectile counsel esh-util swiper
colir ivy flx ivy-overlay tide tide-lv typescript-mode ido cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs mwim time server saveplace spaceline-config spaceline-segments
spaceline powerline powerline-separators powerline-themes cnfonts
cnfonts-ui cus-edit cus-start cus-load smooth-scrolling delsel ace-link
company-emoji company-emoji-list hl-line paren browse-kill-ring derived
windmove winner window-numbering popwin eyebrowse browse-url-dwim
string-utils list-utils rg emojify apropos tar-mode ht dumb-jump popup
dockerfile-mode org-indent org-bullets org-rmail org-mhe org-irc
org-info org-gnus gnus-util rmail rmail-loaddefs mail-utils org-docview
doc-view jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m
org-element avl-tree generator ob-ruby ob-python org org-macro
org-footnote org-pcomplete org-list org-faces org-entities org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-china-x
cal-china lunar solar cal-dst holidays hol-loaddefs cal-menu calendar
cal-loaddefs view noutline outline conf-mode vc-mtn vc-hg vc-bzr vc-src
vc-sccs vc-svn vc-cvs vc-rcs diff-hl-dired dired-rainbow
dired-hacks-utils dired-quick-sort savehist ls-lisp dired-x dired
dired-loaddefs rspec-mode robe url-http tls gnutls url-auth mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc
puny ruby-refactor rubocop tramp tramp-compat tramp-loaddefs trampver
shell pcomplete parse-time format-spec yard-mode company-go
go-projectile go-rename go-guru go-eldoc imenu go-mode url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap find-file ffap sh-script executable aggressive-indent
drag-stuff hungry-delete ace-pinyin pinyinlib anzu undo-tree
company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-css company-nxml company-bbdb company-shell
company-yasnippet company-robe company-quickhelp company pcase yasnippet
indent-guide volatile-highlights autorevert filenotify diff-hl-flydiff
diff diff-hl vc-dir ewoc vc vc-dispatcher which-key projectile-rails
rake f s inflections inf-ruby ruby-mode smie projectile grep compile
comint ibuf-ext ibuffer ibuffer-loaddefs avy-flycheck avy
flycheck-pos-tip pos-tip flycheck json map find-func subr-x dash vc-git
diff-mode open-junk-file recentf tree-widget wid-edit editorconfig-core
editorconfig-core-handle editorconfig-fnmatch rainbow-mode ansi-color
color elisp-slime-nav etags xref project display-line-numbers goto-addr
cap-words superword subword symbol-overlay thingatpt
highlight-parentheses rainbow-delimiters fic-mode whitespace
editorconfig elec-pair persistent-scratch init-restore desktop frameset
init-prog init-web init-ruby init-python init-go init-c init-emacs-lisp
init-projectile init-flycheck init-vcs init-utils init-funcs init-org
hydra ring lv init-eshell init-shell init-window init-kill-ring
init-ibuffer init-highlight init-dired init-calendar init-yasnippet
init-company init-ivy init-edit init-ui cl-extra help-mode
spacemacs-dark-theme spacemacs-common init-basic exec-path-from-shell
init-package use-package diminish bind-key easy-mmode finder-inf edmacro
kmacro rx cl info advice package easymenu epg-config url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib init-custom init-const time-date tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win
ns-win ucs-normalize mule-util term/common-win 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 kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 758796 113848)
(symbols 48 55898 7)
(miscs 40 1913 3182)
(strings 32 221355 16229)
(string-bytes 1 5553603)
(vectors 16 111170)
(vector-slots 8 3520629 41305)
(floats 8 1112 793)
(intervals 56 18719 421)
(buffers 992 72))

--
Best Regards,
Vincent Zhang


Best Regards,
Vincent Zhang




[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Thu, 09 Nov 2017 20:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Vincent Zhang <vincent_chueng <at> hotmail.com>
Cc: 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Thu, 09 Nov 2017 22:17:45 +0200
> From: Vincent Zhang <vincent_chueng <at> hotmail.com>
> Date: Thu, 9 Nov 2017 17:41:42 +0000
> 
> In Emacs 24 an 25, the symbolic file names are same as other files (e.g.
> '~/xxx), but in Emacs 26, the file name is '~/xxx/', thus 'ido' or 'ivy'
> handles files incorrectly. In fact, it will recognize it as a folder and
> create a new file.

Thanks, but please provide a minimal recipe to reproduce this,
starting from "emacs -Q".  This will allow us to investigate the
issue.




Merged 28865 29231. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Thu, 09 Nov 2017 21:13:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Fri, 10 Nov 2017 02:50:02 GMT) Full text and rfc822 format available.

Message #13 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Zhang <vincent_chueng <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "29231 <at> debbugs.gnu.org" <29231 <at> debbugs.gnu.org>
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Fri, 10 Nov 2017 02:49:34 +0000
[Message part 1 (text/plain, inline)]
I reproduced with "emacs -Q" with emacs 26.0.90 on macOS10.13.1. No issue on emacs 25.3.1. Thanks!

Best Regards,
Vincent Zhang

-------- 原始邮件 --------
主题:Re: bug#29231: 26.0.90; invald file name for symbolic files
发件人:Eli Zaretskii
收件人:Vincent Zhang
抄送:29231 <at> debbugs.gnu.org

> From: Vincent Zhang <vincent_chueng <at> hotmail.com>
> Date: Thu, 9 Nov 2017 17:41:42 +0000
>
> In Emacs 24 an 25, the symbolic file names are same as other files (e.g.
> '~/xxx), but in Emacs 26, the file name is '~/xxx/', thus 'ido' or 'ivy'
> handles files incorrectly. In fact, it will recognize it as a folder and
> create a new file.

Thanks, but please provide a minimal recipe to reproduce this,
starting from "emacs -Q".  This will allow us to investigate the
issue.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Fri, 10 Nov 2017 08:14:01 GMT) Full text and rfc822 format available.

Message #16 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Vincent Zhang <vincent_chueng <at> hotmail.com>
Cc: 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Fri, 10 Nov 2017 10:13:25 +0200
> From: Vincent Zhang <vincent_chueng <at> hotmail.com>
> CC: "29231 <at> debbugs.gnu.org" <29231 <at> debbugs.gnu.org>
> Date: Fri, 10 Nov 2017 02:49:34 +0000
> 
> I reproduced with "emacs -Q" with emacs 26.0.90 on macOS10.13.1. No issue on emacs 25.3.1. Thanks!

Great, so please tell how you reproduced this.  That is, please
describe step by step what you did, both inside Emacs and outside it,
to reproduce the problem.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Fri, 10 Nov 2017 10:11:01 GMT) Full text and rfc822 format available.

Message #19 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Zhang <vincent_chueng <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "29231 <at> debbugs.gnu.org" <29231 <at> debbugs.gnu.org>
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Fri, 10 Nov 2017 10:10:38 +0000
[Message part 1 (text/plain, inline)]
Steps:
1. Start GNU Emacs 26.0.90 GUI via `Emacs -Q' on macOS 10.13.1.
2. Create some symbolic files (e.g. ~/.zshrc -> ~/.dotfiles/.zshrc) in the home folders.
3. Enable `ido-mode`, and `find-file` to open the symbolic files (~/.zshrc).

Results:
`~/.zshrc/` is showed in minibuffer after pressing `TAB`, and Emacs treats it as a folder and create a new one.
In Emacs 25, only `~/.zshrc` is showed, and Emacs gives a prompt of opening a symbolic file.

Am I missing anything?

Thanks!
________________________________
From: Eli Zaretskii <eliz <at> gnu.org>
Sent: Friday, November 10, 2017 8:13 AM
To: Vincent Zhang
Cc: 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files

> From: Vincent Zhang <vincent_chueng <at> hotmail.com>
> CC: "29231 <at> debbugs.gnu.org" <29231 <at> debbugs.gnu.org>
> Date: Fri, 10 Nov 2017 02:49:34 +0000
>
> I reproduced with "emacs -Q" with emacs 26.0.90 on macOS10.13.1. No issue on emacs 25.3.1. Thanks!

Great, so please tell how you reproduced this.  That is, please
describe step by step what you did, both inside Emacs and outside it,
to reproduce the problem.

Thanks.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Sat, 11 Nov 2017 08:56:01 GMT) Full text and rfc822 format available.

Message #22 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Vincent Zhang <vincent_chueng <at> hotmail.com>, Alan Third <alan <at> idiocy.org>
Cc: 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Sat, 11 Nov 2017 10:54:57 +0200
> From: Vincent Zhang <vincent_chueng <at> hotmail.com>
> CC: "29231 <at> debbugs.gnu.org" <29231 <at> debbugs.gnu.org>
> Date: Fri, 10 Nov 2017 10:10:38 +0000
> 
> Steps:
> 1. Start GNU Emacs 26.0.90 GUI via `Emacs -Q' on macOS 10.13.1.
> 2. Create some symbolic files (e.g. ~/.zshrc -> ~/.dotfiles/.zshrc) in the home folders.
> 3. Enable `ido-mode`, and `find-file` to open the symbolic files (~/.zshrc). 
> 
> Results:
> `~/.zshrc/` is showed in minibuffer after pressing `TAB`, and Emacs treats it as a folder and create a new
> one.
> In Emacs 25, only `~/.zshrc` is showed, and Emacs gives a prompt of opening a symbolic file.
> 
> Am I missing anything?

It's a macOS specific bug.

Alan, I think the problem might be in the macOS implementation of
faccessat, called here:

  /* Return true if in the directory FD the directory entry DP, whose
     string length is LEN, is that of a subdirectory that can be searched.  */
  static bool
  file_name_completion_dirp (int fd, struct dirent *dp, ptrdiff_t len)
  {
    USE_SAFE_ALLOCA;
    char *subdir_name = SAFE_ALLOCA (len + 2);
    memcpy (subdir_name, dp->d_name, len);
    strcpy (subdir_name + len, "/");
    bool dirp = faccessat (fd, subdir_name, F_OK, AT_EACCESS) == 0;
    SAFE_FREE ();
    return dirp;
  }

This assumes that calling faccessat with an argument "foo/" will
return zero (i.e. succeed) only if "foo" is a directory, but will fail
(return non-zero) if it's a file.  I'm guessing that on macOS, this
call succeeds even for files, or maybe just for symlinks to files.
Could you (or someone else) please look into that?  I don't have
access to a macOS system.

Btw, does macOS have faccessat, or does it use the Gnulib replacement?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Sat, 11 Nov 2017 18:26:01 GMT) Full text and rfc822 format available.

Message #25 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Vincent Zhang <vincent_chueng <at> hotmail.com>,
 Paul Eggert <eggert <at> cs.ucla.edu>, 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Sat, 11 Nov 2017 18:25:20 +0000
On Sat, Nov 11, 2017 at 10:54:57AM +0200, Eli Zaretskii wrote:
> This assumes that calling faccessat with an argument "foo/" will
> return zero (i.e. succeed) only if "foo" is a directory, but will fail
> (return non-zero) if it's a file.  I'm guessing that on macOS, this
> call succeeds even for files, or maybe just for symlinks to files.

Only with symlinks faccessat returns success if it’s pointing to a
file and you put ‘/’ on the end. It looks like perhaps adding / to the
end ‘resolves’ symlinks:

    breton:/Users/alan>ls -l cows
    -rw-r--r--  1 alan  staff  0 11 Nov 17:33 cows
    breton:/Users/alan>ls cows/
    ls: cows/: Not a directory
    breton:/Users/alan>ln -s cows moo
    breton:/Users/alan>ls -l moo
    lrwxr-xr-x  1 alan  staff  4 11 Nov 18:14 moo -> cows
    breton:/Users/alan>ls -l moo/
    -rw-r--r--  1 alan  staff  0 11 Nov 17:33 moo/

> Btw, does macOS have faccessat, or does it use the Gnulib replacement?

macOS does have faccessat.

I’m not sure what the fix should be here. The commit introducing this
bug is:

commit 3a8d0cc825635e07da2a90c4ac987b476fc9b05d (HEAD -> emacs-26)
Author: Paul Eggert <eggert <at> cs.ucla.edu>
Date:   Mon Jul 31 12:31:02 2017 -0700

    Avoid most stat calls when completing file names

    * admin/merge-gnulib (GNULIB_MODULES): Add d-type.
    * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
    * m4/d-type.m4: New file, copied from gnulib.
    * src/dired.c (DT_UNKNOWN, DT_DIR, DT_LINK)
    [!HAVE_STRUCT_DIRENT_D_TYPE]: New constants.
    (dirent_type): New function.
    (file_name_completion): Use it, to avoid unnecessary calls to
    stat-like functions on GNU/Linux and other platforms with d_type.
    (file_name_completion_stat): Just follow the link; there is no
    need to try first with AT_SYMLINK_NOFOLLOW since the directory
    entry was already checked to exist.

Perhaps revert to the old behaviour for Darwin OS?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Sat, 11 Nov 2017 19:01:02 GMT) Full text and rfc822 format available.

Message #28 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: vincent_chueng <at> hotmail.com, eggert <at> cs.ucla.edu, 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Sat, 11 Nov 2017 21:00:33 +0200
> Date: Sat, 11 Nov 2017 18:25:20 +0000
> From: Alan Third <alan <at> idiocy.org>
> Cc: Vincent Zhang <vincent_chueng <at> hotmail.com>, 29231 <at> debbugs.gnu.org,
> 	Paul Eggert <eggert <at> cs.ucla.edu>
> 
> Only with symlinks faccessat returns success if it’s pointing to a
> file and you put ‘/’ on the end. It looks like perhaps adding / to the
> end ‘resolves’ symlinks:
> [...]
> Perhaps revert to the old behaviour for Darwin OS?

Yes, if no better ideas come up, we should revert to calling 'stat' on
Darwin, IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Sat, 11 Nov 2017 23:22:02 GMT) Full text and rfc822 format available.

Message #31 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Alan Third <alan <at> idiocy.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: Vincent Zhang <vincent_chueng <at> hotmail.com>, 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Sat, 11 Nov 2017 15:21:26 -0800
Alan Third wrote:
> Only with symlinks faccessat returns success if it’s pointing to a
> file and you put ‘/’ on the end.

This is a well-known problem on macOS, and Emacs is supposed to compile a 
replacement fstatat function by building lib/fstatat.o and linking to that, and 
this replacement is supposed to implement the POSIX-required behavior where a 
trailing / works only on directories (or symlinks to directories, if following 
symlinks).

Evidently this replacement procedure is not working somehow. Please tell us 
whether the executable contains an fstatat workaround. You can do that via 
something like this:

$ gdb src/temacs
(gdb) disas rpl_fstatat

and I'd like to see the output of the 'disas' command.

Also, what are the values of the following macros in src/config.h? (The values 
on GNU/Linux are as shown.)

#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
#define HAVE_FSTATAT 1
/* #undef HAVE_WORKING_FSTATAT_ZERO_FLAG */




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Sun, 12 Nov 2017 07:20:01 GMT) Full text and rfc822 format available.

Message #34 received at 29231 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Alan Third <alan <at> idiocy.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: Vincent Zhang <vincent_chueng <at> hotmail.com>, 29231 <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Sat, 11 Nov 2017 23:19:05 -0800
[Message part 1 (text/plain, inline)]
Paul Eggert wrote:
> Alan Third wrote:
>> Only with symlinks faccessat returns success if it’s pointing to a
>> file and you put ‘/’ on the end.
> 
> This is a well-known problem on macOS, and Emacs is supposed to compile a 
> replacement fstatat function

Whoops, you were writing about faccessat whereas I was thinking about fstatat. 
Please ignore my previous email, and sorry about the confusion.

Apparently macOS faccessat has a problem similar to fstatat. Gnulib did not work 
around the faccessat problem, so I wrote and installed a fix for this into 
Gnulib and installed the attached patch into the emacs-26 branch. Please give it 
a try.
[0001-Merge-from-Gnulib.txt (text/plain, attachment)]

Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Sun, 12 Nov 2017 12:10:01 GMT) Full text and rfc822 format available.

Notification sent to Vincent Zhang <vincent_chueng <at> hotmail.com>:
bug acknowledged by developer. (Sun, 12 Nov 2017 12:10:02 GMT) Full text and rfc822 format available.

Message #39 received at 29231-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Vincent Zhang <vincent_chueng <at> hotmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 29231-done <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Sun, 12 Nov 2017 12:09:32 +0000
On Sat, Nov 11, 2017 at 11:19:05PM -0800, Paul Eggert wrote:
> Apparently macOS faccessat has a problem similar to fstatat. Gnulib did not
> work around the faccessat problem, so I wrote and installed a fix for this
> into Gnulib and installed the attached patch into the emacs-26 branch.
> Please give it a try.

This fixes the problem for me.

Thanks, Paul!
-- 
Alan Third




Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Sun, 12 Nov 2017 12:10:02 GMT) Full text and rfc822 format available.

Notification sent to detlevvandaele <detlev.vandaele <at> gmail.com>:
bug acknowledged by developer. (Sun, 12 Nov 2017 12:10:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29231; Package emacs. (Mon, 13 Nov 2017 02:54:02 GMT) Full text and rfc822 format available.

Message #47 received at 29231-done <at> debbugs.gnu.org (full text, mbox):

From: Vincent Zhang <vincent_chueng <at> hotmail.com>
To: Alan Third <alan <at> idiocy.org>, Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 "29231-done <at> debbugs.gnu.org" <29231-done <at> debbugs.gnu.org>
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files
Date: Mon, 13 Nov 2017 02:53:19 +0000
[Message part 1 (text/plain, inline)]
Thanks for fixing it, guys!
________________________________
From: Alan Third <athird <at> googlemail.com> on behalf of Alan Third <alan <at> idiocy.org>
Sent: Sunday, November 12, 2017 12:09 PM
To: Paul Eggert
Cc: Eli Zaretskii; Vincent Zhang; 29231-done <at> debbugs.gnu.org
Subject: Re: bug#29231: 26.0.90; invald file name for symbolic files

On Sat, Nov 11, 2017 at 11:19:05PM -0800, Paul Eggert wrote:
> Apparently macOS faccessat has a problem similar to fstatat. Gnulib did not
> work around the faccessat problem, so I wrote and installed a fix for this
> into Gnulib and installed the attached patch into the emacs-26 branch.
> Please give it a try.

This fixes the problem for me.

Thanks, Paul!
--
Alan Third
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Dec 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.