Download raw body.
apache-httpd broken with apr-1.7.5 under 7.7
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 {
apache-httpd broken with apr-1.7.5 under 7.7