You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Michael Poole <po...@graviton.subatomic.org> on 2000/04/22 23:13:37 UTC

segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

I get a segfault on the first page access to Apache (it's just a
request for / on the server).  Backtrace:

#0  0x402307db in perl_header_parser (r=0x8154e84) at mod_perl.c:1002
#1  0x8052715 in run_method (r=0x8154e84, offset=58, run_all=1)
    at http_config.c:360
#2  0x8052802 in ap_header_parse (r=0x8154e84) at http_config.c:397
#3  0x80613d5 in process_request_internal (r=0x8154e84) at http_request.c:1149
#4  0x80616ed in ap_process_request (r=0x8154e84) at http_request.c:1231
#5  0x805b099 in child_main (child_num_arg=0) at http_main.c:4177
#6  0x805b20c in make_child (s=0x809a114, slot=0, now=956437231)
    at http_main.c:4281
#7  0x805b333 in startup_children (number_to_start=5) at http_main.c:4363
#8  0x805b7dc in standalone_main (argc=2, argv=0xbffffd44) at http_main.c:4651
#9  0x805be9a in main (argc=2, argv=0xbffffd44) at http_main.c:4978

That line of mod_perl.c is "dPPDIR;"
However, r->per_dir_config is NULL, so the get_module_config() call there
ends up dereferencing a NULL pointer to generate the SEGV.

Any hints on what I'm doing wrong, or how to fix this?

Michael
(please cc me on any responses; I've just now subscribed to the list)

Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

Posted by Alan Burlison <Al...@uk.sun.com>.
Michael Poole wrote:

> In hopes that this would fix the APXS build, I tried rebuilding with
> that, but whenever the httpd tried to load the php3 or perl module, it
> would die in pthread_mutex_lock.  This was slightly odd, since php3
> would load fine when httpd was statically linked against mod_perl.
> For the time being, I'll just roll back to using static mod_perl and
> dynamic mod_ssl and php3.

No, that's what you would expect.  The problem is being caused because
perl amd mod_perl are being built to be largefile aware, whereas by
default Apache is not.  By following Doug's instructions to let mod_perl
build httpd you are building it with the same flags needed to make
perl/modperl largefile aware, so Apache too ends up being largefile
aware and all the bits then are in sync.

If you use APXS you are building Apache seperately and with the standard
config, i.e. not largefile aware, so it breaks.  If you want to use APXS
you have to build Apache to be largefile aware yourself.  On Solaris at
least the way to do this is to set CFLAGS='-D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64' in your environment before invoking the Apache
configure.

-- 
Alan Burlison

Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

Posted by Michael Poole <po...@graviton.subatomic.org>.
Doug MacEachern <do...@covalent.net> writes:

> can you see if this patch fixes the problem?  make sure you let mod_perl
> build httpd and pass USE_APACI=1 to Makefile.PL
> 
> --- Makefile.PL 2000/04/21 06:24:27     1.158
> +++ Makefile.PL 2000/04/27 22:45:30     1.160
> @@ -186,7 +186,7 @@
>  $PERL_DEBUG = "";
>  $PERL_DESTRUCT_LEVEL = "";
>  $PERL_STATIC_EXTS = "";
> -$PERL_EXTRA_CFLAGS = "";
> +$PERL_EXTRA_CFLAGS = $] >= 5.006 ? $Config{ccflags} : "";
>  $SSLCacheServerPort = 8539;
>  $SSL_BASE = ""; 
>  $Port = $ENV{HTTP_PORT} || 8529;

Yes.  Using the same Makefile.PL invocation that failed before (see my
previous email), this passes "make test."  I haven't tried running it
in my full pseudo-production environment because that also uses mod_ssl,
but the test suite checks out okay.

In hopes that this would fix the APXS build, I tried rebuilding with
that, but whenever the httpd tried to load the php3 or perl module, it
would die in pthread_mutex_lock.  This was slightly odd, since php3
would load fine when httpd was statically linked against mod_perl.
For the time being, I'll just roll back to using static mod_perl and
dynamic mod_ssl and php3.

Michael

Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

Posted by Doug MacEachern <do...@covalent.net>.
can you see if this patch fixes the problem?  make sure you let mod_perl
build httpd and pass USE_APACI=1 to Makefile.PL

--- Makefile.PL 2000/04/21 06:24:27     1.158
+++ Makefile.PL 2000/04/27 22:45:30     1.160
@@ -186,7 +186,7 @@
 $PERL_DEBUG = "";
 $PERL_DESTRUCT_LEVEL = "";
 $PERL_STATIC_EXTS = "";
-$PERL_EXTRA_CFLAGS = "";
+$PERL_EXTRA_CFLAGS = $] >= 5.006 ? $Config{ccflags} : "";
 $SSLCacheServerPort = 8539;
 $SSL_BASE = ""; 
 $Port = $ENV{HTTP_PORT} || 8529;



Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

Posted by Michael Poole <po...@graviton.subatomic.org>.
Doug MacEachern <do...@covalent.net> writes:

> > perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/sbin/apxs EVERYTHING=1
> 
> probably a long shot, but any difference if you build with USE_DSO=1
> instead of USE_APXS ?

My apologies for taking so long to reply -- it's been a busy week.

Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

Posted by Doug MacEachern <do...@covalent.net>.
> perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/sbin/apxs EVERYTHING=1

probably a long shot, but any difference if you build with USE_DSO=1
instead of USE_APXS ?


Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

Posted by Michael Poole <po...@graviton.subatomic.org>.
Doug MacEachern <do...@covalent.net> writes:

> On 22 Apr 2000, Michael Poole wrote:
> 
> > I get a segfault on the first page access to Apache (it's just a
> > request for / on the server).  Backtrace:
> ... 
> > That line of mod_perl.c is "dPPDIR;"
> > However, r->per_dir_config is NULL, so the get_module_config() call there
> > ends up dereferencing a NULL pointer to generate the SEGV.
> 
> that's stange.  what options did you give mod_perl's Makefile.PL?
> did mod_perl's 'make test' pass?
> what request is the server handling when this happens?

perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/sbin/apxs EVERYTHING=1

'make test' refused to run since it was using APXS

The server was handling "GET / HTTP/1.0" at the time (the first request
made to the server).

My "solution" to this point (suggested by Dave Mee) is to just use
APACI to link mod_perl statically into Apache.  It's worked perfectly
so far, although it is a bit kludgy.

Michael

Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12

Posted by Doug MacEachern <do...@covalent.net>.
On 22 Apr 2000, Michael Poole wrote:

> I get a segfault on the first page access to Apache (it's just a
> request for / on the server).  Backtrace:
... 
> That line of mod_perl.c is "dPPDIR;"
> However, r->per_dir_config is NULL, so the get_module_config() call there
> ends up dereferencing a NULL pointer to generate the SEGV.

that's stange.  what options did you give mod_perl's Makefile.PL?
did mod_perl's 'make test' pass?
what request is the server handling when this happens?