GNU bug report logs - #39137
26.3; ispell-really-hunspell sometimes fails in init

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Bob Rogers <rogers@HIDDEN>; dated Tue, 14 Jan 2020 21:26:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 39137 <at> debbugs.gnu.org:


Received: (at 39137) by debbugs.gnu.org; 18 Jan 2020 10:15:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 18 05:15:07 2020
Received: from localhost ([127.0.0.1]:40531 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1isl8E-0004Th-2B
	for submit <at> debbugs.gnu.org; Sat, 18 Jan 2020 05:15:07 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37417)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1isl88-0004P0-Lt
 for 39137 <at> debbugs.gnu.org; Sat, 18 Jan 2020 05:15:04 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50058)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1isl83-0001Uj-Cs; Sat, 18 Jan 2020 05:14:55 -0500
Received: from [176.228.60.248] (port=1376 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1isl82-0003T7-Ms; Sat, 18 Jan 2020 05:14:55 -0500
Date: Sat, 18 Jan 2020 12:14:55 +0200
Message-Id: <83d0bh136o.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bob Rogers <rogers@HIDDEN>
In-reply-to: <24094.12723.597917.248404@HIDDEN>
 (message from Bob Rogers on Tue, 14 Jan 2020 16:25:07 -0500)
Subject: Re: bug#39137: 26.3; ispell-really-hunspell sometimes fails in init
References: <24094.12723.597917.248404@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 39137
Cc: 39137 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bob Rogers <rogers@HIDDEN>
> Date: Tue, 14 Jan 2020 16:25:07 -0500
> 
>    Spell checking can die with "(wrong-type-argument stringp nil)" when
> ispell-really-hunspell is true.  To reproduce (if it reproduces at all
> on your system), just do "emacs -Q" with Hunspell installed and M-$ on
> any of the words in the startup screen.

Granted, this doesn't reproduce on my system.  And I have difficulty
understanding how could it reproduce on _any_ system, especially in
"emacs -Q".

>    On some of the systems I use, it fails reliably when initializing; on
> others, it works reliably.  All systems are running the openSUSE Leap
> 15.1 release of GNU/Linux, fully updated, with the identical locally-
> built RPM version of Emacs 26.3 (with no local patches) and the distro
> Hunspell 1.6.2.  The key seems to be whether ispell-dictionary-alist is
> initialized before ispell-start-process is called

Can you step through the ispell.el's initialization code, and explain
how come ispell-dictionary-alist ends up being uninitialized by the
time ispell-start-process is called for spell-checking?  This
shouldn't happen.

>   ;; Parse hunspell affix file if using hunspell and entry is uninitialized.
>   (if ispell-really-hunspell
>       (or (cadr (assoc ispell-current-dictionary ispell-dictionary-alist))
> 	  (ispell-hunspell-fill-dictionary-entry ispell-current-dictionary)))
> 
> It appears that "nil" is valid for ispell-current-dictionary and means
> "default", but ispell-hunspell-fill-dictionary-entry expects only a
> string.  On that basis, I would claim that there is a bug that has
> perhaps been hidden by being on a rare execution path.  But if
> ispell-dictionary-alist is already initialized with a "nil" entry, then
> ispell-hunspell-fill-dictionary-entry never gets called, leading to the
> "reproducible irreproducibility" of this bug.  And if
> ispell-dictionary-alist should *always* be initialized and contain the
> current entry, then this is dead code.

It isn't dead code, it just assumes that either
ispell-current-dictionary is nil and there's a nil entry in
ispell-dictionary-alist, or it is a string that specifies a new
dictionary, which is then used to update ispell-dictionary-alist.

We need to establish how come the first assumption is false on those
affected systems.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39137; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Jan 2020 21:25:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 14 16:25:23 2020
Received: from localhost ([127.0.0.1]:33715 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1irTgd-00075K-Db
	for submit <at> debbugs.gnu.org; Tue, 14 Jan 2020 16:25:22 -0500
Received: from lists.gnu.org ([209.51.188.17]:53070)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rogers@HIDDEN>) id 1irTgZ-000759-2P
 for submit <at> debbugs.gnu.org; Tue, 14 Jan 2020 16:25:18 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:49682)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <rogers@HIDDEN>) id 1irTgX-0005GD-8g
 for bug-gnu-emacs@HIDDEN; Tue, 14 Jan 2020 16:25:14 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rogers@HIDDEN>) id 1irTgV-00017z-8g
 for bug-gnu-emacs@HIDDEN; Tue, 14 Jan 2020 16:25:12 -0500
