Hi,
I'm a system administrator from Wikipedia. We've been interested in
pound for a while, since our tests indicate that it's vastly faster for
small files than perlbal, which is the non-caching reverse proxy we've
been using for a while. However, when I tried to put it into production,
as soon as the load got high enough, the worker process would start
segfaulting, once every few seconds.
With a bit of help from gdb I found the problem. On our system, for
whatever reason, gethostbyname would occasionally return successfully,
but with an empty list in h_addr_list, i.e. h_addr_list[0] was NULL.
Thus this code from is_be():
if((he = gethostbyname(host)) == NULL)
return 0;
memcpy(&addr.sin_addr.s_addr, he->h_addr_list[0],
sizeof(addr.sin_addr.s_addr));
Would segfault in memcpy. There were a few instances of similar code, I
fixed them all and made a patch:
http://wikimedia.org/~tstarling/pound/gethostbyname-bugfix.patch
At no extra charge, you can also have my patch to give more useful log
entries when apache segfaults and returns no headers:
http://wikimedia.org/~tstarling/pound/segfault-log.patch
Consider both to be public domain; feel free to incorporate them without
attribution.
[...]
|