The following reply was made to PR mod_jserv/5420; it has been noted by GNATS.
From: Thierry Delaitre <[EMAIL PROTECTED]>
To: Ed Korthof <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: Re: mod_jserv/5420: Segmentation Fault
Date: Fri, 10 Dec 1999 18:32:28 +0000 (GMT)
On Thu, 9 Dec 1999, Ed Korthof wrote:
> This is interesting. It does look like the compiler may be doing
> something wrong ... or an intialization function is corrupting some
> memory. Here's two things you can try:
>
> First, compile this program and run it; see what the output is:
>
> ******
> #include <stdio.h>
> #include <stdlib.h>
>
> typedef struct test_struct { const char *name; } test_struct;
>
> test_struct test = { __FILE__ };
>
> int main() {
> fprintf (stderr, "file is: %s\n", test.name);
> }
> ******
>
> This would test to see if the __FILE__ macro is working correctly all by
> itself ... if not, that'd explain the problem. I'd guess that it'll work.
The little program works ok.
> Another thing to test would involve running your httpd w/ gdb, and setting
> a break point in the add_named_module command, and taking a look at the
> jserv_module structure right after it's loaded. This is easier with extra
> debugging information -- add '-g' to your CFLAGS (or EXTRA_CFLAGS) and
> recompile Apache... I've shown a transcript of how this might be done:
>
> *****
> stratus:~/projects/t/httpd> gdb bin/httpd
> GNU gdb 4.17
> Copyright 1998 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 "i586-slackware-linux"...
> (gdb) set args -X -f /home/ed/projects/t/httpd/conf/httpd.conf
> (gdb) b ap_os_dso_load
> Breakpoint 1 at 0x808f35b: file os.c, line 117.
> (gdb) run
> Starting program: /home/ed/projects/t/httpd/bin/httpd -X -f
> /home/ed/projects/t/httpd/conf/httpd.conf
> mesg: /dev/ttya1: Operation not permitted
>
> Breakpoint 1, ap_os_dso_load (
> path=0x80dd684 "/home/ed/projects/t/httpd/libexec/mod_jserv.so")
> at os.c:117
> 117 return dlopen(path, RTLD_NOW | RTLD_GLOBAL);
> (gdb) n
> 119 }
> (gdb) p jserv_module
> $1 = {version = 19990320, minor_version = 6, module_index = -1,
> name = 0x400e8337 "mod_jserv.c", dynamic_load_handle = 0x0, next = 0x0,
> magic = 1095774515, init = 0x400df2b4 <jserv_init>, create_dir_config = 0,
> merge_dir_config = 0,
> create_server_config = 0x400dde78 <jserv_server_config_create>,
> merge_server_config = 0x400ddf4c <jserv_server_config_merge>,
> cmds = 0x400ed42c, handlers = 0x400ed40c,
> translate_handler = 0x400df650 <jserv_translate_handler>,
> ap_check_user_id = 0, auth_checker = 0, access_checker = 0,
> type_checker = 0x400df718 <jserv_type_match>, fixer_upper = 0, logger = 0,
> header_parser = 0, child_init = 0x400df37c <jserv_child_init>,
> child_exit = 0, post_read_request = 0}
> (gdb)
> *****
Please find the output below.
*************************
Starting program: /rhino_local/apache-internet/bin/httpd -X -f
/rhino_local/apache-internet/conf/httpd.conf
Breakpoint 1, ap_os_dso_load (
path=0xe9658 "/rhino_local/apache-internet/libexec/mod_jserv.so") at
os.c:117
117 return dlopen(path, RTLD_NOW | RTLD_GLOBAL);
(gdb) p jserv_module
No symbol "jserv_module" in current context.
(gdb) n
119 }
(gdb) p jserv_module
$6 = {version = 19990320, minor_version = 6, module_index = -1,
name = 0x5b93f0 <Address 0x5b93f0 out of bounds>, dynamic_load_handle =0x0,
next = 0x0, magic = 1095774515, init = 0x5a8cbc, create_dir_config = 0,
merge_dir_config = 0, create_server_config = 0x5a6058,
merge_server_config = 0x5a61b0, cmds = 0x5cee90, handlers = 0x5cee70,
translate_handler = 0x5a94bc, ap_check_user_id = 0, auth_checker = 0,
access_checker = 0, type_checker = 0x5a965c, fixer_upper = 0, logger =0,
header_parser = 0, child_init = 0x5a8e30, child_exit = 0,post_read_request =
0}
(gdb)
*************************
> Note that if you have other DSO modules, you should continue until you're
> loading the jserv DSO.
>
> The question is simply what the structure of the jserv_module looks like
> -- again, i want to see if the name element has a valid value. If it
> doesn't, then there's a problem in your version of gcc -- and you should
> move back to a previous version (2.7.2 works). If it does have a good
> value, then there's a bug somewhere in our initialization.
>
> If you could try these tests, I'd appreciate it.
Thanks for your time !
Thierry.