[aseek-devel] Infinite loop in searchd

From: Jens Thoms Toerring (no email)
Date: Tue Aug 26 2003 - 10:27:24 EDT


Hi,

  I am currently trying to figure out why searchd hangs in an
infinite loop in the function search.cpp:AndResults when
searching for more than just a single word.

According to what I see in the debugger the 'same' variable never
in this function gets set and the 'else' part of the loop, that
gets entered when 'same' isn't set never gets me out of the loop.
I followed Daniel Stone's suggestion which basically is to force
'same' to 1, thus taking the other branch. This works, at least
as far as getting me out of the infinite loop, but it also breaks
the search: If I am looking for two words to be in the same
document, aspssek shows me results for all pages that contain the
first word, but doesn't bother about the second one (well, I guess
that should tell me something about the purpose of tge 'same'
variable ;-) So, obviously, this isn't really working.

The same problems happens with phrase searches, but this time the
inifinite loop is in CPhrase::GetResultForSite() (which has very
similart code to AndResults()). And forcing 'same' to 1 here
helps in getting out of the loop but also breaks the search.

All this happens with

Linux ub3744 2.4.19-4GB #1 Fri Sep 13 13:14:56 UTC 2002 i686 unknown

and

jens at ub3744:~> g++ --v
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.2/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib
--enable-languages=c,c++,f77,objc,java,ada --enable-libgcj
--with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib
--enable-shared --enable-__cxa_atexit i486-suse-linux
Thread model: posix
gcc version 3.2

Unfortunately, even after looking at the functions for two hours it's
still a complete mystery to me how it is supposed to work. Especially
lines like

   ( WORD * & ) *purl += ( ( WORD * ) ( *purl ) )[ 3 ] + 4;

are beyond me...
                                    Regards, Jens

-- 
 Freie Universitaet Berlin     Jens Thoms Toerring
 Universitaetsbibliothek
 Webteam                       Tel: 0049 30 838 56055
 Garystrasse 39                Fax: 0049 30 838 53738
 14195 Berlin                  e-mail: 







Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD