Skip to main content.
home | support | download

Back to List Archive

Re: Segementation fault core dump (on merging)

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Sep 20 2002 - 20:52:01 GMT
At 08:22 PM 09/19/02 -0700, Trond Nilsen wrote:
>I've just encountered the same problem running under Windows (merging files 
>throws a nasty seg fault).

They are all nasty until you figure them out.  Then they are obvious.

This was my fault -- trying to be nice and display interesting things...

When merging if two files have the same path name swish then looks at their
last modified date to decide which file to keep.  Now, it's possible that a
file (or both) might not have a last modified date (quite possible on web
pages).

Nothing wrong there -- swish can do the compare correctly (missing dates
would be considered old).

What I did wrong was I added a bit of code to display when a file was
replaced during merge and their respective last modified dates.  Thinking
that if one file is older than the other then they must therefore have
dates assigned, which of course is not true.  Hence the segfault trying to
decode a date property that doesn't exist.

Anyway, that's been fixed and will be in 2.2.1 soon.

But there's still a problem...

If you are merging two files that do not have a date (because the web
server doesn't supply one) you still want the newer file -- so how do you
pick which is the newer file?  

The easy solution is to make sure that all files have a date when you
expect to merge.  If a page returned by the web server doesn't have a date
then just assign the current time.  Easy with spider.pl.

So add this "test_response" test to spider.pl's config file and add a
last-modified date if one doesn't exist:

@servers = (
  {
    base_url => "http://....",
    ...

    test_response => sub {
        my $response = $_[2];
        $response->last_modified(time) unless $response->last_modified;
        return 1;
    },
  },
);

That should also fix your segfaults with the current 2.2 version.


That will assign a date to the file if one does not already exist.

Sundaram, can you check to see if this applies to your situation, too?  I
couldn't download your files.




-- 
Bill Moseley
mailto:moseley@hank.org
Received on Fri Sep 20 20:56:18 2002