Re: Aspell core dump

Kevin Atkinson <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <Pine.LNX.4.44.0412151957360.4541-100000@kevin-p3.atkinson.dhs.org>
On Wed, 15 Dec 2004, Gary Setter wrote:

> <snip>
> > Hi,
> > I tried to look into this. The win32 port does not dump core, but
> > it does reprompt for when webserver is replaced by web-server or
> > web server. I have had it stuck in an infinite loop, but I'm
> > having difficulty recreating the problem.

So does Aspell hang because it is in an infinite loop or is it just keep on 
repromting?

> >
> > At the center of the infinite loop problem is this function in
> > writeable.
> >
> > static void soundslike_next(WordEntry * w)
> > {
> >   const Str * i   = (const Str *)(w->intr[0]);
> >   const Str * end = (const Str *)(w->intr[1]);
> >   set_word(*w, *i);
> >   ++i;
> >   if (i == end) w->adv_ = 0;
> > }
> > Nothing is changing w->intr[0] or w-inter[1] so w->adv is never
> > set to zero and the loop never terminates.
> >
> > Also the WordEntry::intr array of void pointers is a bad idea in
> > my opinion. Is there any support for eliminating them?
> 
> I'm still studying writable.cpp. I'm finding what are in my
> opinion bad ideas. This is the first:
> static inline StrVector * get_vector(Str s)
> {
>   return (StrVector *)(s - sizeof(StrVector) - 2);
> }
> It seems a Vector<Str> object is allocated, but only the address
> of first string is saved. Then, when we want to use the Vector,
> we just subtract and cast.
> I think the
>  WritableReplDict::add_repl()
> and
>  WritableDict::add()
> functions are along the same lines.
> Does anyone else have problems with these functions as they are?
> 
> I would like to straighten this out as part of fixing the
> infinite loop problem.

There is nothing wrong with them.  I do it to save space.  Yes it 
contains some ugly stuff but it is completely contained within the single 
source file so I don't have to worry about it anywhere else.  I will not 
unless it causes a problem.

> Also, I had a problem saving replacement pairs that included
> hyphenated words. I fixed it in
>   PosibErr<void> SpellerImpl::store_replacement().
> The fix was to retrieve the separator characters from config and
> use them, (not just space) to break up the replacement string
> into its parts. I wasn't going to submit a patch until I fixed
> the infinite loop bug, but I would be interested in what the list
> things before I submit a patch.

I believe that is the correct thing to do but I will have to see the patch 
to be sure.

-- 
http://kevin.atkinson.dhs.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.