Index | Thread | Search

From:
Mike Fischer <fischer+obsd@lavielle.com>
Subject:
Re: apache-httpd broken with apr-1.7.5 under 7.7
To:
ports@openbsd.org
Cc:
Stuart Henderson <stu@spacehopper.org>
Date:
Fri, 16 May 2025 14:39:53 +0200

Download raw body.

Thread
Thanks!

After doing a test on an OpenBSD 7.7-current arm64 VM with Apache httpd, mod_proxy, mod_proxy_fcgi SetHandler "proxy:unix:..." and PHP-FPM with >36000 requests handled without any errors I decided to upgrade the production machine to 7.7-stable (amd64).

So far I’m not seeing any problems related to this issue. I’ve done some minor stress tests with curl doing 1000 requests but no issues where seen.

Preliminary conclusions:
* Either mod_proxy_fcgi with SetHandler is not affected by the issue or its occurrence is very low.
* Possibly only mod_proxy_http is affected?
* Or communication over UNIX sockets is not affected?


Mike


> Am 15.05.2025 um 16:54 schrieb Stuart Henderson <stu@spacehopper.org>:
> 
> On 2025/05/15 16:52, Mike Fischer wrote:
>> Hi!
>> 
>> Is this issue fixed? If not, will it be fixed in -stable?
> 
> Nobody has reported whether the diff I sent out fixes it.
> 
> 
>> I’m asking because the last OpenBSD machine I need to upgrade to 7.7 makes heavy use of mod_proxy_fcgi in the form of `SetHandler "proxy:unix:…"` to call PHP-FPM. Not sure if that would be affected as it does not involve mod_proxy_http?
>> 
>> I don’t understand apr or mod_proxy code enough to draw an informed conclusion.
>> 
>> The current version apr-1.7.5p0 seems to be from December. And apache-httpd-2.4.63 was released in February (according to https://cvsweb.openbsd.org). So it seems nothing has changed yet — unless the root cause is somewhere else?
>> 
>> FWIW on two other 7.7-stable machines (amd64 and arm64), which use mod_proxy and mod_proxy_http for reverse proxies, the issue is indeed seen in the logs.
>> 
>> 
>> Thanks!
>> Mike
>> 
>>> Am 30.04.2025 um 13:26 schrieb Stuart Henderson <stu.lists@spacehopper.org>:
>>> 
>>> On 2025-04-30, Alexander HOTZ <alexander.hotz@luxmetering.lu> wrote:
>>>> Hi misc@,
>>> 
>>> moving to ports@ and CC'ing maintainer
>>> 
>>>> apache-httpd is broken under 7.7-stable in conjunction with apr-1.7.5.
>>>> 
>>>> The following messages are logged in the Apache error log when trying
>>>> to access a ProxyPass target:
>>>> 
>>>> [proxy:error] [pid 93733] (22)Invalid argument: AH00957: http: attempt 
>>>> to connect to $IP:8080 ($FQDN:8080) failed
>>>> [proxy_http:error] [pid 93733] [client $IP:42558] AH01114: HTTP: failed 
>>>> to make connection to backend: $FQDN
>>>> 
>>>> Accessing the same resource via curl works just fine.
>>>> 
>>>> Could be related to https://bz.apache.org/bugzilla/show_bug.cgi?id=69410
>>>> for which FreeBSD implemented a patch.
>>>> 
>>>> Downgrading to apr-1.7.2 fixes the issue.
>>>> The issue does not exist when using apr-1.7.5 under 7.6-stable.
>>> 
>>> That ("issue does not exist when using apr-1.7.5 under 7.6-stable")
>>> is strange...
>>> 
>>> Are you able to test whether this fixes the issue?
>>> 
>>> Index: patches/patch-poll_unix_poll_c
>>> ===================================================================
>>> RCS file: patches/patch-poll_unix_poll_c
>>> diff -N patches/patch-poll_unix_poll_c
>>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>>> +++ patches/patch-poll_unix_poll_c 30 Apr 2025 11:25:37 -0000
>>> @@ -0,0 +1,42 @@
>>> +https://bz.apache.org/bugzilla/show_bug.cgi?id=69410
>>> +https://bz.apache.org/bugzilla/attachment.cgi?id=39941&action=diff&collapsed=&headers=1&format=raw
>>> +
>>> +Index: poll/unix/poll.c
>>> +--- poll/unix/poll.c.orig
>>> ++++ poll/unix/poll.c
>>> +@@ -113,7 +113,10 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprse
>>> +     }
>>> +     num_to_poll = i;
>>> + 
>>> +-    if (timeout > 0) {
>>> ++    if (timeout < 0) {
>>> ++        timeout = -1;
>>> ++    }
>>> ++    else if (timeout > 0) {
>>> +         /* convert microseconds to milliseconds (round up) */
>>> +         timeout = (timeout + 999) / 1000;
>>> +     }
>>> +@@ -255,7 +258,10 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *p
>>> +     }
>>> + #endif
>>> + 
>>> +-    if (timeout > 0) {
>>> ++    if (timeout < 0) {
>>> ++        timeout = -1;
>>> ++    }
>>> ++    else if (timeout > 0) {
>>> +         timeout = (timeout + 999) / 1000;
>>> +     }
>>> + 
>>> +@@ -411,7 +417,10 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pol
>>> +     }
>>> + #endif
>>> + 
>>> +-    if (timeout > 0) {
>>> ++    if (timeout < 0) {
>>> ++        timeout = -1;
>>> ++    }
>>> ++    else if (timeout > 0) {
>>> +         timeout = (timeout + 999) / 1000;
>>> +     }
>>> + 
>>> Index: patches/patch-support_unix_waitio_c
>>> ===================================================================
>>> RCS file: patches/patch-support_unix_waitio_c
>>> diff -N patches/patch-support_unix_waitio_c
>>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>>> +++ patches/patch-support_unix_waitio_c 30 Apr 2025 11:25:37 -0000
>>> @@ -0,0 +1,18 @@
>>> +https://bz.apache.org/bugzilla/show_bug.cgi?id=69410
>>> +https://bz.apache.org/bugzilla/attachment.cgi?id=39941&action=diff&collapsed=&headers=1&format=raw
>>> +
>>> +Index: support/unix/waitio.c
>>> +--- support/unix/waitio.c.orig
>>> ++++ support/unix/waitio.c
>>> +@@ -46,7 +46,10 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f,
>>> +     pfd.fd     = f        ? f->filedes        : s->socketdes;
>>> +     pfd.events = for_read ? POLLIN            : POLLOUT;
>>> + 
>>> +-    if (timeout > 0) {
>>> ++    if (timeout < 0) {
>>> ++        timeout = -1;
>>> ++    }
>>> ++    else if (timeout > 0) {
>>> +         timeout = (timeout + 999) / 1000;
>>> +     }
>>> +     do {
>> 
>> 
>> 
>