Bug 471085

Summary: emacs-22.x hangs on spellchecking when hunspell set as ispell helper application
Product: [Fedora] Fedora Reporter: Doug Maxey <dwm>
Component: hunspellAssignee: Caolan McNamara <caolanm>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 10CC: bugzilla, caolanm, dcantrell, dwm
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-11-26 15:11:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Doug Maxey 2008-11-11 18:03:42 UTC
Description of problem:
Oh boy, this is interesting.

Have updated an i386 system to F10 Preview, when using either the existing f9 emacs-22.2-5 or the freshly built 22.3 from the koji srpm package, emacs hangs, and is completely unresponsive to any input when opening a second file.  A kill -1 does work.  The first file opens fine, and apparently this only occurs when the user is root.  A non-root user seems to be able to open files successfully at will.

If I use --no-init, the issue goes away. :/  This seems to indicate it is one of my many hooks that is causing the problem.   However, the very same set of hooks has been in use on f9 for ages.  I tried the 22,3 on f9, both as root and non-root and *do not* see the issues.

If I open files under ~root, it seems to behave well.

Aha.  If I setenforce 0, it seems to work well again.  So, sounds like an access issue.  Hmm.  tried another file (1 more than currently open) and it hung again.  Tried again after 'semodule -DB', still hung but no avc messages at all. 

Version-Release number of selected component (if applicable):
F10 Preview
emacs-22.2-5 or 22.3

How reproducible:
100% as root.

