[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pspell-devel] pspell-ispell bug: example-c.c
From: |
Melvin Hadasht |
Subject: |
[pspell-devel] pspell-ispell bug: example-c.c |
Date: |
Mon Nov 26 16:57:05 2001 |
Hi,
I think I stumbled on a bug in pspell-ispell. When using pspell
library with the pspell-ispell module (i.e. selecting a
dictionary that is only available as an ispell dictionary), I
get segfault in my mailer (sylpheed-claws). I tested it with 2
differents ispell dictionaries (en & de). If I use instead an
aspell dictionary, then it does not segfault. It is triggered
when finishing composing i.e. after calling
delete_pspell_manager *but* it seems not to happen within the
pspell code. Under gdb I can't trigger the bug, but if I use
the dumped core, gdb says it happens just on the function call
following the delete_pspell_manager.
So I tried the example-c.c found in the pspell source to test
if the problem is from the (my) mailer implementation of the
spell checker of if it is indeed a pspell-ispell bug :
I used the latest pspell (.12.2) and pspell-ispell (.12) with
gcc-2.95.2 on linux 2.4.13, libtool 1.4
1. Testing pspell-.12.2/example/example-c.c :
compiling it and using it with an ispell dictionary is OK. I
made sure I haven't an aspell version of the used dictionary
(language)
2. I modified the example so it will iterate (I join a patch on
this mail (example-c-loop.c)) : I just put 'main' in a function
'mmain' and looping on it :
int main (...) {
while (1) {
printf ("%d\n",mmain (...)) // <- mmain is the old main
// function from the example
getchar(); }
}
When I run it with an ispell dictionary I get a segmentation
fault after the call to mmain. Running the example with an
aspell dictionary does not segfault. Running within gdb and
with ispell it segfaults in an input/output C-function (IIRC
__getc__). But stepping through the program does not trigger
the segfault. I can send the backtrace, but as I think it is
something to do with module dynamic loading / unloading, the
backtrace won't help.
Now the funny thing : if I comment out the 'getchar', then the
loop runs almost ok without segfault. The first iteration is
ok, *but* then on the next I get a negative (-1) exit values
from mmain with an error 'Select on Ispell process returned an
error.'. The next loop can have the same error or it can run
ok.
I don't know if this sounds clear, sorry, english is not my
first language.
But try the example-c-loop.c (patch joined in this mail, apply
in pspell-.12.2/example/ with : patch -p0 <
example-c-loop.c.patch), and you will see.
What suggests me it's a pspell-ispell error is that everything
goes ok if I use a dictionary that is available in the aspell
format but if I use an ispell dictionary the problems rise.
Can someone please help me shedding the light on this ? I can't
figure out where the problem is.
(aspell is slower than ispell and some users with old boxes
want to use ispell with the mailer, and as I am the author of
the spell checker code in this mailer...)
Feel free to ask more details.
--
Melvin Hadasht
example-c-loop.c.patch
Description: Text document
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [pspell-devel] pspell-ispell bug: example-c.c,
Melvin Hadasht <=