Re: Preloading DBI crashes Apache

2003-02-27 Thread Keith G. Murphy
Dan Brosemer wrote:
  Here's the thread to date:
  http://marc.theaimsgroup.com/?l=apache-modperlm=104586287823510w=2
 
  On Sun, Feb 23, 2003 at 10:27:22AM -0500, Dan Brosemer wrote:
 
 On Sun, Feb 23, 2003 at 04:35:39AM -0800, Ask Bjoern Hansen wrote:
 
 Hi.  I'm new here, and hoping someone can help me.  I've installed the
 latest -current version of OpenBSD, and loaded mod_perl as a DSO.
That gets
 me Apache 1.3.27, Perl 5.8.0, and mod_perl 1.27.
 
 
  The plot thickens.  Loading mod_perl statically gets rid of this 
problem.
  Even with otherwise-identical configure arguments.
 
  Yet, the DSO mod_perl works fine except when I preload DBI.
 
  I'm _quite_ confused.  I'd really like the DSO method to work, as then I
  wouldn't have to modify the OpenBSD source tree (any more than I 
normally
  do, anyway).  Does anyone have suggestions?
 
This sounds kind of similar to some problems I had on Debian.  Try a
groups.google.com search for author of 'Keith G. Murphy' and subject of
Memory leak on reload when the 'Pg' driver is preloaded or even
Apache segfaulting upon perl module load.

I gave up on it quite some time ago and started using the statically
linked mod_perl.




Re: Preloading DBI crashes Apache

2003-02-26 Thread [EMAIL PROTECTED]
On Wed, Feb 26, 2003 at 01:09:46AM -0500, Dan Brosemer wrote:
 Here's the thread to date:
 http://marc.theaimsgroup.com/?l=apache-modperlm=104586287823510w=2
helo;
I am seeing problems with mod_perl in OpenBSD 3.2 
chroot env. This has me twiddling my thumbs after tailing my 
error_log:) Anyways it is obviously something to do with 
the chroot. If I start apache with httpd -u (non-chrooted dso)
Then everything works fine. To test I try a simple mod_perl 
module, as well as try the env cgi tests in /cgi-bin .
Then when I chroot the mod_perl simple test works however
any /cgi-bin .pl or .cgi do not work. The chroot / is /var/www
whereas the /cgi-bin is /var/www/cgi-bin 
Did you find something occuring like that as well? 
Maybe it something obvious that I staring @ but I don't see
it and would appreciate a clue stick. (If one is handy.) ;-)

Best Regards,
[EMAIL PROTECTED]

-- 
/*  Security is a work in progress - dreamwvr */
# 
# Note: To begin Journey type man afterboot,man help,man hier[.]  
# 
// Who's Afraid of Schrodinger's Cat? /var/(.)?mail/me \?  ;-]


Re: Preloading DBI crashes Apache

2003-02-26 Thread Dan Brosemer
On Wed, Feb 26, 2003 at 11:45:32AM -0700, [EMAIL PROTECTED] wrote:
 On Wed, Feb 26, 2003 at 01:09:46AM -0500, Dan Brosemer wrote:
  Here's the thread to date:
  http://marc.theaimsgroup.com/?l=apache-modperlm=104586287823510w=2
 helo;
 I am seeing problems with mod_perl in OpenBSD 3.2 
 chroot env. This has me twiddling my thumbs after tailing my 
 error_log:) Anyways it is obviously something to do with 
 the chroot. If I start apache with httpd -u (non-chrooted dso)
 Then everything works fine. To test I try a simple mod_perl 
 module, as well as try the env cgi tests in /cgi-bin .
 Then when I chroot the mod_perl simple test works however
 any /cgi-bin .pl or .cgi do not work. The chroot / is /var/www
 whereas the /cgi-bin is /var/www/cgi-bin 
 Did you find something occuring like that as well? 
 Maybe it something obvious that I staring @ but I don't see
 it and would appreciate a clue stick. (If one is handy.) ;-)

This is not the problem I'm seeing at all.  You'll note from this thread
http://monkey.org/openbsd/archive/misc/0302/msg01943.html
that I see this same problem when using the sources from apache.org (no
chroot available to be a problem).

It seems related to compiling mod_perl as DSO and nothing else.

To correct the problem you're seeing, I found it useful to make
/var/www/var/www a symlink to /

This simplifies a lot of things with the loss of only a little elegance.

HTH.

-Dan