Additional info:  backtrace of hung process
Current directory is /etc/mail/
GNU gdb Fedora (6.8-24.fc10)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu".
Attaching to process 13013
Reading symbols from /usr/bin/emacs...Reading symbols from /usr/lib/debug/usr/bin/emacs-22.3.debug...done.
done.
Reading symbols from /usr/lib/libgtk-x11-2.0.so.0...done.
Loaded symbols for /usr/lib/libgtk-x11-2.0.so.0
Reading symbols from /usr/lib/libgdk-x11-2.0.so.0...done.
Loaded symbols for /usr/lib/libgdk-x11-2.0.so.0
Reading symbols from /usr/lib/libatk-1.0.so.0...done.
Loaded symbols for /usr/lib/libatk-1.0.so.0
Reading symbols from /lib/libgio-2.0.so.0...done.
Loaded symbols for /lib/libgio-2.0.so.0
Reading symbols from /usr/lib/libpangoft2-1.0.so.0...done.
Loaded symbols for /usr/lib/libpangoft2-1.0.so.0
Reading symbols from /usr/lib/libgdk_pixbuf-2.0.so.0...done.
Loaded symbols for /usr/lib/libgdk_pixbuf-2.0.so.0
Reading symbols from /usr/lib/libpangocairo-1.0.so.0...done.
Loaded symbols for /usr/lib/libpangocairo-1.0.so.0
Reading symbols from /usr/lib/libcairo.so.2...done.
Loaded symbols for /usr/lib/libcairo.so.2
Reading symbols from /usr/lib/libpango-1.0.so.0...done.
Loaded symbols for /usr/lib/libpango-1.0.so.0
Reading symbols from /usr/lib/libfreetype.so.6...done.
Loaded symbols for /usr/lib/libfreetype.so.6
Reading symbols from /usr/lib/libfontconfig.so.1...done.
Loaded symbols for /usr/lib/libfontconfig.so.1
Reading symbols from /lib/libgobject-2.0.so.0...done.
Loaded symbols for /lib/libgobject-2.0.so.0
Reading symbols from /lib/libgmodule-2.0.so.0...done.
Loaded symbols for /lib/libgmodule-2.0.so.0
Reading symbols from /lib/libglib-2.0.so.0...done.
Loaded symbols for /lib/libglib-2.0.so.0
Reading symbols from /lib/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 0xb8063750 (LWP 13013)]
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/libSM.so.6...done.
Loaded symbols for /usr/lib/libSM.so.6
Reading symbols from /usr/lib/libICE.so.6...done.
Loaded symbols for /usr/lib/libICE.so.6
Reading symbols from /usr/lib/libtiff.so.3...done.
Loaded symbols for /usr/lib/libtiff.so.3
Reading symbols from /usr/lib/libjpeg.so.62...done.
Loaded symbols for /usr/lib/libjpeg.so.62
Reading symbols from /usr/lib/libpng12.so.0...done.
Loaded symbols for /usr/lib/libpng12.so.0
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /usr/lib/libungif.so.4...done.
Loaded symbols for /usr/lib/libungif.so.4
Reading symbols from /usr/lib/libXpm.so.4...done.
Loaded symbols for /usr/lib/libXpm.so.4
Reading symbols from /usr/lib/libX11.so.6...done.
Loaded symbols for /usr/lib/libX11.so.6
Reading symbols from /usr/lib/libXft.so.2...done.
Loaded symbols for /usr/lib/libXft.so.2
Reading symbols from /usr/lib/libXrender.so.1...done.
Loaded symbols for /usr/lib/libXrender.so.1
Reading symbols from /lib/libncurses.so.5...done.
Loaded symbols for /lib/libncurses.so.5
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/lib/libgif.so.4...done.
Loaded symbols for /usr/lib/libgif.so.4
Reading symbols from /lib/libtinfo.so.5...done.
Loaded symbols for /lib/libtinfo.so.5
Reading symbols from /usr/lib/libXcomposite.so.1...done.
Loaded symbols for /usr/lib/libXcomposite.so.1
Reading symbols from /usr/lib/libXdamage.so.1...done.
Loaded symbols for /usr/lib/libXdamage.so.1
Reading symbols from /usr/lib/libXfixes.so.3...done.
Loaded symbols for /usr/lib/libXfixes.so.3
Reading symbols from /usr/lib/libXext.so.6...done.
Loaded symbols for /usr/lib/libXext.so.6
Reading symbols from /usr/lib/libXinerama.so.1...done.
Loaded symbols for /usr/lib/libXinerama.so.1
Reading symbols from /usr/lib/libXi.so.6...done.
Loaded symbols for /usr/lib/libXi.so.6
Reading symbols from /usr/lib/libXrandr.so.2...done.
Loaded symbols for /usr/lib/libXrandr.so.2
Reading symbols from /usr/lib/libXcursor.so.1...done.
Loaded symbols for /usr/lib/libXcursor.so.1
Reading symbols from /lib/libselinux.so.1...done.
Loaded symbols for /lib/libselinux.so.1
Reading symbols from /usr/lib/libpixman-1.so.0...done.
Loaded symbols for /usr/lib/libpixman-1.so.0
Reading symbols from /lib/libexpat.so.1...done.
Loaded symbols for /lib/libexpat.so.1
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libuuid.so.1...done.
Loaded symbols for /lib/libuuid.so.1
Reading symbols from /usr/lib/libxcb-xlib.so.0...done.
Loaded symbols for /usr/lib/libxcb-xlib.so.0
Reading symbols from /usr/lib/libxcb.so.1...done.
Loaded symbols for /usr/lib/libxcb.so.1
Reading symbols from /usr/lib/libXau.so.6...done.
Loaded symbols for /usr/lib/libXau.so.6
Reading symbols from /usr/lib/libXdmcp.so.6...done.
Loaded symbols for /usr/lib/libXdmcp.so.6
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /usr/lib/gtk-2.0/2.10.0/engines/libnodoka.so...done.
Loaded symbols for /usr/lib/gtk-2.0/2.10.0/engines/libnodoka.so
Reading symbols from /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-xpm.so...done.
Loaded symbols for /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-xpm.so
0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install atk.i386 cairo.i386 e2fsprogs.i386 expat.i386 fontconfig.i386 freetype.i386 giflib.i386 glib2.i386 glibc.i686 gtk-nodoka-engine.i386 gtk2.i386 libICE.i386 libSM.i386 libX11.i386 libXau.i386 libXcomposite.i386 libXcursor.i386 libXdamage.i386 libXdmcp.i386 libXext.i386 libXfixes.i386 libXft.i386 libXi.i386 libXinerama.i386 libXpm.i386 libXrandr.i386 libXrender.i386 libjpeg.i386 libpng.i386 libselinux.i386 libtiff.i386 libxcb.i386 ncurses.i386 pango.i386 pixman.i386 zlib.i386
(gdb) bt
#0  0x00110416 in __kernel_vsyscall ()
#1  0x0061b34d in ___newselect_nocancel () from /lib/libc.so.6
#2  0x0819b186 in select_wrapper () at process.c:4262
#3  wait_reading_process_output (time_limit=0, microsecs=0, read_kbd=0, do_display=0, wait_for_cell=137669945, wait_proc=0xa04d110, just_wait_proc=0) at process.c:4624
#4  0x0819d921 in Faccept_process_output (process=168087828, seconds=137669945, millisec=137669945, just_this_one=137669945) at process.c:4003
#5  0x0816a4d6 in Feval (form=167720573) at eval.c:2334
#6  0x0816a7bf in Fprogn (args=0) at eval.c:449
#7  0x0816a5cb in Feval (form=167720565) at eval.c:2271
#8  0x0816b178 in Fwhile (args=167720661) at eval.c:1085
#9  0x0816a5cb in Feval (form=167720557) at eval.c:2271
#10 0x0816a7bf in Fprogn (args=0) at eval.c:449
#11 0x0816a5cb in Feval (form=167555397) at eval.c:2271
#12 0x0816a7bf in Fprogn (args=0) at eval.c:449
#13 0x0816a5cb in Feval (form=167555229) at eval.c:2271
#14 0x0816a7bf in Fprogn (args=0) at eval.c:449
#15 0x0816a5cb in Feval (form=167555085) at eval.c:2271
#16 0x0816a7bf in Fprogn (args=0) at eval.c:449
#17 0x0816b4c3 in FletX (args=167555077) at eval.c:1010
#18 0x0816a5cb in Feval (form=167556989) at eval.c:2271
#19 0x0816a7bf in Fprogn (args=0) at eval.c:449
#20 0x08162256 in Fsave_excursion (args=167556981) at editfns.c:1002
#21 0x0816a5cb in Feval (form=167556965) at eval.c:2271
#22 0x0816a7bf in Fprogn (args=0) at eval.c:449
#23 0x0816aa5f in funcall_lambda (fun=167718392, nargs=0, arg_vector=0xbfc830b0) at eval.c:3173
#24 0x0816ab62 in apply_lambda (fun=167718397, args=137669945, eval_flag=1) at eval.c:3104
#25 0x0816a20f in Feval (form=167561061) at eval.c:2384
#26 0x0816a7bf in Fprogn (args=0) at eval.c:449
#27 0x0816a5cb in Feval (form=167561229) at eval.c:2271
#28 0x0816a5cb in Feval (form=167561253) at eval.c:2271
#29 0x0816a7bf in Fprogn (args=0) at eval.c:449
#30 0x0816b36b in Flet (args=167561453) at eval.c:1066
#31 0x0816a5cb in Feval (form=167561485) at eval.c:2271
#32 0x0816a7bf in Fprogn (args=0) at eval.c:449
#33 0x0816aa5f in funcall_lambda (fun=167558536, nargs=0, arg_vector=0xbfc8347c) at eval.c:3173
#34 0x08168863 in Ffuncall (nargs=1, args=0xbfc83478) at eval.c:3050
#35 0x08169bc1 in run_hook_with_args (nargs=1, args=0xbfc83478, cond=to_completion) at eval.c:2652
#36 0x08169d82 in Frun_hooks (nargs=1, args=0xbfc83514) at eval.c:2515
#37 0x08168a0e in Ffuncall (nargs=2, args=0xbfc83510) at eval.c:2974
#38 0x08169a49 in call1 (fn=137740521, arg1=137706673) at eval.c:2778
#39 0x080ff7d5 in safe_run_hooks_1 (hook=-1077398212) at keyboard.c:2123
#40 0x08167ef0 in internal_condition_case (bfun=0x80ff7b0 <safe_run_hooks_1>, handlers=137669993, hfun=0x81048f0 <safe_run_hooks_error>) at eval.c:1484
#41 0x08104837 in safe_run_hooks (hook=137706673) at keyboard.c:2151
#42 0x0810cb1f in command_loop_1 () at keyboard.c:1526
#43 0x08167ef0 in internal_condition_case (bfun=0x810bde0 <command_loop_1>, handlers=137715417, hfun=0x8105490 <cmd_error>) at eval.c:1484
#44 0x081048e5 in command_loop_2 () at keyboard.c:1330
#45 0x08167fca in internal_catch (tag=137711601, func=0x81048c0 <command_loop_2>, arg=137669945) at eval.c:1224
#46 0x081052e9 in command_loop () at keyboard.c:1309
#47 0x081056aa in recursive_edit_1 () at keyboard.c:1007
#48 0x081057a6 in Frecursive_edit () at keyboard.c:1068
#49 0x080fbeef in main (argc=4, argv=0xbfc83d04) at emacs.c:1770
(gdb) 
(gdb) info registers 
eax            0xfffffdfe	-514
ecx            0xbfc829e4	-1077401116
edx            0x0	0
ebx            0x5	5
esp            0xbfc827bc	0xbfc827bc
ebp            0xbfc82b38	0xbfc82b38
esi            0x0	0
edi            0xbfc82aa4	-1077400924
eip            0x110416	0x110416 <__kernel_vsyscall+2>
eflags         0x200246	[ PF ZF IF ID ]
cs             0x73	115
ss             0x7b	123
ds             0x7b	123
es             0x7b	123
fs             0x0	0
gs             0x33	51
(gdb)

