Debian Bug report logs - #690318
hunspell hungs after changing dictionary

version graph

Package: hunspell; Maintainer for hunspell is Debian LibreOffice Maintainers <debian-openoffice@lists.debian.org>; Source for hunspell is src:hunspell.

Reported by: Yuri D'Elia <wavexx@thregr.org>

Date: Fri, 12 Oct 2012 13:57:01 UTC

Severity: important

Tags: patch

Found in version hunspell/1.3.2-4

Forwarded to http://sourceforge.net/tracker/?func=detail&aid=3577183&group_id=143754&atid=756395

Reply or subscribe to this bug.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, Agustin Martin Domingo <agmartin@debian.org>:
Bug#690318; Package dictionaries-common. (Fri, 12 Oct 2012 13:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuri D'Elia <wavexx@thregr.org>:
New Bug report received and forwarded. Copy sent to Agustin Martin Domingo <agmartin@debian.org>. (Fri, 12 Oct 2012 13:57:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Yuri D'Elia <wavexx@thregr.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: hunspell hungs after changing dictionary
Date: Fri, 12 Oct 2012 15:52:55 +0200
Package: dictionaries-common
Version: 1.12.10
Severity: important

On my system I'm using emacs23 along with hunspell.
I don't have the aspell/ispell packages installed.

If I enable flyspell without changing dictionary (thus using the default
"american"), everything works.

If I attempt to use M-x ispell-change-dictionary "american" (which should give
me the same results), emacs hangs, resulting in lossage (and thus the
"important" severity of the bug report).

The last message that I see in the minibuffer is:

  Starting new Ispell process [hunspell::american] ...

but the only option at this point is kill emacs.
hunspell is recognized correctly, but is probably called with the wrong
arguments?

aspell works fine, but I'd rather use hunspell.

Thanks.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (800, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dictionaries-common depends on:
ii  debconf [debconf-2.0]  1.5.46
ii  libtext-iconv-perl     1.7-5

dictionaries-common recommends no packages.

Versions of packages dictionaries-common suggests:
ii  emacsen-common  2.0.3
pn  ispell          <none>
pn  jed-extra       <none>

-- debconf information:
  dictionaries-common/invalid_debconf_value:
  dictionaries-common/selecting_ispell_wordlist_default:
* dictionaries-common/default-ispell: Manual forced (No ispell elements installed)
* dictionaries-common/default-wordlist: american (American English)
  dictionaries-common/ispell-autobuildhash-message:
  dictionaries-common/old_wordlist_link: true
  dictionaries-common/move_old_usr_dict: true
  dictionaries-common/remove_old_usr_dict_link: false



Information forwarded to debian-bugs-dist@lists.debian.org, Agustin Martin Domingo <agmartin@debian.org>:
Bug#690318; Package dictionaries-common. (Sun, 14 Oct 2012 12:39:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Agustin Martin <agmartin@debian.org>:
Extra info received and forwarded to list. Copy sent to Agustin Martin Domingo <agmartin@debian.org>. (Sun, 14 Oct 2012 12:39:06 GMT) Full text and rfc822 format available.

Message #10 received at 690318@bugs.debian.org (full text, mbox):

From: Agustin Martin <agmartin@debian.org>
To: "Yuri D'Elia" <wavexx@thregr.org>, 690318@bugs.debian.org
Subject: Re: Bug#690318: hunspell hungs after changing dictionary
Date: Sun, 14 Oct 2012 14:34:31 +0200
[Message part 1 (text/plain, inline)]
reassign    690318 hunspell
forwarded 690318
http://sourceforge.net/tracker/?func=detail&aid=3577183&group_id=143754&atid=756395
found         690318 1.3.2-4
thanks

2012/10/12 Yuri D'Elia <wavexx@thregr.org>:
> Package: dictionaries-common
> Version: 1.12.10
> Severity: important
>
> On my system I'm using emacs23 along with hunspell.
> I don't have the aspell/ispell packages installed.
>
> If I enable flyspell without changing dictionary (thus using the default
> "american"), everything works.
>
> If I attempt to use M-x ispell-change-dictionary "american" (which should give
> me the same results), emacs hangs, resulting in lossage (and thus the
> "important" severity of the bug report).
>
> The last message that I see in the minibuffer is:
>
>   Starting new Ispell process [hunspell::american] ...
>
> but the only option at this point is kill emacs.
> hunspell is recognized correctly, but is probably called with the wrong
> arguments?
>
> aspell works fine, but I'd rather use hunspell.

Hi, thanks for the info

I have been debugging this problem and noticed that this is caused by
some problems with the way hunspell handle init version string in pipe
mode, way that is not compatible with ispell and aspell. This causes
Emacs not catching the error condition caused by missing dictionaries
after failed hunspell initialization. You tried american, but current
myspell.us does not register itself for use with Emacs, so unless you
have a personal entry in your ~/emacs file it should fail with an
error like

ispell-init-process: Can't open affix or dictionary files for
dictionary named "american".

In pipe mode, hunspell sends the init string unconditionally as soon
as it detects the -a switch, so Emacs thiks there is a process and
unsuscessfully expects for output if there is an error. You should not
see this error if you switch to a dict that is registered with Emacs
ispell.el.

I have filed a bug report upstream about this problem

http://sourceforge.net/tracker/?func=detail&aid=3577183&group_id=143754&atid=756395

with this summary:

We recently received this bug report at Debian,
http://bugs.debian.org/690318.
Note that debian ships hunspell 1.3.2.

This seems related to a problem with init string in pipe mode. When
looking at hunspell.cxx code I noticed another potencial problem for
Emacs. Here goes a summary of noticed problems,

* The string is gettextized. Emacs (and may be others) heavily rely in
English format to get info like spellchecker version. This may not work
with translated string.

* In pipe mode hunspell.cxx outputs version string as soon as it detects
the -a switch, even if hunspell is not properly started because of
errors.

This behavior is different from what ispell and aspell do and confuses
Emacs (output that string only when hunspell has properly started),
causing Emacs hang if a missing dictionary is selected.
Emacs waits for more info after that string is received.
This is what seems to trigger http://bugs.debian.org/690318.

As mentioned there I have been playing with a proposed change that
seems to work here in my tests (mostly with normal use under Emacs),
although it is still not deeply tested.

Please find attached a patch with my current changes.

I am reassigning this bug report toi hunspell and marking it as
forwarded upstream.

Regards,

-- 
Agustin
[0001-Try-fixing-some-problems-with-init-string-in-pipe-mo.patch (application/octet-stream, attachment)]

Bug reassigned from package 'dictionaries-common' to 'hunspell'. Request was from Agustin Martin <agmartin@debian.org> to control@bugs.debian.org. (Sun, 14 Oct 2012 12:39:10 GMT) Full text and rfc822 format available.

No longer marked as found in versions dictionaries-common/1.12.10. Request was from Agustin Martin <agmartin@debian.org> to control@bugs.debian.org. (Sun, 14 Oct 2012 12:39:10 GMT) Full text and rfc822 format available.

Marked as found in versions hunspell/1.3.2-4. Request was from Agustin Martin <agmartin@debian.org> to control@bugs.debian.org. (Sun, 14 Oct 2012 12:39:11 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian LibreOffice Maintainers <debian-openoffice@lists.debian.org>:
Bug#690318; Package hunspell. (Sun, 14 Oct 2012 14:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuri D'Elia <wavexx@thregr.org>:
Extra info received and forwarded to list. Copy sent to Debian LibreOffice Maintainers <debian-openoffice@lists.debian.org>. (Sun, 14 Oct 2012 14:45:03 GMT) Full text and rfc822 format available.

Message #21 received at 690318@bugs.debian.org (full text, mbox):

From: Yuri D'Elia <wavexx@thregr.org>
To: Agustin Martin <agmartin@debian.org>
Cc: 690318@bugs.debian.org
Subject: Re: Bug#690318: hunspell hungs after changing dictionary
Date: Sun, 14 Oct 2012 16:43:30 +0200
On 10/14/2012 02:34 PM, Agustin Martin wrote:
> I have been debugging this problem and noticed that this is caused by
> some problems with the way hunspell handle init version string in pipe
> mode, way that is not compatible with ispell and aspell. This causes
> Emacs not catching the error condition caused by missing dictionaries
> after failed hunspell initialization. You tried american, but current
> myspell.us does not register itself for use with Emacs, so unless you
> have a personal entry in your ~/emacs file it should fail with an
> error like
>
> ispell-init-process: Can't open affix or dictionary files for
> dictionary named "american".

Indeed.

I'm using several hunspell-* and myspell dictionaries, but hunspell also 
doesn't register.

After setting up manually the dictionaries aliases in 
ispell-dictionary-alist, I was able to make hunspell work.

> I have filed a bug report upstream about this problem
>
> http://sourceforge.net/tracker/?func=detail&aid=3577183&group_id=143754&atid=756395
>
> with this summary:
<cut>

Thanks a lot for the debugging.

> As mentioned there I have been playing with a proposed change that
> seems to work here in my tests (mostly with normal use under Emacs),
> although it is still not deeply tested.

I tried the patch, and I can confirm it also works.
I also normally use hunspell within emacs.



Set Bug forwarded-to-address to 'http://sourceforge.net/tracker/?func=detail&aid=3577183&group_id=143754&atid=756395'. Request was from Agustin Martin <agmartin@debian.org> to control@bugs.debian.org. (Mon, 15 Oct 2012 11:39:04 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Agustin Martin <agmartin@debian.org> to control@bugs.debian.org. (Mon, 15 Oct 2012 11:39:04 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 12:52:58 2014; Machine Name: buxtehude.debian.org

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