Hi all,

We've been struggling with the segfault issue in 3.20b1 running htdig with
external protocols, and I think we got it fixed...

The issue:  htdig segfaults right before exiting when you're using
external_protocols to index via ssl (reported by Mentos Hoffman 3/15/00).  It
indexes normally and is searchable, but segfaults at exit with a message like:
Geoff's reply to Mentos indicated that this was a problem with the Transport
class opening a connection and then failing to close it.  In fact, what's
happening is that in Document:::Retrieve, url->service() is examined to see
what protocol it's using, and an HtHTTP,HtFile, or ExternalTransport object is
created accordingly.  In Document::~Document, the HtHTTP and HtFile objects are
killed off if they exist, but there's no corresponding code to get rid of the
ExternalTransport.  

The fix:
We added a line to delete the ExternalTransport object and recompiled, but when
we ran it, it died with a SIGILL complainig about problems with
Retriever::Initial.  We then moved the code to delete the URL, Referer, and
Proxy objects below the connection closings, and the program exited normally. 
Our modified Document::~Document is below.

This seems to have fixed the issue for us -- at least, it's indexing our ssl
documents without segfaulting!

Atlee Gordy

Document::~Document()
{

   // We delete only the derived class objects
    if (HTTPConnect)
      delete HTTPConnect;
    if (FileConnect)
      delete FileConnect;
    //added these lines to kill the ExternalTransport object
    if (externalConnect)
      delete externalConnect;

    //this stuff needs to be deleted *after* closing the connection objects
    if (url)
      delete url;
    if (proxy)
      delete proxy;
    if (referer)
      delete referer;

#if MEM_DEBUG
    char *p = new char;
    cout << "==== Document deleted: " << this << " new at " <<
        ((void *) p) << endl;
    delete p;
#endif
}


------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] 
You will receive a message to confirm this. 


Reply via email to