* bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs
@ 2020-10-22 7:32 Andrew Eggenberger
2020-10-22 12:54 ` Lars Ingebrigtsen
2020-10-22 20:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 10+ messages in thread
From: Andrew Eggenberger @ 2020-10-22 7:32 UTC (permalink / raw)
To: 44131
The emacsclient binary produced by the native-comp branch cannot connect
to the server. When a connection is attempted, the error message
"emacsclient: Invalid socket owner" is displayed. I have 27.1 without
native-comp installed, and that emacsclient can connect to the
native-comp server without issue.
The error is the result of a failed uid comparison in
lib-src/emacsclient.c. It appears that the uid produced by geteuid()
isn't matching the uid for the server socket.
I first noticed the issue while trying to do a magit commit. But the
same error happens when trying to run emacsclient from the command line.
In GNU Emacs 28.0.50 (build 1, i686-unknown-gnu0.9, GTK+ Version 3.24.20, cairo version 1.16.0)
of 2020-10-21 built on debian
Repository revision: 3be93390fb6680d1e0c3256af72c86635a9eb327
Repository branch: feature/native-comp
System Description: Debian GNU/Hurd bullseye/sid
Configured using:
'configure --with-nativecomp --prefix=/home/demo/.local/'
Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO DBUS GSETTINGS GLIB NOTIFY GFILENOTIFY
ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES NATIVE_COMP THREADS
LIBSYSTEMD PDUMPER LCMS2
Important settings:
locale-coding-system: nil
Major mode: Magit Process
Minor modes in effect:
global-undo-tree-mode: t
undo-tree-mode: t
global-magit-file-mode: t
magit-auto-revert-mode: t
global-git-commit-mode: t
which-key-mode: t
projectile-mode: t
global-flycheck-mode: t
global-company-mode: t
company-mode: t
helm-mode: t
helm-ff-cache-mode: t
shell-dirtrack-mode: t
helm--remap-mouse-mode: t
async-bytecomp-package-mode: t
tooltip-mode: t
global-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
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug sendmail helm-command helm-elisp
helm-eval edebug backtrace helm-info magit-extras mule-util face-remap
vc-git cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs winner image-file image-converter
helm-external helm-net xml url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util mailcap ffap
term/xterm xterm jka-compr undo-tree magit-submodule magit-obsolete
magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull
magit-fetch magit-clone magit-remote magit-commit magit-sequence
magit-notes magit-worktree magit-tag magit-merge magit-branch
magit-reset magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode
diff diff-mode magit-core magit-autorevert autorevert filenotify
magit-margin magit-transient magit-process magit-mode git-commit
transient magit-git magit-section magit-utils crm log-edit message rmc
puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log with-editor server
which-key comp warnings projectile grep compile text-property-search
ibuf-ext ibuffer ibuffer-loaddefs thingatpt flycheck find-func rx dash
company-oddmuse company-keywords company-etags etags fileloop generator
xref project company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company paredit helm-mode helm-files tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
pcomplete comint ansi-color ring parse-time iso8601 time-date ls-lisp
helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp
format-spec helm-utils helm-help helm-types helm-config helm easy-mmode
async-bytecomp advice helm-global-bindings helm-easymenu edmacro kmacro
helm-source eieio-compat helm-multi-match helm-lib async cl-extra
help-mode use-package-ensure use-package-core finder-inf disp-table info
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
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 button loaddefs faces cus-face pcase macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
gfilenotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process nativecomp emacs)
Memory information:
((conses 8 312548 30532)
(symbols 24 26544 10)
(strings 16 87420 8718)
(string-bytes 1 3294833)
(vectors 8 44603)
(vector-slots 4 791812 51818)
(floats 8 144 434)
(intervals 28 736 356)
(buffers 564 20))
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs
2020-10-22 7:32 bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs Andrew Eggenberger
@ 2020-10-22 12:54 ` Lars Ingebrigtsen
2020-10-22 20:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-22 12:54 UTC (permalink / raw)
To: Andrew Eggenberger; +Cc: 44131
Andrew Eggenberger <andrew.eggenberger@gmail.com> writes:
> The emacsclient binary produced by the native-comp branch cannot connect
> to the server. When a connection is attempted, the error message
> "emacsclient: Invalid socket owner" is displayed. I have 27.1 without
> native-comp installed, and that emacsclient can connect to the
> native-comp server without issue.
I tried this with the current native-comp branch:
$ ./src/emacs -Q
M-x server-start
$ ./lib-src/emacsclient -t
and everything worked as it should, so I'm unable to reproduce this bug.
Do you have a recipe for reproducing this?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs
2020-10-22 7:32 bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs Andrew Eggenberger
2020-10-22 12:54 ` Lars Ingebrigtsen
@ 2020-10-22 20:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-22 23:45 ` Andrew Eggenberger
1 sibling, 1 reply; 10+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-22 20:41 UTC (permalink / raw)
To: Andrew Eggenberger; +Cc: 44131
Andrew Eggenberger <andrew.eggenberger@gmail.com> writes:
> The emacsclient binary produced by the native-comp branch cannot connect
> to the server. When a connection is attempted, the error message
> "emacsclient: Invalid socket owner" is displayed. I have 27.1 without
> native-comp installed, and that emacsclient can connect to the
> native-comp server without issue.
>
> The error is the result of a failed uid comparison in
> lib-src/emacsclient.c. It appears that the uid produced by geteuid()
> isn't matching the uid for the server socket.
>
> I first noticed the issue while trying to do a magit commit. But the
> same error happens when trying to run emacsclient from the command line.
Hi Andrew,
thanks for reporting. I believe this should not be related to the
native compilaiton (BTW for me it works, I always use emacsclient).
Could you try if you get the same error building master?
Thanks!
Andrea
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs
2020-10-22 20:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-22 23:45 ` Andrew Eggenberger
2020-10-22 23:46 ` Andrew Eggenberger
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Eggenberger @ 2020-10-22 23:45 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 44131
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
Thanks all. It looks like the socket verification logic changes in Commit
3e5d7755454bea9b6ffd232b1d115c629cdb193d. I realized my other version where
it works was 26.3, before that change. I think my problem might be
hurd-specific, but I'll have to do some more digging.
Andrew
[-- Attachment #2: Type: text/html, Size: 361 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs
2020-10-22 23:45 ` Andrew Eggenberger
@ 2020-10-22 23:46 ` Andrew Eggenberger
2020-10-23 6:48 ` bug#44131: 28.0.50; emacsclient Invalid socket owner error Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Eggenberger @ 2020-10-22 23:46 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 44131
[-- Attachment #1: Type: text/plain, Size: 94 bytes --]
Sorry, and to answer your question: the problem was still there when I
compiled 28 master.
>
[-- Attachment #2: Type: text/html, Size: 333 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#44131: 28.0.50; emacsclient Invalid socket owner error
2020-10-22 23:46 ` Andrew Eggenberger
@ 2020-10-23 6:48 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-02 1:24 ` Andrew Eggenberger
0 siblings, 1 reply; 10+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-23 6:48 UTC (permalink / raw)
To: Andrew Eggenberger; +Cc: 44131
Andrew Eggenberger <andrew.eggenberger@gmail.com> writes:
> Sorry, and to answer your question: the problem was still there when I compiled 28 master.
Hi Andrew,
thanks for checking, I've re-titled to bug. Let us know if you discover
it's hurd specific we can narrow it down further.
Thanks
Andrea
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#44131: 28.0.50; emacsclient Invalid socket owner error
2020-10-23 6:48 ` bug#44131: 28.0.50; emacsclient Invalid socket owner error Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-02 1:24 ` Andrew Eggenberger
2020-11-07 8:47 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Eggenberger @ 2020-11-02 1:24 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 44131
[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]
Hi,
The problem seems to stem from the way the hurd treats fstat calls on local
socket
file descriptors. They all have the uid of 0 (root), while emacsclient can
be run by
other users. After trying to teach the hurd's local socket server to use
the uid of
the user who requested the socket and failing, I created the naive patch
below that
fixes the problem.
Please let me know if there's a better solution. I git blamed the changes
that led to this
issue and I don't understand the race condition the uid comparison is
supposed prevent.
Andrew Eggenberger
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 871fa7a8d3..6059993ff6 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1480,8 +1480,13 @@ set_local_socket (char const *server_name)
sock_status = errno;
else if (connect_stat.st_uid == uid)
return s;
+#ifdef __GNU__
+ else
+ return s;
+#else
else
sock_status = -1;
+#endif
CLOSE_SOCKET (s);
}
[-- Attachment #2: Type: text/html, Size: 1424 bytes --]
^ permalink raw reply related [flat|nested] 10+ messages in thread
* bug#44131: 28.0.50; emacsclient Invalid socket owner error
2020-11-02 1:24 ` Andrew Eggenberger
@ 2020-11-07 8:47 ` Eli Zaretskii
2020-11-11 3:30 ` Andrew Eggenberger
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-11-07 8:47 UTC (permalink / raw)
To: Andrew Eggenberger, Paul Eggert; +Cc: 44131, akrl
> From: Andrew Eggenberger <andrew.eggenberger@gmail.com>
> Date: Sun, 1 Nov 2020 19:24:42 -0600
> Cc: 44131@debbugs.gnu.org
>
> The problem seems to stem from the way the hurd treats fstat calls on local socket
> file descriptors. They all have the uid of 0 (root), while emacsclient can be run by
> other users. After trying to teach the hurd's local socket server to use the uid of
> the user who requested the socket and failing, I created the naive patch below that
> fixes the problem.
>
> Please let me know if there's a better solution. I git blamed the changes that led to this
> issue and I don't understand the race condition the uid comparison is supposed prevent.
>
> Andrew Eggenberger
>
> diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
> index 871fa7a8d3..6059993ff6 100644
> --- a/lib-src/emacsclient.c
> +++ b/lib-src/emacsclient.c
> @@ -1480,8 +1480,13 @@ set_local_socket (char const *server_name)
> sock_status = errno;
> else if (connect_stat.st_uid == uid)
> return s;
> +#ifdef __GNU__
> + else
> + return s;
> +#else
> else
> sock_status = -1;
> +#endif
>
> CLOSE_SOCKET (s);
> }
Paul, any better ideas? Or should I push this fix?
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-11-11 9:44 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-22 7:32 bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs Andrew Eggenberger
2020-10-22 12:54 ` Lars Ingebrigtsen
2020-10-22 20:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-22 23:45 ` Andrew Eggenberger
2020-10-22 23:46 ` Andrew Eggenberger
2020-10-23 6:48 ` bug#44131: 28.0.50; emacsclient Invalid socket owner error Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-02 1:24 ` Andrew Eggenberger
2020-11-07 8:47 ` Eli Zaretskii
2020-11-11 3:30 ` Andrew Eggenberger
2020-11-11 9:44 ` Lars Ingebrigtsen
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.