-- 
Burnished gallows set with red
 Caress the fevered, empty mind
 Of man who hangs bloodied and blind
 To reach for wisdom, not for bread.  -- Deoridhe Grimsdaughter


Re: Preloading DBI crashes Apache

2003-02-26 Thread [EMAIL PROTECTED]
On Wed, Feb 26, 2003 at 02:05:24PM -0500, Dan Brosemer wrote:
 This is not the problem I'm seeing at all.  You'll note from this thread
 http://monkey.org/openbsd/archive/misc/0302/msg01943.html
 that I see this same problem when using the sources from apache.org (no
 chroot available to be a problem).
 
 It seems related to compiling mod_perl as DSO and nothing else.
 
 To correct the problem you're seeing, I found it useful to make
 /var/www/var/www a symlink to /
tried it. It did not work. What happens is the same /var/www/cgi-bin
is used by httpd when in chroot or not. The error is the notorious 
Premature end of Script headers.. Which occurs only in chroot env.
chown to www.www doesn't make any diff  the chmod will be the same.
Appreciate the solution although it didn't work for me. 
before I forget for this wanting to apache in chroot w/startup.pl 

Here is a snippit for those using startup.pl in chroot that works ..

#!/usr/bin/perl

#modify the include path before we do anything
BEGIN {
 
  use Apache ();
  use lib Apache-server_root_relative('/lib/perl');
  ## Note: 
  # in chroot env server_root_relative is absolute from chroot /
  ##
}

I am starting to think it is not too practical running apache chrooted
at this time. I had thought that once the libs were in place etc
everything would work exactly the same. ;-}
Well off to parse the dso stuff. I might be real sorry I sed that;-)

Best Regards,
[EMAIL PROTECTED]

-- 
/*  Security is a work in progress - dreamwvr */
# 
# Note: To begin Journey type man afterboot,man help,man hier[.]  
# 
// Who's Afraid of Schrodinger's Cat? /var/(.)?mail/me \?  ;-]


Re: Preloading DBI crashes Apache

2003-02-25 Thread Dan Brosemer
Here's the thread to date:
http://marc.theaimsgroup.com/?l=apache-modperlm=104586287823510w=2

On Sun, Feb 23, 2003 at 10:27:22AM -0500, Dan Brosemer wrote:
 On Sun, Feb 23, 2003 at 04:35:39AM -0800, Ask Bjoern Hansen wrote:
   Hi.  I'm new here, and hoping someone can help me.  I've installed the
   latest -current version of OpenBSD, and loaded mod_perl as a DSO.  That gets
   me Apache 1.3.27, Perl 5.8.0, and mod_perl 1.27.

The plot thickens.  Loading mod_perl statically gets rid of this problem.
Even with otherwise-identical configure arguments.

Yet, the DSO mod_perl works fine except when I preload DBI.

I'm _quite_ confused.  I'd really like the DSO method to work, as then I
wouldn't have to modify the OpenBSD source tree (any more than I normally
do, anyway).  Does anyone have suggestions?

Even pointers for where in the code to look would be much appreciated.

TIA.

-Dan

-- 
Burnished gallows set with red
 Caress the fevered, empty mind
 Of man who hangs bloodied and blind
 To reach for wisdom, not for bread.  -- Deoridhe Grimsdaughter


Re: Preloading DBI crashes Apache

2003-02-23 Thread Ask Bjoern Hansen
On Fri, 21 Feb 2003, Dan Brosemer wrote:

 Hi.  I'm new here, and hoping someone can help me.  I've installed the
 latest -current version of OpenBSD, and loaded mod_perl as a DSO.  That gets
 me Apache 1.3.27, Perl 5.8.0, and mod_perl 1.27.
[...]
 These are taken using DBD::mysql.  I'd be happy to provide backtraces using
 other modules if they'd be useful to someone debugging.
[...]

A backtrace with DBD::mysqlPP would be fun.

Have you upgraded mysql after you last installed DBD::mysql?  Did
DBD::mysql pass all tests when you installed it?


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Preloading DBI crashes Apache

2003-02-23 Thread Dan Brosemer
On Sun, Feb 23, 2003 at 04:35:39AM -0800, Ask Bjoern Hansen wrote:
 On Fri, 21 Feb 2003, Dan Brosemer wrote:
  Hi.  I'm new here, and hoping someone can help me.  I've installed the
  latest -current version of OpenBSD, and loaded mod_perl as a DSO.  That gets
  me Apache 1.3.27, Perl 5.8.0, and mod_perl 1.27.
 [...]
  These are taken using DBD::mysql.  I'd be happy to provide backtraces using
  other modules if they'd be useful to someone debugging.
 [...]
 
 A backtrace with DBD::mysqlPP would be fun.