Received: from mail-ua1-x963.google.com ([2607:f8b0:4864:20::963]:44400)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <rogers@HIDDEN>)
 id 1irTgU-00017A-Uh
 for bug-gnu-emacs@HIDDEN; Tue, 14 Jan 2020 16:25:11 -0500
Received: by mail-ua1-x963.google.com with SMTP id c14so5406294uaq.11
 for <bug-gnu-emacs@HIDDEN>; Tue, 14 Jan 2020 13:25:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=modulargenetics-com.20150623.gappssmtp.com; s=20150623;
 h=from:mime-version:content-transfer-encoding:message-id:date:to
 :subject:organization;
 bh=p6e5xUHhx4+/ORuluM0zAJngw8utDwK/oeoY4+yMwyw=;
 b=i9jXkowf4khAnFT9Jrfgfhhv/VCj6MK5sOTsxzF0PNWwb6s3DqT0LXvlDXJYLyDmU6
 mtQGQgeqQ3rC6B1RPlCX1RQRC0gOVW46NMqHJQRJudSAJoVLe36mg5febLusRJjpl4hL
 2W9QYrPWdABAtaoUjy//CeTf1vArFjlU75TR4dOGdzpIpkDj/VbOrOCfoExvFDbhCLNe
 4QnsDu4Nlvmoe/F4mC/fn02t3tdT8CxeKjyna5V5b+mVL8Xs2TRWbXNl+bb96Y+bZhV3
 hfsOZ+MST1IpQvb7hc3ayWt2YuaBeNGve0Wzg0FpkWB0R43ES16iWl9tvX0QO2eUptvZ
 K7Lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:mime-version:content-transfer-encoding
 :message-id:date:to:subject:organization;
 bh=p6e5xUHhx4+/ORuluM0zAJngw8utDwK/oeoY4+yMwyw=;
 b=Bv84FqzCCMmrgqMwD1MMAPZ0jBgCfqA6FuEUMUrq0yxor/UGwy34VXA4aP+vWit4/r
 TKCw/3iwLH0KIkCkC+J28ldYSMHab99RIhfQv2gWKkFlbWfTygPZPP65BoyBcQNr4oSD
 raHXTbFoK5Q0frNamnZQCP9pApj/pLrqAx822bVKKBmHyYjUBgDQ+67lOCcXW0hffAE8
 VTfAis0+v8FUr8z4r8OoJiowcDOqwB+lNr0CnjgYjKL7ialEBGrEgGy2Ppo52igLWXJI
 9pz3PciN2JYxhSTBBB7rTg3h9sAIoG1wqpEM74GbvTsImgGJ+CAymLWjL4mGpDccPRxw
 JVbg==
X-Gm-Message-State: APjAAAX7L0xWwVLkbfbesnULXqqcln7HdAMJxR7eeGZW33AUFb1mVtFG
 TpWAqHo/k+n3ybpbMUK17MIcvbCktAW4AINuapVv054ZDA/hOQ==
X-Google-Smtp-Source: APXvYqyP5dAw1vQu4aqGjzwrS5xzN/mSg4epMHuQkIa89VNxyaTVa48s0wqzMkWeTcFhqmJqx7p7D1MFucCx
X-Received: by 2002:ab0:66d6:: with SMTP id d22mr12307716uaq.92.1579037109516; 
 Tue, 14 Jan 2020 13:25:09 -0800 (PST)
Received: from granada.modulargenetics.com
 (198-0-172-193-static.hfc.comcastbusiness.net. [198.0.172.193])
 by smtp-relay.gmail.com with ESMTP id g3sm1923934vkm.13.2020.01.14.13.25.08
 for <bug-gnu-emacs@HIDDEN>; Tue, 14 Jan 2020 13:25:09 -0800 (PST)
X-Relaying-Domain: modulargenetics.com
Received: from persepolis.modulargenetics.com (persepolis.modulargenetics.com
 [192.168.23.34])
 by granada.modulargenetics.com (Postfix) with ESMTP id 2F80340C5C;
 Tue, 14 Jan 2020 16:25:08 -0500 (EST)
Received: by persepolis.modulargenetics.com (Postfix, from userid 503)
 id BD879C01B3; Tue, 14 Jan 2020 16:25:07 -0500 (EST)
