You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/11/24 11:48:39 UTC
core dumps adding a new module
I wrote a module in C (spit spit) and plugged it into modules/extra
and added it to the Configuration file ahead of the mod_perl last
line.
Here's the backtrace I get when it falls over
Program received signal SIGSEGV, Segmentation fault.
0x201284f0 in strcasecmp ()
(gdb) bt
#0 0x201284f0 in strcasecmp ()
#1 0x1a9d7 in table_set (t=0xc5346c, key=0x1fa9 "PERL_CALLBACK",
val=0x16f8 "PerlHeaderParserHandler") at alloc.c:732
#2 0x22dc in perl_header_parser (r=0x44007c) at mod_perl.c:576
#3 0x22dc6 in run_method (r=0x44007c, offset=19, run_all=1)
at http_config.c:356
#4 0x22e83 in header_parse (r=0x44007c) at http_config.c:393
#5 0x25b42 in process_request_internal (r=0x44007c) at http_request.c:1055
#6 0x25d41 in process_request (r=0x44007c) at http_request.c:1134
#7 0x1da0c in child_main (child_num_arg=1) at http_main.c:2970
#8 0x1dbb6 in make_child (s=0xbe034, slot=1, now=880364428)
at http_main.c:3075
#9 0x1dc19 in startup_children (number_to_start=3) at http_main.c:3102
#10 0x1e1c8 in standalone_main (argc=3, argv=0xefbfd58c) at http_main.c:3317
#11 0x1e795 in main (argc=3, argv=0xefbfd58c) at http_main.c:3547
With gdb I find that the table cmd->vars which mod_perl is trying to
add (PERL_CALLBACK = PerlHeaderParserHandler) to, is huge..
(gdb) print t->nelts
$3 = 784669
but the table itself is only holding 1 element..
(gdb) print *elts
$7 = {key = 0x42bd3c "AddOnExtensions", val = 0x42bd4c "en fr it de html"}
which came from:
PerlSetVar AddOnExtensions "en fr it de html"
Looks like something has stomped on t->nelts in the meantime. The problem
exists even when my new module has NULL for each stage and doesn't
declare any data/functions.
Now, if I edit apache/src/modules.c and move my module below mod_perl
everything works fine. If I remove a module from modules.c, it works
ok.
Weird.
module *preloaded_modules[] = {
&core_module,
&config_log_module,
&referer_log_module,
&mime_module,
&includes_module,
&autoindex_module,
&dir_module,
&cgi_module,
&asis_module,
&action_module,
&alias_module,
&access_module,
&auth_module,
&expires_module,
/*&setenvif_module, temporarily removing this make it work, also removed from prelinked_modules */
&setclass_module,
&perl_module,
NULL
};
Ring any bells out there ?
I also just saw that adding an extra module made it work too. Is there
something magic about my chosen number of modules ?
./httpd -V
Server base version: "Apache/1.3b3-dev"
Server sub-version: "mod_perl/1.06"
Server built: Nov 24 1997 10:36:35
Server compiled with....
-D HTTPD_ROOT="/usr/local/apache"
-D HAVE_MMAP
-D USE_MMAP_FILES
-D USE_FLOCK_SERIALIZED_ACCEPT
I last synced with 1.3b3-dev on Mon, Nov 17th.
--
Rob Hartill Internet Movie Database (Ltd)
http://www.moviedatabase.com/ .. a site for sore eyes.