From: B. N. P. <poo...@in...> - 2007-07-04 13:09:30
|
Hello, We were getting seg fault while running the htstat command in the latest version of htdig i.e., htdig-3.2.0b6-21.2.: ************************************** ls -la /var/lib/htdig/db/ total 92 drwxr-xr-x 2 root root 4096 Jun 19 03:53 . drwxr-xr-x 3 root root 4096 Jun 19 03:53 .. -rw-r--r-- 1 root root 24576 Jun 20 14:55 db.docdb -rw-r--r-- 1 root root 91 Jun 20 14:55 db.docs -rw-r--r-- 1 root root 24576 Jun 20 14:55 db.docs.index -rw-r--r-- 1 root root 24576 Jun 13 17:03 db.excerpts -rw-r--r-- 1 root root 40 Jun 20 14:55 db.worddump -rw-r--r-- 1 root root 2048 Jun 13 17:03 db.words.db -rw-r--r-- 1 root root 16384 Jun 13 17:03 db.words.db_weakcmpr # htdig && htdig -t && htstat && htload && htstat htstat: Total documents: 1 htstat: Total words: 0 Segmentation fault *************************************************************************** On investigation, found that the word DB is empty and we are getting a seg fault as we are trying to get the total unique words count even though the total word count is '0'. Hence we made the following changes to htstat.cc (checking if words.WordRefs() count is zero or not) and it works fine now. **************************************************************************** HtWordList words(*config); if(words.Open(config->Find("word_db"), O_RDONLY) == OK) { cout << "htstat: Total words: " << words.WordRefs()->Count() << endl; + if (words.WordRefs()->Count() != 0) cout << "htstat: Total unique words: " << words.Words()->Count() << endl; words.Close(); } ******************************************************************************** Can you please let us know if the proposed patch is OK or not? Regards, Poornima |