You're right, it _is_ fun... :)

(gdb) bt
#0  0x403ea000 in ?? ()
#1  0x40380041 in Perl_runops_standard ()
#2  0x403627d0 in Perl_call_sv ()
#3  0x4036255a in Perl_call_sv ()
#4  0x402b4ada in perl_call_handler (sv=0x28615c, r=0x6c5034, args=0x0) at 
mod_perl.c:1658
#5  0x402b3e8d in perl_run_stacked_handlers (hook=0x402af439 PerlHandler, 
r=0x6c5034, handlers=0x283b9c) at mod_perl.c:1371
#6  0x402b1a2b in perl_handler (r=0x6c5034) at mod_perl.c:897
#7  0x49ca1 in ap_invoke_handler (r=0x6c5034) at http_config.c:520
#8  0x69d4c in process_request_internal (r=0x6c5034) at http_request.c:1308
#9  0x69db6 in ap_process_request (r=0x6c5034) at http_request.c:1324
#10 0x5c88b in child_main (child_num_arg=0) at http_main.c:4708
#11 0x5cab1 in make_child (s=0xd3034, slot=0, now=1046013324) at http_main.c:4832
#12 0x5cc2a in startup_children (number_to_start=20) at http_main.c:4914
#13 0x5d8a4 in standalone_main (argc=2, argv=0xcfbfdb04) at http_main.c:5272
#14 0x5e298 in main (argc=2, argv=0xcfbfdb04) at http_main.c:5639

It won't even tell me what file it died in there... #0 seems to have no .so
associated with it.

 Have you upgraded mysql after you last installed DBD::mysql?  Did

No.  This is the initial version of both mysql and postgresql.

 DBD::mysql pass all tests when you installed it?

When I 'make test', Msql-Mysql-modules-1.2219 reports:
All tests successful, 1 test and 14 subtests skipped.

Since my test program runs fine outside of a webserver, or in mod_perl when
DBI isn't preloaded, I'm not surprised.

Wouldn't that imply that the problem is in DBI's clone function?  I've been
staring at _clone_dbis() and related functions for three days now, to no
avail, though, so I'm probably wrong. :)

Thanks for your help.

-Dan

-- 
Burnished gallows set with red
 Caress the fevered, empty mind
 Of man who hangs bloodied and blind
 To reach for wisdom, not for bread.  -- Deoridhe Grimsdaughter


Re: Preloading DBI crashes Apache

2003-02-23 Thread Dr. Helmut Zeilinger
Hi Dan,

i had a similar problem with DBI. Did you reinstall (recompile) the
DBI module after you installed Perl 5.80 from a previous Perl version (and 
maybe all DBD drivers)?

Helmut

--On Friday, February 21, 2003 16:28:19 -0500 Dan Brosemer 
[EMAIL PROTECTED] wrote:

Hi.  I'm new here, and hoping someone can help me.  I've installed the
latest -current version of OpenBSD, and loaded mod_perl as a DSO.  That
gets me Apache 1.3.27, Perl 5.8.0, and mod_perl 1.27.
Apache starts fine, but when I try to access any script that does
DBI-connect(...), it generates a segfault:
[Thu Feb 20 14:52:09 2003] [notice] child pid 29135 exit signal
Segmentation fault (11)
This happens with DBI versions 1.28, 1.30, and 1.32.  It happens when DBI
is in Pure Perl mode or in XS mode with DBD::mysql, DBD::mysqlPP,
DBD::Pg, and DBD::PgPP.
It only happens when DBI is pulled in at server startup, though.  Either
through 'PerlModule DBI' or 'perlrequire startup.perl' and 'use DBI' in
startup.perl.  I can load other modules (like CGI.pm) at server startup
just fine.
The same thing happens if I use 'PerlModule SomethingElse' where
SomethingElse has a 'use DBI' in it.
I'm at my wit's end, so any help would be greatly appreciated.  I've
pased a backtrace from 'httpd -X' and the script I've been using to test.
Thanks in advance for any help.

-Dan


These are taken using DBD::mysql.  I'd be happy to provide backtraces
using other modules if they'd be useful to someone debugging.
before loading sharedlibrary symbols:

