You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stephen Clouse <st...@theiqgroup.com> on 2002/09/13 00:43:52 UTC

mp2 directive handler segfault

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

loadmodule test somehow passes, but when I actually try to use it with one of
our modules:

stephenc@stephenc ~ $ gdb ~/bin/apache/bin/httpd 
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run -X
Starting program: /home/stephenc/bin/apache/bin/httpd -X
[New Thread 1024 (LWP 19804)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 19804)]
modperl_init (base_server=0x80b6118, p=0x80b3370) at mod_perl.c:220
220             if (MpSrvPARENT(scfg)) {
(gdb) bt
#0  modperl_init (base_server=0x80b6118, p=0x80b3370) at mod_perl.c:220
#1  0x40346a88 in modperl_run (p=0x80b3370, s=0x80b6118) at mod_perl.c:386
#2  0x40348338 in modperl_cmd_load_module (parms=0xbffff840, mconfig=0x80f4168,
	arg=0x80f6338 "IQGroup::Core::ApacheRequest") at modperl_cmd.c:320
#3  0x0807b0be in invoke_cmd (cmd=0x40429df0, parms=0xbffff840,
	mconfig=0x80f4168, args=0x80f6338 "IQGroup::Core::ApacheRequest") at
	config.c:712
#4  0x0807bca3 in ap_walk_config_sub (current=0x80f6318, parms=0xbffff840,
	section_vector=0x80efa00) at config.c:1081
#5  0x0807bd21 in ap_walk_config (current=0x80f2560, parms=0xbffff840,
	section_vector=0x80efa00) at config.c:1120
#6  0x0807c620 in ap_process_config_tree (s=0x80b6118, conftree=0x80f2560,
	p=0x80b3370, ptemp=0x80ed458) at config.c:1558
#7  0x0807e991 in main (argc=2, argv=0xbffff954) at main.c:564
#8  0x401bc3c1 in __libc_start_main () from /lib/libc.so.6
(gdb) p scfg
$1 = (modperl_config_srv_t *) 0x0

Looks like Apache isn't quite done setting up the config when that early 
modperl_init is triggered.  I'm trying to figure out what's supposed to
initialize that but I keep getting lost.

- -- 
Stephen Clouse <st...@theiqgroup.com>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9gRioA4aoazQ9p2cRAoENAJ0fy3AQbEhHS6mwyTJ/oLqiCzs1igCcDU1N
v2UQyiUImCmMkAqkncVyxro=
=FChx
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Doug MacEachern <do...@covalent.net>.
On Mon, 16 Sep 2002, Stephen Clouse wrote:
 
> On Mon, Sep 16, 2002 at 11:00:05PM -0500, Stephen Clouse wrote:
> > I'm compiling the CVS head as I write this.  Update in a moment.
> 
> Good news.  It is an ex-bug.  It has passed on.  However, a test case might
> still be in order.

great news.  no doubt the vhost without any mod_perl config is what 
triggered the bug.  test case would be nice, but real-world case (what you 
are doing) is even better.  keep us posted if directive handlers are 
working or not for you, thanks.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Stephen Clouse <st...@theiqgroup.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Sep 16, 2002 at 11:00:05PM -0500, Stephen Clouse wrote:
> I'm compiling the CVS head as I write this.  Update in a moment.

Good news.  It is an ex-bug.  It has passed on.  However, a test case might
still be in order.

- -- 
Stephen Clouse <st...@theiqgroup.com>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9hqnTA4aoazQ9p2cRAvHZAJ9Ola5qG44Ww6SDpbB0sfacs3PRPgCbBIbN
IxeWpaqFcktYZ69WZxTVNdE=
=i/Wy
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Stephen Clouse <st...@theiqgroup.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Sep 16, 2002 at 07:01:42PM -0700, Doug MacEachern wrote:
> should be fixed now (thanks for the debug info).  but i still don't have 
> an httpd.conf that produces the problem.  that'd help if you still have 
> troubles.

My httpd.conf is ugly, but I can say with relative assurance that the segfault 
is when a VirtualHost gets defined after the LoadModule.  My config (in pseudo
form) basically looks like this:

    server config
    static page VirtualHosts
    Perl*
    LoadModule Perl::Module
    mod_perl VirtualHosts

