From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.bugs Subject: bug#28025: Daemon/server passes string incorrectly to/from Systemd Date: Thu, 10 Aug 2017 14:42:11 +0200 Message-ID: References: <5ko9roecl6.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113ad448836b27055665865d" X-Trace: blaine.gmane.org 1502369010 31979 195.159.176.226 (10 Aug 2017 12:43:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 10 Aug 2017 12:43:30 +0000 (UTC) Cc: 28025@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 10 14:43:20 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfmnw-0007CG-Jc for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Aug 2017 14:43:12 +0200 Original-Received: from localhost ([::1]:53150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfmo1-0006VD-9Z for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Aug 2017 08:43:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfmnt-0006Th-5i for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 08:43:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfmnm-0000Bc-BT for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 08:43:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45420) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfmnm-0000BW-8C for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 08:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dfmnl-0000Zu-N1 for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 08:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Aug 2017 12:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28025-submit@debbugs.gnu.org id=B28025.15023689392173 (code B ref 28025); Thu, 10 Aug 2017 12:43:01 +0000 Original-Received: (at 28025) by debbugs.gnu.org; 10 Aug 2017 12:42:19 +0000 Original-Received: from localhost ([127.0.0.1]:54101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfmn5-0000Yz-AL for submit@debbugs.gnu.org; Thu, 10 Aug 2017 08:42:19 -0400 Original-Received: from mail-oi0-f54.google.com ([209.85.218.54]:36696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfmn4-0000Ym-3f for 28025@debbugs.gnu.org; Thu, 10 Aug 2017 08:42:18 -0400 Original-Received: by mail-oi0-f54.google.com with SMTP id g131so5309079oic.3 for <28025@debbugs.gnu.org>; Thu, 10 Aug 2017 05:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5ZDYspgAgv9ejHX5Uhe7gbhz+eDVytMGaPr+7LfevH4=; b=s2IVtjH6p0PhY5N9afPAjbNNWOURAtOap8vDDv+kTZlZeLdO6SamKnGPvLfZCPI6Qx a2Amf11aWNpSL72OmEHQh8QXXsbTqoInpULrAz/Gn5VmP8zTRF2IJqtB3z3VnQjZ9DQS ST/MXWZhD4cDW6GhIXP/1p4m9JqL2IuGWbV3nT0rUiwZUotxIcWak/5MDd+H/i+IlyvB g+dyyfArAbdzwmbbaz6/ZaC23p7MEOhE+gOkFZbm8KqNKhhrnHck+VGUZC0xnZjMmS/0 ELcHKGi+4TOcuO3rkNYxtaLKNORxXkCrgp5UXO+oG3aAstyU19KVR6wTzhk2Znjz0l0S 8ERg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5ZDYspgAgv9ejHX5Uhe7gbhz+eDVytMGaPr+7LfevH4=; b=QbXvzjo2aC5rd+aLljUPbvCmSv2WHcPbrnQ/O3thsjzM+t2EdzLEBdVSHKh9PvtTTq TphSiS5FAOs19aUjgm7a2pjfhyis550cohmSaBONG4vX2ksrzVs3nn3MJY0NBhMXJ8Zv //bqZNanuZBQpqatDLeww7mnpwJSYMFdy14RQ/AdTs44+HtWj7Uzx3AxCknfcAZt6xm/ WiltgD4qj0WoETPVbkZH6J/MfWgu/oUCeX8wta+IJux34AFFlLPhP3UHdBCiY/Q4un+1 M8FD7/tc5REBmovZwyUJF51Jf+DdMSopbhZNK72y8EYhMPky8TfeyCCybaJeu3+tJFKm i9SQ== X-Gm-Message-State: AHYfb5i6X64UGuKIqqOLDX1GKto6lFB/P7HtMoCA2LW/OTr2eVlswnG8 hxQAhDYX7Y3huHuzexxoo9BTA0nsqtzx X-Received: by 10.202.87.78 with SMTP id l75mr13647343oib.275.1502368931996; Thu, 10 Aug 2017 05:42:11 -0700 (PDT) Original-Received: by 10.182.20.51 with HTTP; Thu, 10 Aug 2017 05:42:11 -0700 (PDT) In-Reply-To: <5ko9roecl6.fsf@fencepost.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135619 Archived-At: --001a113ad448836b27055665865d Content-Type: text/plain; charset="UTF-8" > Can you explain how DICPATH enters this picture? AFAIR, Hunspell > should be able to find its dictionaries without that variable, > assuming Hunspell is installed correctly. So why do you need DICPATH? Above stack trace points to "ispell-parse-hunspell-affix-file", which seems to be a parser for affix files. But as I wrote I am not sure, I don't know so much about how emacs does stuff internally. Anyway, I have checked so that path given to emacs is not empty. When I do (getenv "DICPATH") it prints correct path where dictionaries are. Hunspell is found as well, and Hunspell itself finds everything correctly when I check from shell. > I don't see what D-Bus would have to do with this. Systemd-bus is D-bus if I understood Systemd docs correctly. I am by no means an expert in either d-bus or sytemd, just ordinary user. > I imagine that the environment of Emacs when started from systemd is > different from when you start it normally, and something is missing that > means hunspell can't find its dictionaries. Yeah, I imagined that too, so that is why I passed DICPATH to systemd service as well but that didn't solve the problem. Here is service file. If Emas gets it's paths from Hunspell, than it sounds as expected, and after that the only thing I can imagine is problem is how strings are passed between processes. I looked at process-environment var and the content is different, but what regards PATH and DICPATH it's same: Emacs daemon started with systemd as user service: ("TERM=dumb" "DICPATH=~/.emacs.d/hunspell" "INVOCATION_ID=af861fc0688846f6a70a09261064560f" "MANAGERPID=604" "XDG_RUNTIME_DIR=/run/user/1000" "USER=*****" "SHELL=/bin/bash" "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" "MAIL=/var/spool/mail/*****" "LOGNAME=*****" "LANG=sv_SE.UTF-8" "JOURNAL_STREAM=9:15268" "HOME=/home/*****" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus") Emacs daemon started from shell: ("OLDPWD=/home/*****" "_=/usr/local/bin/emacs" "HISTSIZE=5000" "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/ant/bin:/opt/ant/bin" "LARCH_PATH=/usr/share/splint/lib" "ANT_HOME=/opt/ant" "XAUTHORITY=/home/*****/.Xauthority" "XDG_RUNTIME_DIR=/run/user/1000" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" "LOGNAME=*****" "IRC_CLIENT=irssi" "SHLVL=3" "XDG_SEAT=seat0" "AUTOFEATURE=true autotest" "TERM=dumb" "SHELL=/bin/bash" "WINDOWPATH=1" "VISUAL=emacsclient -c -a emacs" "MAIL=/var/spool/mail/*****" "_JAVA_OPTIONS=-Dsun.java2d.opengl=true" "GTK_MODULES=canberra-gtk-module" "ALTERNATE_EDITOR=emacsclient -c -a emacs" "HOME=/home/*****" "PWD=/home/*****/emacs" "TERMINOLOGY=1" "LSCOLORS=Gxfxcxdxdxegedabagacad" "USER=*****" "XDG_SESSION_ID=c1" "HG=/usr/bin/hg" "SCM_CHECK=true" "GIT_HOSTING=git@git.domain.com" "XDG_VTNR=1" "JAVA_HOME=/usr/lib/jvm/default/jre" "LCLIMPORTDIR=/usr/share/splint/imports" "EDITOR=emacsclient -t -a emacs -t" "TODO=t" "HISTCONTROL=ignorespace:erasedups" "HISTIGNORE=pwd:ls:ls -l:cd:cd ..:cd -:cd --" "TZ=:/etc/localtime" "LANG=sv_SE.UTF-8" "DICPATH=/home/*****/.emacs.d/hunspell" "BASH_IT=/home/*****/.bash-it" "BASH_IT_THEME=bobby" "XTERM_256_COLORS=1" "LD_LIBRARY_PATH=:/usr/local/lib:/usr/local/lib" "GREP_COLOR=1;33") When I run M-x ispell-buffer-with-debug, I get same backtrace as posted in my original message. I also get following (*ispell-debug* buffer): -- ispell-fhd: Skipping entry: AVAILABLE DICTIONARIES (path is not mandatory for -d option): -- ispell-fhd: Skipping entry: Can't open affix or dictionary files for dictionary named "sv_SE". I don't know it says it can't open entry, since I can see the dictionary, and when started from shell, emacs has no problem opening it :). I have to admit that I am not very proficient using edebug. To be honest I have no idea how to step through code properly with it, and manual does not give me much clues. It list all commands but one to use to step through. I am probably just not smart enough to understand it. Anyway stacktrace was gigantic, about 20 lines tall, but about 7800 chars wide so I am not posting it here. But help how to step through and find more info is appreciated. 2017-08-09 22:00 GMT+02:00 Glenn Morris : > Arthur Miller wrote: > > > I have checked that all paths are setup correctly. Emacs finds > > dictionaries (DICPATH setts correctly in systemd service file), > > and it also finds spellchecking program (/usr/bin/hunspell). > > > > I believe it might be something with passing strings to and from > > d-bus, but I don't have experience with d-bus at all so I really > > don't know. > > I don't see what D-Bus would have to do with this. > I imagine that the environment of Emacs when started from systemd is > different from when you start it normally, and something is missing that > means hunspell can't find its dictionaries. > > You might compare the value of 'process-environment' in the two Emacs to > see what differs. Or M-x ispell-buffer-with-debug might provide more > information. Or edebug ispell-find-hunspell-dictionaries and step > through it to see where things go wrong. > > > --001a113ad448836b27055665865d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> Can you expla= in how DICPATH enters this picture?=C2=A0 AFAIR, Hunspell
> should be able to find its dictionaries without that variable,
>= assuming Hunspell is installed correctly.=C2=A0 So why do you need DICPATH= ?

