You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by ch...@hyperreal.com on 1997/04/11 07:49:42 UTC
Changed information for PR mod_proxy/304
Synopsis: multiple-homed Web hosts - con refused to first IP doesn't fall through to second
State-Changed-From-To: open-closed
State-Changed-By: chuck
State-Changed-When: Thu Apr 10 22:49:42 PDT 1997
State-Changed-Why:
A patch for this problem is available at
http://www.apache.org, in the patches for 1.2b8 ddirectory.
It's called mod_proxy-addr.patch
Re: Changed information for PR mod_proxy/304
Posted by Mike Pelletier <mi...@comshare.com>.
On Thu, 10 Apr 1997 chuck@hyperreal.com wrote:
> A patch for this problem is available at
> http://www.apache.org, in the patches for 1.2b8 ddirectory.
> It's called mod_proxy-addr.patch
Thanks a bunch, Chuck! I really appreciate the quick turnaround on this
problem. You've saved me from certain death at the hands of my users...
;-)
-Mike Pelletier.
Re: Changed information for PR mod_proxy/304
Posted by Mike Pelletier <mi...@comshare.com>.
On Thu, 10 Apr 1997 chuck@hyperreal.com wrote:
> Synopsis: multiple-homed Web hosts - con refused to first IP doesn't fall through to second
>
> State-Changed-From-To: open-closed
> State-Changed-By: chuck
> State-Changed-When: Thu Apr 10 22:49:42 PDT 1997
> State-Changed-Why:
> A patch for this problem is available at
> http://www.apache.org, in the patches for 1.2b8 ddirectory.
> It's called mod_proxy-addr.patch
Additionally, this patch appears to have introduced some problems with the
use of IP URLs, such as "http://130.211.50.3".
I haven't gotten together any details, but I'm suspecting that the culprit
is proxy_host2addr().
-Mike Pelletier.
Re: Changed information for PR mod_proxy/304
Posted by Mike Pelletier <mi...@comshare.com>.
On Thu, 10 Apr 1997 chuck@hyperreal.com wrote:
> Synopsis: multiple-homed Web hosts - con refused to first IP doesn't fall through to second
>
> State-Changed-From-To: open-closed
> State-Changed-By: chuck
> State-Changed-When: Thu Apr 10 22:49:42 PDT 1997
> State-Changed-Why:
> A patch for this problem is available at
> http://www.apache.org, in the patches for 1.2b8 ddirectory.
> It's called mod_proxy-addr.patch
When I do a make clean and compile with all three patches under BSD/OS 2.1
using the "shlicc" shared library compiler, and then try to run the proxy,
I get a segementation fault core dump right after the "compile time limit"
warning.
I recompiled with "-g" and the non-shared version of the "gcc" compiler,
and tried again, and the same thing happened, and here's the gdb output:
Program terminated with signal 11, Segmentation fault.
#0 0x36703 in set_cache_exclude (parms=0xefbfda2c, dummy=0x0,
arg=0x7652c "comshare.com") at mod_proxy.c:497
497 memcpy(&new->addr, hp.h_addr, sizeof(struct in_addr));
(gdb) where
#0 0x36703 in set_cache_exclude (parms=0xefbfda2c, dummy=0x0,
arg=0x7652c "comshare.com") at mod_proxy.c:497
#1 0xa6ac in invoke_cmd (cmd=0x668ac, parms=0xefbfda2c, mconfig=0x0,
args=0xefbfb9c8 "") at http_config.c:580
#2 0xaaa1 in handle_command (parms=0xefbfda2c, config=0x75b94,
l=0xefbfb9b4 "NoCache comshare.com") at http_config.c:677
#3 0xab34 in srm_command_loop (parms=0xefbfda2c, config=0x75b94)
at http_config.c:690
#4 0xad7e in process_resource_config (s=0x75034,
fname=0x7628c "/usr/local/etc/httpd/conf/httpd.conf", p=0x7500c,
ptemp=0x7800c) at http_config.c:770
#5 0xb7bd in read_config (p=0x7500c, ptemp=0x7800c,
confname=0x72404 "conf/httpd.conf") at http_config.c:1081
#6 0x5a17 in main (argc=1, argv=0xefbfdaec) at http_main.c:2267
(gdb)
The error occurs in the portion of mod_proxy.c affected by the
mod_proxy-addr.patch file.
I inserted some debugging code:
/* Don't do name lookups on things that aren't dotted */
if (strchr(arg, '.') != NULL) {
printf("calling proxy_host2addr(%s, &hp);\n", new->name);
printf("result = \"%s\"\n", proxy_host2addr(new->name, &hp));
memcpy(&new->addr, hp.h_addr, sizeof(struct in_addr));
}
And got:
calling proxy_host2addr(comshare.com, &hp);
result = "Host not found"
Segmentation fault (core dumped)
The problem is that I was under the impression that the "NoCache" config
file directive was a wildcard, and would prevent caching for any host in
the comshare.com domain. Apparently here it's being treated as a specific
host name. This worked in 1.2b7, but with the introduction of this
proxy_host2addr() call it started having a problem with the fact that
comshare.com does not have an A record.
It would appear that there needs to be some sanity checking done on the
return value of the proxy_host2addr() function call here. I'll let you
take care of that in an Apache-appropriate way, rather than sending a
patch that might not fit in with the rest of the Apache code's error
logging mechanisms.
Thanks again!
-Mike Pelletier.