Bug 27525 - vhost.c:232 assertion "rv == APR_SUCCESS" failed on startssl
Summary: vhost.c:232 assertion "rv == APR_SUCCESS" failed on startssl
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.0.52
Hardware: Sun Solaris
: P3 critical (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
: 21682 28537 30901 35646 36650 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-08 21:55 UTC by 1icharp
Modified: 2008-01-28 01:52 UTC (History)
6 users (show)



Attachments
getaddrinfo(255.255.255.255) (583 bytes, text/plain)
2004-03-08 22:07 UTC, Jeff Trawick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 1icharp 2004-03-08 21:55:35 UTC
Hello,
i am trying to startssl on Sun-sparc Solaris 9 machine with Apache2.0.48
It gives the follwing error.

[Tue Mar 09 19:40:37 2004] [crit] [Tue Mar 09 19:40:37 2004] file vhost.c, line 
232, assertion "rv == APR_SUCCESS" failed
Abort - core dumped

it works fine with "start" option.
i have installed the Sun recommened Patch cluster.

Can u suggest something.

Regards,
Dheerajk.
Comment 1 Jeff Trawick 2004-03-08 22:06:12 UTC
Just to verify that we know which getaddrinfo call is failing, please try the
test program gawild.c, which I'll attach in a sec.  It *should* run like this:

[trawick@sol9 platform_test]$ gcc -Wall -o gawild gawild.c -lsocket -lnsl
[trawick@sol9 platform_test]$ ./gawild 
it worked
[trawick@sol9 platform_test]$
Comment 2 Jeff Trawick 2004-03-08 22:07:01 UTC
Created attachment 10713 [details]
getaddrinfo(255.255.255.255)
Comment 3 Jeff Trawick 2004-03-21 11:31:47 UTC
Please re-open bug when you get a chance to try attached program on the Solaris
box with the problem and report the results.  Thanks!
Comment 4 Nicolas Cohen 2004-04-28 21:26:59 UTC
I have the same problem on Solaris 9, httpd 2.0.49. I tried the program and the 
output is:
getaddrinfo->1

Any clue?
Comment 5 Jeremy Laidman 2004-05-05 05:24:50 UTC
I've run the tool on two sun sparc systems with different results.

  fwa$ ~/gawild
  it worked
  fwa$ uname -a
  SunOS fwa 5.8 Generic_108528-23 sun4u sparc SUNW,Sun-Fire-480R

  tii$ ~/gawild
  getaddrinfo->1
  fwa$ uname -a
  SunOS tii 5.8 Generic_108528-23 sun4u sparc SUNW,Sun-Fire-V210

I wouldn't expect it'd be a hardware issue.  As expected, apache runs fine on 
one of them but not the other.
Comment 6 Jeff Trawick 2004-05-05 11:32:00 UTC
In a different PR, it was suggested that it can fail when DNS is disabled but
work otherwise.  Is that possibly the case, or is there a difference in DNS
search order between the two machines?

I think we need to change APR to deal with this consistently.
Comment 7 Joe Orton 2004-05-05 13:17:52 UTC
I can't find that PR now, but yes, this is reproducible when /etc/nsswitch.conf
has "hosts: files" not the normal "hosts: files dns".
Comment 8 Arieh Markel 2004-12-09 19:18:00 UTC
(In reply to comment #0)
> Hello,
> i am trying to startssl on Sun-sparc Solaris 9 machine with Apache2.0.48
> It gives the follwing error.
> 
> [Tue Mar 09 19:40:37 2004] [crit] [Tue Mar 09 19:40:37 2004] file vhost.c, line 
> 232, assertion "rv == APR_SUCCESS" failed
> Abort - core dumped
> 
> it works fine with "start" option.
> i have installed the Sun recommened Patch cluster.
> 
> Can u suggest something.
> 
> Regards,
> Dheerajk.

(In reply to comment #7)
> I can't find that PR now, but yes, this is reproducible when /etc/nsswitch.conf
> has "hosts: files" not the normal "hosts: files dns".

I verified that it also fails when:

           hosts:     nis [NOTFOUND=return] files

It fails with:

           hosts:     files nis [NOTFOUND=return] files

It works with:

           hosts:     files dns nis [NOTFOUND=return] files
Comment 9 Joe Orton 2005-01-10 16:57:21 UTC
Someone marked this as fixed; this case should at least be handled gracefully
without an abort() so it's not really fixed.
Comment 10 K Venkatasubramaniyan 2005-01-28 13:59:22 UTC
This is a very annoying and unintuitive situation. We are using mod_ssl with
Apache 2.0.52 in Solaris 9/x86 and as we turned on the SSL it just occured and
started dumping core. We also turned off the ServerName directive hoping that it
will make it go away but still continued.

Need some graceful error message at the least.
Comment 11 Joe Orton 2005-02-25 17:50:10 UTC
*** Bug 21682 has been marked as a duplicate of this bug. ***
Comment 12 Joe Orton 2005-02-25 17:53:57 UTC
*** Bug 28537 has been marked as a duplicate of this bug. ***
Comment 13 Luis Londono 2005-06-29 21:58:05 UTC
This happens when the VirtualHost entry contains _default_.  If I change it to
an actual IP it works!
Comment 14 Joe Orton 2005-08-05 14:41:11 UTC
*** Bug 35646 has been marked as a duplicate of this bug. ***
Comment 15 Joe Orton 2005-09-14 11:21:33 UTC
*** Bug 36650 has been marked as a duplicate of this bug. ***
Comment 16 Joe Orton 2005-10-28 17:32:07 UTC
In 2.1.x the assert()s in vhost.c now fail gracefully with a configuration error
for cases where the system resolver is not configured properly.  Probably not
worth a backport to 2.0.x since it's just an error case and relatively rare.
Comment 17 Joe Orton 2006-12-11 07:31:00 UTC
*** Bug 30901 has been marked as a duplicate of this bug. ***
Comment 18 Joe Orton 2007-06-19 02:57:31 UTC
*** Bug 30901 has been marked as a duplicate of this bug. ***
Comment 19 Mick Ly 2007-11-12 05:06:50 UTC
Regardsing this issue we find that if we change _default_ in the
virtualhostsetion of http.conf to an IP Address this issue does not happen.
Where does _default_ get it's address from (dns? etx/hosts?) ?? 
Comment 20 Mick Ly 2007-11-12 05:09:07 UTC
On our server when we change _default_ to an IP Address it no longer core dumps,
where does _default_ get populated from?
Comment 21 Thomas Dehn 2008-01-17 04:15:41 UTC
This bug is indeed caused by a Solaris bug, namely by
http://bugs.opensolaris.org/view_bug.do?bug_id=4944187
which causes the getaddrinfo("255.255.255.255",...) to fail.

Bug 4944187 is scheduled to be fixed in the following forthcoming Solaris 10
patches:

125553-03 SunOS 5.10: libnsl and nfsmapid patch
125554-03 SunOS 5.10_x86: libnsl and nfsmapid patch

These two patches still have to pass the patch test cycle.
Comment 22 HWS 2008-01-28 01:52:28 UTC
Even if the behaviour of Solaris getaddrinfo must be considered faulty, apache
could easily account for this misbehaviour, since the function find_adresses
comes in two versions in srclib/apr/network_io/unix/sockaddr.c, the first
calling call_resolver and, from there, getaddrinfo; the second treating
addresses 0.0.0.0 and 255.255.255.255 specially and otherwise calling
gethostbyname or gethostbyname_r. Thus, there is an simply way to fix this:
in srclib/apr/configure, change the test address for getaddrinfo (line numbers
for httpd-2.2.8):
@@ -46266,7 +46266,7 @@
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = AF_UNSPEC;
     hints.ai_socktype = SOCK_STREAM;
-    error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
+    error = getaddrinfo("255.255.255.255", NULL, &hints, &ai);
     if (error) {
         exit(1);
     }
Then the test would fail in faulty Solaris and the second version of
find_adresses be used.