Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Spellcheck soundex infinite loop?

Quote Reply
Spellcheck soundex infinite loop?
Hello,

First of all, I wanted to say how much we like Gossamer Forum, we've been using it for a good while now on our site and we really like it. : )

One little issue recently, I found that when I tried to "spell check" a message that started with "Ahh" (as in "Ahh, that makes sense") the browser wouldn't respond and the CPU usage for the perl process (on FreeBSD) would slowly climb up towards 100%.

Now, I don't know if this is just something with our install or what, but we had a quick look through the code and it seems things were getting caught up in /admin/GT/SpellCheck.pm around line 232 where it says:

Code:
# else we are in the good interval, we need to rewind till
# we are at the beginning of the interval. while (not $search_sound cmp $sound) {
$current--;

sysseek $self->{SOUNDEX}, ($current * $record_size), 0;
sysread $self->{SOUNDEX}, $sound, 4;
}


It seems like the soundex value for our word was "A000" and that $current was going from 0 to 1 to -1 and lower forever (or at least until I killed the process).

Anyway, adding a line in the middle that says "if ($current < 0) { last; }" seemed to fix it, but I really don't know all that much about how all the spellcheck code works so I just wanted to make sure that wouldn't break anything else, or check if there was something else I should change. Any thoughts or comments on this issue?

Note: The only other non-standard thing about our setup is we recently upgraded from 1.1.4 to 1.1.8.
Subject Author Views Date
Thread Spellcheck soundex infinite loop? dave-itools 2073 Oct 23, 2002, 11:17 AM
Post Re: [dave-itools] Spellcheck soundex infinite loop?
yogi 2006 Oct 23, 2002, 12:07 PM
Thread Re: [dave-itools] Spellcheck soundex infinite loop?
Alex 1960 Oct 25, 2002, 3:38 PM
Post Re: [Alex] Spellcheck soundex infinite loop?
dave-itools 1939 Nov 1, 2002, 3:37 PM