Skip to main content.
home | support | download

Back to List Archive

Re: Compile or Search problem?

From: Peter Ensch <pensch(at)not-real.ti.com>
Date: Fri Jan 16 2004 - 18:06:46 GMT
On Fri, Jan 16, 2004 at 09:49:02AM -0600, John Elser wrote:
> There might be a clue in your webserver log files.
> 

No; however, there is a problem I missed in the original post. Turns
out our sys. admins. had changed the machine the webserver runs on.
Now, if I try to run a search query from the command line on that 
machine I get a seg. fault. A simple swish-e -V works fine however. 

Is there a way I can find out the cause of the seg. fault? 

Regards,
Peter

> ----- Original Message ----- 
> From: "Peter Ensch" <pensch@ti.com>
> To: "Multiple recipients of list" <swish-e@sunsite.berkeley.edu>
> Sent: Friday, January 16, 2004 9:10 AM
> Subject: [SWISH-E] Compile or Search problem?
> 
> 
> > I'm just starting to use swish-e. I compiled successfully
> > and have indexed my site. I updated swish.cgi to provide
> > a search front-end but find that though it always works 
> > on the cmd. line, swish returns nothing when running thru'
> > my webserver. I can move the cgi script and index files to
> > another server and it works as expected. 
> > 
> > If I simply ask swish to output it's version number, it
> > works all the time.
> > 
> > I'm stumped. Can anyone help? I've included all the details
> > and a stripped-down (working) code sample below.
> > 
> > Thanks,
> > Peter
> > 
> > 
> > Swish-e version: 2.4.1
> > Compiled on: SunOS 5.8 Generic_108528-18 sun4u sparc SUNW,Ultra-5_10 
> > Perl version: 5.8.0
> > 
> > test.cgi:
> > ------------------------------------------------
> > #!/usr/local/bin/perl
> > use strict;
> > use warnings;
> > 
> > print "Content-Type: text/html;\n\n";
> > forking();
> > 
> > sub forking {
> >   my @args = ("-w", "floorplan"); # args #1
> > #  my @args = ("-V");             # args #2
> >   my $pid = open(OUT, '-|');
> >   die "Failed to fork: $!\n" unless defined $pid;
> >   if($pid) {
> >     print "$_<br>" while <OUT>;
> >   } else {
> >     unless (exec "/home/pensch/swish-e/bin/swish-e", @args) {
> >       print "Failed to exec Swish";
> >       exit;
> >     }
> >   }
> > }
> > ------------------------------------------------
> > 
> > The test index files are in the same directory as the CGI
> > script. For testing, the one file indexed is test.cgi.
> > 
> > When run on the cmd.line (on either machine), output is:
> > 
> > [143] % ./test.cgi
> > Content-Type: text/html;
> > 
> > # SWISH format: 2.4.1
> > <br># Search words: 'floorplan'
> > <br># Removed stopwords:
> > <br># Number of hits: 1
> > <br># Search time: 0.001 seconds
> > <br># Run time: 0.036 seconds
> > <br>1000 test.cgi "test.cgi" 493
> > <br>.
> > <br>
> > 
> > Here's the problem. When run via the webserver, results are not the same 
> > on the 2 servers although the test script and indexes are identical.
> > 
> > Server1: SunOS 5.8 Generic_108528-16 sun4u sparc SUNW,UltraAX-i2
> >          Netscape-Enterprise v3.6
> >          Only the HTTP header is output (and no error messages).
> > 
> > Server2: SunOS 5.8 Generic_108528-18 sun4u sparc SUNW,Ultra-2
> >          Apache v2.0.47
> >          Output is as expected (same as cmd.line). 
> > 
> > If I comment out args line #1 and replace with args line #2,
> > both servers output 'SWISH-E 2.4.1' as expected. This leads me
> > to think that the compile was OK. But what else could it be???
> > 
> > 
> > 
> > 
> > -- 
> > 
> > ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
> > Peter Ensch,
> > pensch@ti.com           A-1140   (214) 480 2333
> > ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^

-- 

^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
Peter Ensch,
pensch@ti.com           A-1140   (214) 480 2333
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
Received on Fri Jan 16 18:11:05 2004