httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <>
Subject core dumps adding a new module
Date Mon, 24 Nov 1997 10:48:39 GMT

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

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


module *preloaded_modules[] = {
  /*&setenvif_module,   temporarily removing this make it work, also removed from prelinked_modules

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"

I last synced with 1.3b3-dev on Mon, Nov 17th.

Rob Hartill                              Internet Movie Database (Ltd)   .. a site for sore eyes.

View raw message