Above stack trace points to "ispell-parse-hunspell-affi= x-file", which seems to
be a parser for affix files. But as I= wrote I am not sure, I don't know so much
about how emacs doe= s stuff internally. Anyway, I have checked so that path
given to e= macs is not empty. When I do (getenv "DICPATH") it prints correct=
path where dictionaries are. Hunspell is found as well, and Hunsp= ell itself
finds everything correctly when I check from shell.
=
> I don't see what D-Bus would have to do with this.
Systemd-= bus is D-bus if I understood Systemd docs correctly. I am by no
means an= expert in either d-bus or sytemd, just ordinary user.

> I imagine that the environment of Emacs when started from systemd is > different from when you start it normally, and something is missing th= at
> means hunspell can't find its dictionaries.

Yea= h, I imagined that too, so that is why I passed DICPATH to systemd
service as well but that didn't solve the problem. Here is servi= ce file. If
Emas gets it's paths from Hunspell, than it sound= s as expected, and after
that the only thing I can imagine is pro= blem is how strings are passed
between processes.
=
I looked at process-environment var and the content is diffe= rent,
but what regards PATH and DICPATH it's same:
=
Emacs daemon started with systemd as user service:

("TERM=3Ddumb" "DICPATH=3D~/.emacs.d/hunspel= l" "INVOCATION_ID=3Daf861fc0688846f6a70a09261064560f" "= MANAGERPID=3D604" "XDG_RUNTIME_DIR=3D/run/user/1000" "U= SER=3D*****" "SHELL=3D/bin/bash" "PATH=3D/usr/local/sbi= n:/usr/local/bin:/usr/sbin:/usr/bin" "MAIL=3D/var/spool/mail/****= *" "LOGNAME=3D*****" "LANG=3Dsv_SE.UTF-8" "JO= URNAL_STREAM=3D9:15268" "HOME=3D/home/*****" "DBUS_SESS= ION_BUS_ADDRESS=3Dunix:path=3D/run/user/1000/bus")