Comment 1 Doug Maxey 2008-11-18 07:09:24 UTC
It appears that forcing ispell (hunspell) to re-read the buffer for spell checking also triggers the same hang.

Comment 2 Doug Maxey 2008-11-18 19:56:23 UTC
Ok.  Have confirmed that the hanging app is indeed hunspell.  I get the same behaviour with an MUA that has nothing to do with emacs, other than both use hunspell.

Raising to high as this completely blocks any MUA or editor that attempts to use.

Comment 3 Caolan McNamara 2008-11-18 23:00:40 UTC
Are you 100% sure it is hunspell. You say "forcing ispell (hunspell) to..." and the hunspell rpm does not provide an ispell alias, aspell does that.

That said, I'm not an emacs user, so if you give an idiots guide to reproducing this I can have a look.

Comment 4 Doug Maxey 2008-11-18 23:59:19 UTC
(In reply to comment #3)
> Are you 100% sure it is hunspell. You say "forcing ispell (hunspell) to..." and
> the hunspell rpm does not provide an ispell alias, aspell does that.

Thanks for looking into this.

Yes.  100%.  I have to declare hunspell in emacs as the 'ispell' program name.  Once I got emacs to work, I took the args it was run with and use that in exmh (prefered MUA).

> 
> That said, I'm not an emacs user, so if you give an idiots guide to reproducing
> this I can have a look.

heh.  It gets started as 'hunspell -a -m -B'.  That's about as far as I can take you.  That apparently gets it to read in the entire buffer.

++doug

Comment 5 Caolan McNamara 2008-11-19 09:53:28 UTC
Aha, F-9 hunspell didn't have a -m option, but it does now. Unfortunately it does something quite different to the ispell -m option, so the responses aren't as expected as it kicks hunspell into a different mode

So to workaround in emacs spellchecking options, if you set the ispell extra arg to "-a" then hunspell will be invoked as hunspell -a -m -B -a and the second -a will override the -m which triggers a different mode in hunspell. That'll get you back to the F-9 situation.

Patch to fix properly filed upstream as 
http://sourceforge.net/tracker/?func=detail&atid=756397&aid=2314461&group_id=143754
and checked into devel and F-10 and built to f10-updates-candidates

There is a workaround, (extra -a) and its not the out-of-box configuration so I don't see it as a F-10 blocker

Comment 6 Doug Maxey 2008-11-19 15:13:35 UTC
Hm.  Interesting.  My config neither adds or deletes any flags that I can discern.  Looking into how to add the extra -a.

Comment 7 Caolan McNamara 2008-11-19 15:29:37 UTC
Give this a go...

(custom-set-variables
 '(ispell-extra-args (quote ("-a")))
 '(ispell-program-name "/usr/bin/hunspell"))

Comment 8 Doug Maxey 2008-11-19 19:24:01 UTC
Thanks.  This does stop the hangs.

Comment 9 Bug Zapper 2008-11-26 05:12:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Caolan McNamara 2008-11-26 15:11:41 UTC
Done in rawhide, will be in F-11