[sword-devel] Problems with the Hitchcocks and Smith lexicons

Troy A. Griffitts sword-devel@crosswire.org
Mon, 10 Dec 2001 04:26:25 -0700


> I'm doing some bug-fixing in BibleTime. We have the bug that opening the
> Hitchcocks and the Smith lexicons will lead to an infinite loop. Other
> lexicons like ISBE or Eastons open just fine.

The problems seems to be that these lexicons are not alphabetized
correctly.  We do a binary search for your key thru the index and if the
index is not alphabetized, the binary search algorythm may loop
infinitely.  Ask Chris to fix it :)

PS.  Better way to set module to top is (*module()) = TOP;

> 
> we execute te following (in bibletime/backend/cswordbiblemoduleinfo.cpp):
> 
>         module()->KeyText(" "); //set first key
>         [...]
>         do {
>                 //append key to our list
>                 m_entryList->append(QString::fromUtf8(module()->KeyText()));
> 
>                 (*module())++;
> 
>                 //debug to console
>                 qDebug("entry is now %s", module()->KeyText());
>         } while (!module()->Error());
> 
> 
> The Hitchcocks module outputs this using the code above:
> [...]
> (BibleTime 1.1pre) Debug: entry is now J
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAAKOBAH
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAALA
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAALAM
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAANAI
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAASAU
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAASIEL
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAAZAH O
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAAZANIAH
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now J
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAAKOBAH
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAALA
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAALAM
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAANAI
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAASAU
> (BibleTime 1.1pre) Debug: ++module now!
> (BibleTime 1.1pre) Debug: entry is now JAASIEL
> and so on
> 
> As you can see the teh loop runs until it reaches "JAAZANIAH" and starts then
> AGAIN with "J" and repeats this until I kill BibleTime!
> 
> The Smith lexcion has the same problem.
> 
> I think this is a bug in Sword. Is this true?
> Can somebody have a look at it? Troy? Chris? I'm not familair with the
> classes and the index files of lexicons.
> 
> I'd be really glad to get some help with this!
> Joachim