ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> modperl
modperl
Re: okay, I give, I'm stumped
by David Kaufman other posts by this author
Jul 28 2002 7:49AM messages near this date
Re: okay, I give, I'm stumped | Re: okay, I give, I'm stumped
"Greg Rumple" <grumple@[...].net>  wrote:

>  The test.pl script works fine by it's self.  Turning on full PERL
>  debugging/tracing yields that the actual script has fully finished, and
>  that it's in the tear down of the actualy perl stuff that this failure
>  is coming from.   Not from the script per se.  But it is the script that
>  is causing this problem.  Commenting out the connect and disconnect
>  lines causes the server to startup and function just fine.

<conf snippage; test.pl containing:> 

>  BEGIN {
>      unshift(@INC, qw(
>          /home/grumple/src/test/lib/perl5
>          /home/grumple/src/test/system/lib/perl5
>      ));
>  }

did you intend that this BEGIN block only execute at server-start time, not
for each script execution?  if not, you might try replacing this with:

use lib qw(
  /home/grumple/src/test/lib/perl5
  /home/grumple/src/test/system/lib/perl5
);

>  use DBI;

again, just a shot in the dark, but why not try the more mod_perl specific
Apache::DBI instead of plain ole DBI?

>  use DBD::Informix;

i don't think you need this use statement at all.  the DBI-> connect() call
should load the "correct" DBD Driver, for you, not that it *should* make any
difference... but hey.

>  ## informix connection params
>  $ENV{'INFORMIXDIR'}    ||= '/opt/informix';
>  $ENV{'INFORMIXSERVER'} ||= 'test_tcp';
>  $ENV{'LD_LIBRARY_PATH'} .= ":$ENV{'INFORMIXDIR'}/lib";
> 
>  my $catalog = 'test';
>  my $constr = join(':', 'dbi', 'Informix', $catalog);
>  my $user = 'test';
>  my $password = 'test';
> 
>  my $dbh = DBI->connect($constr,$user,$password);

i would certainly suggest adding:

    or die DBI::errstr;

to that connect() call!

>  $dbh->disconnect();

um, okay but why disconnect at all, if you know the segfault is caused by
the connect and/or disconnect calls? have you tries simply *not*
disconnecting?  one of The Features/Advantages of Apache::DBI (over plain
ole DBI) is that disconnect calls simlpy destroy the connection *object*
(the perl data structure) without actually disconnecting from the DB, and
therby maintaining a pool of cached connections, and therby speeding things
up nicely.
Thread:
Greg Rumple
Geoffrey Young
Stas Bekman
Stas Bekman
simran
Geoffrey Young
simran
simran
Kyle Dawkins
Greg Rumple
Drew Taylor
Greg Rumple
David Kaufman
Greg Rumple

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved