This is going to be long.  It's also incomplete because I want to run one more
test that came to me this AM.

--
Output of perl -v:

This is perl, version 5.005_02 built for PA-RISC2.0

Copyright 1987-1998, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

--
Ouptut of perl -V:
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC2.0
    uname='hp-ux hpprobe b.11.00 a 9000800 869669421 two-user license '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize=' ', gccversion=
    cppflags='-D_HPUX_SOURCE -Aa -I/usr/local/include'
    ccflags ='-D_HPUX_SOURCE -Aa -I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib/pa1.1 /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lcl
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
    cccdlflags='+z', lddlflags='-b -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under hpux
  Compiled at Nov 30 1999 15:00:56
  %ENV:
    PERL_AIOC="/sp1/perl_aioc"
  @INC:
    /usr/local/lib/perl5/5.00502/PA-RISC2.0
    /usr/local/lib/perl5/5.00502
    /usr/local/lib/perl5/site_perl/5.005/PA-RISC2.0
    /usr/local/lib/perl5/site_perl/5.005
    .

--
mod_perl version: 1.21
configure is run as follows (building out of /usr/local/src):
    perl Makefile.PL \
      APACHE_SRC=../apache_1.3.9 \
      DO_HTTPD=1 \
      USE_APACI=1 \
      PREP_HTTPD=1 \
      EVERYTHING=1

--
apache version:   1.3.9
configure for mod_perl-enabled apache as follows:
    CC=cc EXTRA_CFLAGS=+e ./configure \
      --activate-module=src/modules/perl/libperl.a \
      --disable-module=auth \
      --disable-module=autoindex \
      --disable-module=imap

--
make test:   passes 100% as follows:
 (numerous skippings of unchanged .pm and .h files deleted for brevity)
        cp t/conf/mod_perl_srm.conf t/conf/srm.conf
        ../apache_1.3.9/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t &
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...done
        /usr/bin/perl t/TEST 0
still waiting for server to warm up...ok
ok
ok
modules/actions.....ok
modules/cgi.........ok
modules/constants...ok
modules/cookie......skipping test on this platform
modules/file........ok
modules/httpdconf...ok
modules/include.....ok
modules/log.........ok
modules/module......skipping test on this platform
modules/perlrun.....ok
modules/perlrunxs...skipping test on this platform
modules/psections...skipping test on this platform
modules/request.....skipping test on this platform
modules/sandwich....skipping test on this platform
modules/src.........ok
modules/ssi.........ok
modules/stage.......skipping test on this platform
modules/status......ok
modules/symbol......skipping test on this platform
modules/uri.........ok
modules/util........ok
internal/api........ok
internal/auth.......ok
internal/croak......ok
internal/dirmagic...ok
internal/error......ok
internal/headers....ok
internal/hooks......ok
internal/http-get...ok
internal/http-post..ok
internal/proxy......ok
internal/redirect...ok
internal/rwrite.....ok
internal/stacked....ok
internal/table......ok
internal/taint......ok
All tests successful, 8 tests skipped.
Files=36,  Tests=370, 26 wallclock secs (18.47 cusr +  1.30 csys = 19.77 CPU)
        kill `cat t/logs/httpd.pid`
        rm -f t/logs/httpd.pid
        rm -f t/logs/error_log

--
mod_perl-enabled apache started up as follows:
  /isg/WWW/bin/httpd_perl -X -d/isg/WWW -f conf/modperl.conf
no errors on startup.  Only notation in its error log is that it is starting up

server configuration as follows:
--cut here--
ServerType      standalone
Port            90
User            aisgadm
Group           staff
ServerAdmin     [EMAIL PROTECTED]

# -- do NOT perform a reverse DNS lookup on the incoming conx
#
HostNameLookups off

# -- ServerRoot: where the server's config, error, and log files are kept
#
ServerRoot      /isg/WWW
AccessConfig    /dev/null
ResourceConfig  /dev/null

# -- Log file locations/settings
#
ErrorLog        logs/error.modperl
TransferLog     logs/access_modperl
PidFile         logs/modperl.pid
ScoreBoardFile  logs/apache_modperl_status

# -- Timeout: The number of seconds before receives and sends time out
#
Timeout         200

# -- Server-pool size regulation.  Real limited because we hand completed
requests
#    back to the primary server(s)
#
MinSpareServers            1
MaxSpareServers            1
StartServers               1
MaxClients                 1
MaxRequestsPerChild     1000

# -- Aliases
#
Alias           /lib/           /isg/WWW/lib/
Alias           /cgi-bin/       /isg/WWW/cgi-bin/
Alias           /images/        /isg/WWW/images/
Alias           //              /isg/WWW/

# -- document root configuration
#
DocumentRoot    /isg/WWW/spr
DefaultType     text/plain

# -- language support
#
AddLanguage             en      .en
LanguagePriority        en

# -- javascript handling
#
AddType         application/x-javascript        .js
AddHandler      javascript                      .js

# -- Customizable error response (Apache style)
#
ErrorDocument   400     /htdocs/error/booboo.shtml
ErrorDocument   403     /htdocs/error/forbidden.shtml
ErrorDocument   404     /htdocs/error/missing.shtml
ErrorDocument   414     /htdocs/error/booboo.shtml
ErrorDocument   500     /htdocs/error/booboo.shtml


#--------------------------------------------------------------------------
# mod_perl setup
#--------------------------------------------------------------------------
PerlWarn        On
PerlTaintCheck  Off

# -- perl/DBI setup
#
PerlSetEnv      ORACLE_BASE     /ora01/app/oracle
PerlSetEnv      ORACLE_HOME     /ora01/app/oracle/product/7.3.4
PerlSetEnv      ORACLE_SID      xx
PerlSetEnv      ORACLE_USERID   xx/xxxxxxx
PerlSetEnv      ORACLE_ADMIN    /ora01/app/oracle/admin/xx
PerlSetEnv      ORAPIPES        V2

# -- pull in our modules and globals
#
PerlRequire     libexec/startup.pl

# -- access control to the SPR system - *only* allowed from front-end server
#
<Location />
  AuthName              aisg
  AuthType              Basic
  <Limit POST GET>
    order               deny,allow
    deny from           all
    allow from          127.0.0.1
  </Limit>
</Location>

# -- set proper Apache handler for CGI scripts
#
<Location /cgi-bin>
  Options       ExecCGI
  setHandler    perl-script
  perlHandler   Apache::Registry
</Location>
--cut here--

startup.pl:
--cut here--
use strict;
use lib  qw[/isg/WWW/libexec];

# -- make sure we are in a sane environment before going any farther
#
$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/o
    or die "GATEWAY_INTERFACE not perl!";

# -- continue with module load if OK
#
use Apache::Constants;  # it's needed.  Trust me.
use Apache::Registry;   # mod_perl CGI harness
use Text::Template;     # so we can use HTML templates
use Time::Local;        # for some time computations in SPR_metrics.pl
use DBI;
#use SPR;               # loads DBI and provides custom connection management

#$G::dbh = DBI->connect("dbi:Oracle:", $ENV{ORACLE_USERID}, "", {RaiseError=>1})
;

# -- precompile CGI.pm
#
use CGI;
CGI->compile(':all');

# -- load coderefs into our global namespace
#
$G::file_name = sub { join '/' => $ENV{DOCUMENT_ROOT}, shift };

# -- standard document footer also goes into global namespace
#
$G::footer = <<EOF;
<img src="/images/jet.gif">
<address>
  <a href="mailto:segerge\@aisgadm4.wpafb.af.mil">webmaster\@aisg-hp</a>
</address>
EOF


1;  # -- so all packages return true
--cut here--
I commented out the "use SPR" line because otherwise I would see my error on
server startup.

--
test script illustrating problem (data unique to my worksite masked):
--cut here--
#!/usr/local/bin/perl -w
use strict;
use DBI;

# -- local initialization
#
$| = 1;   # unbuffer STDOUT
$ENV{ORACLE_SID}    = 'xx';
$ENV{ORACLE_USERID} = 'xx/xxxxxxx';
$ENV{ORACLE_HOME}   = '/ora01/app/oracle/product/7.3.4';

# -- dump ORACLE-specific environment
#
#print "Content-type: text/html\n\n"; # uncomment to run as CGI
print "<HEAD><TITLE>DBI Test</TITLE></HEAD>\n";
print "<TABLE BORDER>\n";
while (my ($key, $val) = each %ENV) {
  next unless $key =~ /ORACLE/;
  print "<TR><TH>$key</TH><TD>$val</TD></TR>\n";
}
print "</TABLE>\n";

# -- can we connect via the OS?
#
print "<hr><pre>\n";
open PING, "$ENV{ORACLE_HOME}/bin/tnsping xxxxxxxxxx.world |";
print $_ while <PING>;
close PING;
print "</pre><hr>\n";

# -- can we hook to ORACLE using the perl modules?
#
my $attr = {RaiseError => 1};
eval {
  my $dbh = DBI->connect('dbi:Oracle:', $ENV{ORACLE_USERID}, '', $attr);
  print "Success\n";
};

# -- handle the aftermath
#
exit 1 unless $@; # success
print $@;  # failure
--cut here--

This script works under CGI.  It also works from the command line, regardless of
how I am logged in.

Under my mod-perl enabled server, the DBI->connect() function in my script
returns an ORA-12157 error.  Tracing it further, line 307 in DBD::Oracle (a
ping() to verify the database connection) appears to be failing.  Tracing it
still further (amazing what the DBI debugging options, print statements, and
desperation can achieve...) it appears to be originating from line 258 in
dbdimp.c, which is a call to the orlon() function from the Oracle library.  I
consulted with an Oracle DBA we have on retainer, and he told me something to the
effect that ORA-12157 represented an internal error mere mortals were never meant
to see.  The lack of a core dump or corresponding entries in the error log have
frustrated my further efforts to solve this on my own.

I have noticed occasionally that setting TWO_TASK to attempt an explicit TCP/IP
connection instead of using ORACLE_SID will cause the web server to attempt to
request all 512 MBytes of memory.  I'll try that under the debugger after lunch
to see if I get anything.

Unitl yesterday, the only instance I had seen of anybody with my problem was a
posting from Tim Bunce last September asking if anyone had problems with mod_perl
and database connections on an HP platform. To the best of my searching, there
were no follow-ups to that article.

Ges

Reply via email to