(gdb) bt
# 0  0x403ea000 in ?? () from
# /usr/local/libdata/perl5/site_perl/i386-openbsd/auto/DBD/mysql/mysql.so
# 1  0x40337fe5 in ?? () from /usr/lib/libperl.so.8.0
# 2  0x40380041 in ?? () from /usr/lib/libperl.so.8.0
# 3  0x403627d0 in ?? () from /usr/lib/libperl.so.8.0
# 4  0x4036255a in ?? () from /usr/lib/libperl.so.8.0
# 5  0x402b4ada in ?? () from /usr/lib/apache/modules/mod_perl.so
# 6  0x402b3e8d in ?? () from /usr/lib/apache/modules/mod_perl.so
# 7  0x402b1a2b in ?? () from /usr/lib/apache/modules/mod_perl.so
# 8  0x49ca1 in ap_invoke_handler (r=0x6c5034) at http_config.c:520
# 9  0x69d4c in process_request_internal (r=0x6c5034) at
# http_request.c:1308 10 0x69db6 in ap_process_request (r=0x6c5034) at
# http_request.c:1324 11 0x5c88b in child_main (child_num_arg=0) at
# http_main.c:4708
# 12 0x5cab1 in make_child (s=0xd3034, slot=0, now=1045861707) at
# http_main.c:4832 13 0x5cc2a in startup_children (number_to_start=20) at
# http_main.c:4914 14 0x5d8a4 in standalone_main (argc=2, argv=0xcfbfd838)
# at http_main.c:5272 15 0x5e298 in main (argc=2, argv=0xcfbfd838) at
# http_main.c:5639
and after

(gdb) bt
# 0  0x403ea000 in end ()
# 1  0x403f5d1d in boot_DBD__mysql (cv=0x704354) at mysql.xsi:18
# 2  0x40337fe5 in Perl_pp_entersub ()
# 3  0x40380041 in Perl_runops_standard ()
# 4  0x403627d0 in Perl_call_sv ()
# 5  0x4036255a in Perl_call_sv ()
# 6  0x402b4ada in perl_call_handler (sv=0x28615c, r=0x6c5034, args=0x0)
# at mod_perl.c:1658 7  0x402b3e8d in perl_run_stacked_handlers
# (hook=0x402af439 PerlHandler, r=0x6c5034, handlers=0x284b9c) at
# mod_perl.c:1371 8  0x402b1a2b in perl_handler (r=0x6c5034) at
# mod_perl.c:897
# 9  0x49ca1 in ap_invoke_handler (r=0x6c5034) at http_config.c:520
# 10 0x69d4c in process_request_internal (r=0x6c5034) at
# http_request.c:1308 11 0x69db6 in ap_process_request (r=0x6c5034) at
# http_request.c:1324 12 0x5c88b in child_main (child_num_arg=0) at
# http_main.c:4708
# 13 0x5cab1 in make_child (s=0xd3034, slot=0, now=1045861707) at
# http_main.c:4832 14 0x5cc2a in startup_children (number_to_start=20) at
# http_main.c:4914 15 0x5d8a4 in standalone_main (argc=2, argv=0xcfbfd838)
# at http_main.c:5272 16 0x5e298 in main (argc=2, argv=0xcfbfd838) at
# http_main.c:5639

# !/usr/bin/perl -w
use CGI;
use DBI;
use lib '/var/www/localsettings';
use Settings;
my $cgi = new CGI;
my $dbh = DBI-connect(Settings::dbconnect);
print $cgi-header;

print EOT;
htmlheadtitlefoo/titlebodyConnected/body/html
EOT
exit 0;

--
Burnished gallows set with red
 Caress the fevered, empty mind
 Of man who hangs bloodied and blind
 To reach for wisdom, not for bread.  -- Deoridhe Grimsdaughter




Re: Preloading DBI crashes Apache

2003-02-23 Thread Dan Brosemer
On Sun, Feb 23, 2003 at 04:26:51PM +0100, Dr. Helmut Zeilinger wrote:
 Hi Dan,
 
 i had a similar problem with DBI. Did you reinstall (recompile) the
 DBI module after you installed Perl 5.80 from a previous Perl version (and 
 maybe all DBD drivers)?

No.  This was a fresh install of OpenBSD 3.3-beta (-current) which comes
with Perl 5.8.0 and I added mysql, DBI, DBD::*, and mod_perl after the fact.

So there was no previous Perl version to have DBI compiled for and lying
around.

Thanks.

-Dan

-- 
Burnished gallows set with red
 Caress the fevered, empty mind
 Of man who hangs bloodied and blind
 To reach for wisdom, not for bread.  -- Deoridhe Grimsdaughter