When I comment out the last set of vhosts, the server lives.

I'm compiling the CVS head as I write this.  Update in a moment.

- -- 
Stephen Clouse <st...@theiqgroup.com>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9hqjFA4aoazQ9p2cRAn15AKDVQXejRbKyMM4VtAWLVEISmdm4mwCgnItY
E6JOR9v1nFPDvkxcAGZUAqc=
=bVDh
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Doug MacEachern <do...@pobox.com>.
On Mon, 16 Sep 2002, Stephen Clouse wrote:
 
> The LoadModule position issue is gone, but I'm still hitting the second
> segfault inside of merge_server_configs.

should be fixed now (thanks for the debug info).  but i still don't have 
an httpd.conf that produces the problem.  that'd help if you still have 
troubles.
 
> My biggest question in debugging this (since I continue to get lost in Apache's
> startup sequence) is, what's supposed to initialize the module_cfg_t returned by
> modperl_module_config_(dir|srv)_create?  All they do is apr_pcalloc an empty
> structure.  Or maybe the fact that I can't figure this out *is* the problem :)

the setting of fields is somewhat delayed, until we have the parms context 
(and stuff within) that the create functions do not get passed.
 
> Oh, and one more thing...the current head won't build without MP_TRACE on,
> because modperl_init_vhost is declaring vhost inside an #ifdef MP_TRACE.  But
> you probably noticed that already.

hadn't noticed, should be fixed now.  (we really need a compile farm with 
automated builds!)




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Stephen Clouse <st...@theiqgroup.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Sep 15, 2002 at 04:25:10PM -0700, Doug MacEachern wrote:
> should be working ok now.  also resolved some other potential issues with 
> early startup if vhosts have parent interpreters, etc.

The LoadModule position issue is gone, but I'm still hitting the second
segfault inside of merge_server_configs.

stephenc@stephenc stephenc $ gdb ~/bin/apache/bin/httpd 
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run -X
Starting program: /home/stephenc/bin/apache/bin/httpd -X
[New Thread 1024 (LWP 19226)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 19226)]
modperl_module_config_srv_merge (p=0x80b3370, basev=0x86adfa8, addv=0x86aee58)
	at modperl_module.c:222
