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



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
ht://Dig Developer mailing list:
htdig-dev@lists.sourceforge.net
List information (subscribe/unsubscribe, etc.)
https://lists.sourceforge.net/lists/listinfo/htdig-dev

Reply via email to