<= /div>
Emacs daemon started from shell:

("= OLDPWD=3D/home/*****" "_=3D/usr/local/bin/emacs" "HISTS= IZE=3D5000" "PATH=3D/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/= lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_p= erl:/opt/ant/bin:/opt/ant/bin" "LARCH_PATH=3D/usr/share/splint/li= b" "ANT_HOME=3D/opt/ant" "XAUTHORITY=3D/home/*****/.Xau= thority" "XDG_RUNTIME_DIR=3D/run/user/1000" "DBUS_SESSI= ON_BUS_ADDRESS=3Dunix:path=3D/run/user/1000/bus" "LOGNAME=3D*****= " "IRC_CLIENT=3Dirssi" "SHLVL=3D3" "XDG_SEAT= =3Dseat0" "AUTOFEATURE=3Dtrue autotest" "TERM=3Ddumb&qu= ot; "SHELL=3D/bin/bash" "WINDOWPATH=3D1" "VISUAL= =3Demacsclient -c -a emacs" "MAIL=3D/var/spool/mail/*****" &= quot;_JAVA_OPTIONS=3D-Dsun.java2d.opengl=3Dtrue" "GTK_MODULES=3Dc= anberra-gtk-module" "ALTERNATE_EDITOR=3Demacsclient -c -a emacs&q= uot; "HOME=3D/home/*****" "PWD=3D/home/*****/emacs" &qu= ot;TERMINOLOGY=3D1" "LSCOLORS=3DGxfxcxdxdxegedabagacad" &quo= t;USER=3D*****" "XDG_SESSION_ID=3Dc1" "HG=3D/usr/bin/hg= " "SCM_CHECK=3Dtrue" "GIT_HOSTING=3Dgit@git.domain.com" "XDG_VTNR=3D1" &q= uot;JAVA_HOME=3D/usr/lib/jvm/default/jre" "LCLIMPORTDIR=3D/usr/sh= are/splint/imports" "EDITOR=3Demacsclient -t -a emacs -t" &q= uot;TODO=3Dt" "HISTCONTROL=3Dignorespace:erasedups" "HI= STIGNORE=3Dpwd:ls:ls -l:cd:cd ..:cd -:cd --" "TZ=3D:/etc/localtim= e" "LANG=3Dsv_SE.UTF-8" "DICPATH=3D/home/*****/.emacs.d= /hunspell" "BASH_IT=3D/home/*****/.bash-it" "BASH_IT_TH= EME=3Dbobby" "XTERM_256_COLORS=3D1" "LD_LIBRARY_PATH=3D= :/usr/local/lib:/usr/local/lib" "GREP_COLOR=3D1;33")

=
When I run M-x ispell-buffer-with-debug, I get same backtrace as post= ed in my original message. I also get following (*ispell-debug* buffer):
-- ispell-fhd: Skipping entry: AVAILABLE DICTIONARIES (path = is not mandatory for -d option):
-- ispell-fhd: Skipping entry: Can'= t open affix or dictionary files for dictionary named "sv_SE".

I don't know it says it can't open entry= , since I can see the dictionary, and when started from shell, emacs has no= problem opening it :).

I have to admit that I am not v= ery proficient using edebug. To be honest I have no idea how to step throug= h code properly with it, and manual does
not give me much clues. = It list all commands but one to use to step through. I am probably just not= smart enough to understand it. Anyway
stacktrace was gigantic, a= bout 20 lines tall, but about 7800 chars wide so I am not posting it here. = But help how to step through and find more info
is appreciated.


2017-08-09 22:00 GMT+02:00 Glenn Morris <rgm@gnu.org>:
Arthur Miller wrote:

> I have checked that all paths are setup correctly. Emacs finds
> dictionaries (DICPATH setts correctly in systemd service file),
> and it also finds spellchecking program (/usr/bin/hunspell).
>
> I believe it might be something with passing strings to and fro= m
> d-bus, but I don't have experience with d-bus at all so I really > don't know.

I don't see what D-Bus would have to do with this.
I imagine that the environment of Emacs when started from systemd is
different from when you start it normally, and something is missing that means hunspell can't find its dictionaries.

You might compare the value of 'process-environment' in the two Ema= cs to
see what differs. Or M-x ispell-buffer-with-debug might provide more
information. Or edebug ispell-find-hunspell-dictionaries and step
through it to see where things go wrong.



--001a113ad448836b27055665865d--