On Sun, 27 Apr 1997, Chuck Murcko wrote: > I'm not seeing this on FreeBSD 2.2.1 with nonexistent hostnames, and the > ProxyBlock directive works fine when the host is resolvable. The name > lookup simply fails and returns if the host can't be resolved. > > Does anything funny happen if you try > > nslookup this.doesnt.exist > > or > > nslookup 0 > > ??? If so, you might have a resolver problem. > > Line 356 is a memcpy() from the struct hostent returned from > proxy_host2addr() call of the found address. If for some reason the > hostent returned from gethostbyname() on a failed lookup is trash, there > could be problems. > > try changing the line > > proxy_host2addr(new->name, &hp); > > to > > if (proxy_host2addr(new->name, &hp) == NULL) > > and see if your system is happier.
I see the same problem on FreeBSD 2.1-stable. The change above does fix it. I didn't look in much depth, but the problem appears to be possible bogus info in hp if proxy_host2addr returns an error. Should probably verify that all places where it is called handle the error case properly. > > Manoj Kasichainula wrote: > > > > >Number: 491 > > >Category: mod_proxy > > >Synopsis: Segmentation fault with unresolvable ProxyBlock hostname > > >Confidential: no > > >Severity: non-critical > > >Priority: medium > > >Responsible: apache (Apache HTTP Project) > > >State: open > > >Class: sw-bug > > >Submitter-Id: apache > > >Arrival-Date: Sun Apr 27 17:00:01 1997 > > >Originator: [EMAIL PROTECTED] > > >Organization: > > apache > > >Release: 1.2b8 > > >Environment: > > Red Hat Linux 4.1 > > Linux kernel 2.0.27 > > libc 5.3.12 > > gcc 2.7.2.1 > > >Description: > > When ProxyBlock is given an unresolvable hostname, the daemon will crash. > > Here > > is a backtrace from gdb: > > #0 0x807ef37 in set_proxy_exclude (parms=0xbffff998, dummy=0x0, > > arg=0x80a5604 "this.doesnt.exist") at mod_proxy.c:356 > > #1 0x8052288 in invoke_cmd (cmd=0x809a974, parms=0xbffff998, mconfig=0x0, > > args=0xbfffd95c "") at http_config.c:580 > > #2 0x8052669 in handle_command (parms=0xbffff998, config=0x80a4634, > > l=0xbfffd940 "ProxyBlock this.doesnt.exist") at http_config.c:677 > > #3 0x80526fc in srm_command_loop (parms=0xbffff998, config=0x80a4634) > > at http_config.c:690 > > #4 0x80528c6 in process_resource_config (s=0x80a395c, > > fname=0x80a4e5c "/etc/httpd/conf/httpd.conf", p=0x80a3934, > > ptemp=0x80a5944) > > at http_config.c:770 > > #5 0x80531a9 in read_config (p=0x80a3934, ptemp=0x80a5944, > > confname=0x809f8b0 "conf/httpd.conf") at http_config.c:1081 > > #6 0x804ed2b in main (argc=1, argv=0xbffffa54) at http_main.c:2267 > > #7 0x804a48b in ___crt_dummy__ () > > >How-To-Repeat: > > Insert this into httpd.conf: > > > > ProxyBlock this.doesnt.exist > > > > This will cause the segmentation fault > > >Fix: > > The backtrace is indicating that the line causing the seg fault is: > > > > new->addr.s_addr = 0; > > (mod_proxy.c:356) > > > > This makes no sense to me (although I haven't checked out the code as > > carefully > > as I should), and have a feeling that the problem is really in the > > proxy_host2addr function call two lines above. > > >Audit-Trail: > > >Unformatted: > > -- > chuck > Chuck Murcko > The Topsail Group, West Chester PA USA > [EMAIL PROTECTED] >