From: Bob Rogers <rogers@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <24094.12723.597917.248404@HIDDEN>
Date: Tue, 14 Jan 2020 16:25:07 -0500
To: bug-gnu-emacs@HIDDEN
Subject: 26.3; ispell-really-hunspell sometimes fails in init
X-Mailer: VM 7.19 under Emacs 26.3
Organization: Modular Genetics Inc.
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::963
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

   Spell checking can die with "(wrong-type-argument stringp nil)" when
ispell-really-hunspell is true.  To reproduce (if it reproduces at all
on your system), just do "emacs -Q" with Hunspell installed and M-$ on
any of the words in the startup screen.

   On some of the systems I use, it fails reliably when initializing; on
others, it works reliably.  All systems are running the openSUSE Leap
15.1 release of GNU/Linux, fully updated, with the identical locally-
built RPM version of Emacs 26.3 (with no local patches) and the distro
Hunspell 1.6.2.  The key seems to be whether ispell-dictionary-alist is
initialized before ispell-start-process is called; just a warning to
anyone who fails to reproduce this.  But since it fails in "emacs -Q" on
systems with apparently identical software, I am at a complete loss to
figure this out.

When it fails, the backtrace looks like this:

	Debugger entered--Lisp error: (wrong-type-argument stringp nil)
	  string-match("," nil 0)
	  split-string(nil "," t)
	  ispell-parse-hunspell-affix-file(nil)
	  ispell-hunspell-fill-dictionary-entry(nil)
	  ispell-start-process()
	  ispell-init-process()
	  ispell-buffer-local-words()
	  ispell-accept-buffer-local-defs()
	  ispell-word(nil nil nil t)
	  funcall-interactively(ispell-word nil nil nil t)
	  call-interactively(ispell-word nil nil)
	  command-execute(ispell-word)

The problem seems to be related to this code in the start of
ispell-start-process:

  ;; Parse hunspell affix file if using hunspell and entry is uninitialized.
  (if ispell-really-hunspell
      (or (cadr (assoc ispell-current-dictionary ispell-dictionary-alist))
	  (ispell-hunspell-fill-dictionary-entry ispell-current-dictionary)))

It appears that "nil" is valid for ispell-current-dictionary and means
"default", but ispell-hunspell-fill-dictionary-entry expects only a
string.  On that basis, I would claim that there is a bug that has
perhaps been hidden by being on a rare execution path.  But if
ispell-dictionary-alist is already initialized with a "nil" entry, then
ispell-hunspell-fill-dictionary-entry never gets called, leading to the
"reproducible irreproducibility" of this bug.  And if
ispell-dictionary-alist should *always* be initialized and contain the
current entry, then this is dead code.

   I don't know where or how ispell-current-dictionary is getting set up
on some systems but not on others, nor how it ought to be set up, so I
am unable to take this any further.


					-- Bob Rogers
					   Modular Genetics Inc.
					   http://www.modulargenetics.com/

------------------------------------------------------------------------
In GNU Emacs 26.3 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.22.30)
 of 2019-11-21 built on yuggoth
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Entering debugger...

Configured using:
 'configure --with-pop --without-dbus --without-gsettings
 --without-gconf --prefix=/usr --infodir=/usr/share/info
 --mandir=/usr/share/man --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --with-x --with-xpm=no --with-jpeg --with-tiff --with-gif=no --with-png
 --with-x-toolkit=gtk3 --x-includes=/usr/X11R6/include
 --x-libraries=/usr/X11R6/lib64 --build x86_64-suse-linux 'CFLAGS=-g -O2
 -fno-optimize-sibling-calls' LDFLAGS=-s'

Configured features:
JPEG TIFF PNG RSVG SOUND GLIB NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS

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

Major mode: Debugger

Minor modes in effect:
  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
  blink-cursor-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 message rmc puny seq dired
dired-loaddefs format-spec rfc822 mml 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 help-mode
easymenu cl-print byte-opt gv bytecomp byte-compile cl-loaddefs cl-lib
cconv debug ispell 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 threads inotify dynamic-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 100243 8442)
 (symbols 48 20704 1)
 (miscs 40 88 143)
 (strings 32 30091 1374)
 (string-bytes 1 795489)
 (vectors 16 15184)
 (vector-slots 8 514416 10616)
 (floats 8 55 85)
 (intervals 56 284 0)
 (buffers 992 12))




Acknowledgement sent to Bob Rogers <rogers@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#39137; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 18 Jan 2020 10:30:02 UTC

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