|
/
Zope
/
Apsis
/
Pound Mailing List
/
Archive
/
2005
/
2005-09
/
Bug: segfaults in 1.9.1 due to dicky DNS (with patch)
[
SSL file redirect help wanted... / Alfonso ... ]
[
Re: Welcome to [Pound Mailing List] / ... ]
Bug: segfaults in 1.9.1 due to dicky DNS (with patch)
Tim Starling <t.starling(at)physics.unimelb.edu.au> |
2005-09-24 08:36:19 |
[ SNIP ]
|
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.
-- Tim Starling
|
|
|
Re: [Pound Mailing List] Bug: segfaults in 1.9.1 due to dicky DNS (with patch)
"Simon Matter" <simon.matter(at)ch.sauter-bc.com> |
2005-09-24 11:25:39 |
[ SNIP ]
|
> 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
From looking at the patch it's not clear to me how pound knows that it's
an apache server, won't it generate the apache error message with any non
apache webserver behind? If yes, shouldn't the error message be changed?
Simon
>
> Consider both to be public domain; feel free to incorporate them without
> attribution.
>
> -- Tim Starling
>
>
> --
> To unsubscribe send an email with subject 'unsubscribe' to pound(at)apsis.ch.
> Please contact roseg(at)apsis.ch for questions.
>
http://192.168.1.2:8080/Apsis/pound/pound_list/archive/2005/2005-09/1127543779000
>
>
|
|
|
Re: [Pound Mailing List] Bug: segfaults in 1.9.1 due to dicky DNS (with patch)
Tim Starling <t.starling(at)physics.unimelb.edu.au> |
2005-09-24 11:46:43 |
[ SNIP ]
|
Simon Matter wrote:
>>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
>>
>>
>
>From looking at the patch it's not clear to me how pound knows that it's
>an apache server, won't it generate the apache error message with any non
>apache webserver behind? If yes, shouldn't the error message be changed?
>
>
Yes, it's specific to our situation, I just threw it in for interest's
sake. You don't want to put it in the main branch.
-- Tim Starling
|
|
|
|