222         return modperl_module_config_merge(p, basev, addv,
(gdb) p (modperl_module_cfg_t *) basev
$1 = (modperl_module_cfg_t *) 0x86adfa8
(gdb) p *$1
$2 = {server = 0x0, minfo = 0x0}
(gdb) p (modperl_module_cfg_t *) addv
$3 = (modperl_module_cfg_t *) 0x86aee58
(gdb) p *$3
$4 = {server = 0x86ae088, minfo = 0x8100290}
(gdb) p *$3->server
$5 = {process = 0x80b13e8, next = 0x80ff170,
	defn_name = 0x80f7530 "/home/stephenc/bin/apache/conf/iqc.conf",
	defn_line_number = 3, server_admin = 0x0,
	server_hostname = 0x86ae6b8 "iqc.stephenc.theiqgroup.com",
	port = 80, error_fname = 0x0, error_log = 0x80b6188, loglevel = 7,
	is_virtual = 1, module_config = 0x86ae148, lookup_defaults = 0x86ae2a8,
	addrs = 0x86ae470, timeout = 0, keep_alive_timeout = 0,
	keep_alive_max = -1, keep_alive = -1, path = 0x0, pathlen = 0,
	names = 0x86ae0f8, wild_names = 0x86ae120, limit_req_line = 8190,
	limit_req_fieldsize = 8190, limit_req_fields = 100}
(gdb) p *$3->minfo
$6 = {dir_create = 0x81002f8, dir_merge = 0x8100398, srv_create = 0x0,
	srv_merge = 0x0, namelen = 28}

My biggest question in debugging this (since I continue to get lost in Apache's
startup sequence) is, what's supposed to initialize the module_cfg_t returned by
modperl_module_config_(dir|srv)_create?  All they do is apr_pcalloc an empty
structure.  Or maybe the fact that I can't figure this out *is* the problem :)

Oh, and one more thing...the current head won't build without MP_TRACE on,
because modperl_init_vhost is declaring vhost inside an #ifdef MP_TRACE.  But
you probably noticed that already.

- -- 
Stephen Clouse <st...@theiqgroup.com>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9hodxA4aoazQ9p2cRAh17AKC/mUP90CZfcTQbigP3+edabTfb/ACeKuxL
yTL8ON2FPFOg5BpNMb60kWE=
=WJwS
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 12 Sep 2002, Stephen Clouse wrote:
 
> You're not as far off as you think.  Moving the LoadModule directive above all
> my VirtualHosts cured the initial segfault.  Now it dies inside 
> merge_server_configs:

should be working ok now.  also resolved some other potential issues with 
early startup if vhosts have parent interpreters, etc.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Stephen Clouse <st...@theiqgroup.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Sep 12, 2002 at 08:15:08PM -0700, Doug MacEachern wrote:
> On Thu, 12 Sep 2002, Doug MacEachern wrote:
> 
> > can you provide some example config that triggers the problem?  i imagine 
> > it is related to vhosts.  perhaps a VirtualHost configured before the 
> > LoadModule?  we should support that, but in the meantime you may be able 
> > to workaround by having all LoadModules configured before any 
> > VirtualHosts.
> 
> that is already ruled out actually, the test httpd.conf has the LoadModule 
> for TestDirective::loadmodule after a VirtualHost directive.

You're not as far off as you think.  Moving the LoadModule directive above all
my VirtualHosts cured the initial segfault.  Now it dies inside 
merge_server_configs:

stephenc@stephenc ~ $ gdb ~/bin/apache/bin/httpd 
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run -X
Starting program: /home/stephenc/bin/apache/bin/httpd -X
[New Thread 1024 (LWP 28863)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 28863)]
modperl_module_config_srv_merge (p=0x80b3370, basev=0x80f90b0, addv=0x852cfe8)
at modperl_module.c:222
222         return modperl_module_config_merge(p, basev, addv,
(gdb) bt
#0  modperl_module_config_srv_merge (p=0x80b3370, basev=0x80f90b0,
	addv=0x852cfe8) at modperl_module.c:222
#1  0x0807a9dd in merge_server_configs (p=0x80b3370, base=0x80b6228,
	virt=0x852c2d8) at config.c:319
#2  0x0807c9e7 in ap_fixup_virtual_hosts (p=0x80b3370, main_server=0x80b6118) at
	config.c:1701
#3  0x0807e99b in main (argc=2, argv=0xbffff954) at main.c:565
#4  0x401bc3c1 in __libc_start_main () from /lib/libc.so.6
(gdb) p *((modperl_module_cfg_t *)basev)
$1 = {server = 0x0, minfo = 0x0}
(gdb) p *((modperl_module_cfg_t *)addv)
$2 = {server = 0x852c218, minfo = 0x80f8478}
(gdb) p $2->minfo
$3 = (modperl_module_info_t *) 0x80f8478
(gdb) p *$3
$4 = {dir_create = 0x80f84e0, dir_merge = 0x80f8580, srv_create = 0x0,
	srv_merge = 0x0, namelen = 28}

- -- 
Stephen Clouse <st...@theiqgroup.com>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9gXB/A4aoazQ9p2cRArDaAKDojL2cFepZhVmRc6iPVyYOmbteHACbBckm
pks6Ztvf4YTovIjBahbzj8w=
=7Xfw
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 12 Sep 2002, Doug MacEachern wrote:

> can you provide some example config that triggers the problem?  i imagine 
> it is related to vhosts.  perhaps a VirtualHost configured before the 
> LoadModule?  we should support that, but in the meantime you may be able 
> to workaround by having all LoadModules configured before any 
> VirtualHosts.

that is already ruled out actually, the test httpd.conf has the LoadModule 
for TestDirective::loadmodule after a VirtualHost directive.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2 directive handler segfault

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 12 Sep 2002, Stephen Clouse wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> loadmodule test somehow passes, but when I actually try to use it with one of
> our modules:

can you provide some example config that triggers the problem?  i imagine 
it is related to vhosts.  perhaps a VirtualHost configured before the 
LoadModule?  we should support that, but in the meantime you may be able 
to workaround by having all LoadModules configured before any 
VirtualHosts.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org