logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: mod_ext_filter error
Author
stparker



Joined: 05 Jan 2007
Posts: 1
Location: Wisconsin, United States

PostPosted: Sun 10 Nov '19 1:31    Post subject: mod_ext_filter error Reply with quote

Dear Apache Lounge experts,

I have a custom input filter that I implemented using mod_ext_filter. It has been working well on server version 2.4.35 but is broken on 2.4.41. I am using the same http.conf file and nothing has changed in the server environment. I have not tested on the intervening versions.

I tested further using the "trace" filter example from the Apache Server 2.4.41 documentation with the same result.

Here is the snippet from the http.conf file:

ExtFilterDefine trace-filter mode=input \
cmd="C:/Perl64/bin/perl.exe C:/Apache24/conf/filters/trace_filter.pl"

<Location /trace>
ExtFilterOptions LogStderr
SetInputFilter trace-filter
</Location>

Here is the filter:

#!c:\perl64\bin\perl.exe
#
# Simple trace filter from Apache 2.4 mod_ext_filter documentation.
####################################################################
use strict;

open(SAVED, '>d:/trace.txt')
or die "Can't open trace.txt: $?";

while (<STDIN>) {
print SAVED $_;
print $_;
}

close (SAVED);


It works fine on 2.4.35. But on 2.4.41 the server returns a Bad Request error with the following in the error log:

[ext_filter:error] [pid xxxxx:tid xxxxx] (22)Invalid argument: [client xxx.xxx.xxx.xxx:xxxxx] AH01465: apr_file_pipe_timeout_set(child output)

I am thinking that 2.4.41 must be less forgiving about an issue in my configuration, but I'm stumped how to fix it.

Would anyone have any suggestions?

Thanks,

Steven
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 12 Nov '19 7:45    Post subject: Reply with quote

No it looks like you squeezed a bug up to the surface. It looks to be in APR 1.7.0 because I at least see the perl script run and it creates a text file when using a 2.4.41 compiled with APR 1.6.5 like I did when I tried it with 2.4.35.
Back to top
dimitry_unified



Joined: 30 Sep 2020
Posts: 3
Location: Netherlands

PostPosted: Wed 30 Sep '20 18:42    Post subject: Reply with quote

I found an Apache bug report for this issue, which was posted 2019-06-08: https://bz.apache.org/bugzilla/show_bug.cgi?id=63491

After some research it turns out that this was because the apr folks didn't merge a fix from trunk (r1809753 into the apr 1.7.x branch.

Pretty quickly, Nick Kew has merged it into 1.7.x in r1882155. So at some point this will hopefully end up in apr 1.7.1, when it is released. Smile

I hope the Apache Lounge maintainers can include this one-liner into a new binary build of Apache 2.4.46, then external filters should start working again.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Wed 30 Sep '20 19:02    Post subject: Reply with quote

What version you need to test.

A guess: VS16 Win64.

Coming days I apply the Patch to separate build, so you can test.

Steffen
Back to top
dimitry_unified



Joined: 30 Sep 2020
Posts: 3
Location: Netherlands

PostPosted: Wed 30 Sep '20 19:09    Post subject: Reply with quote

Quote:
What version you need to test.

A guess: VS16 Win64.


We originally used the VC15 ones, since we compile Apache modules against it with Visual Studio 2017.

(E.g. I started with httpd-2.4.39-win64-VC15.zip and httpd-2.4.46-win64-VC15.zip which didn't work, but I had an old httpd-2.4.37-win64-VC15.zip file lying around which worked.)

But a VS16 build would also be fine, at least for testing. If it works, I'll close the upstream Apache bug.
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Thu 01 Oct '20 10:59    Post subject: Reply with quote

Here you go.

Applied :

revision 1882155 by niq, Wed Sep 30 13:54:18 2020 UTC:
Code:
--- apr/apr/branches/1.7.x/file_io/win32/pipe.c   2017/05/23 16:25:31   1795930
+++ apr/apr/branches/1.7.x/file_io/win32/pipe.c   2020/09/30 13:54:18   1882155
@@ -76,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
                                                   apr_int32_t blocking,
                                                   apr_pool_t *p)
 {
-    return apr_file_pipe_create_pools(in, out, APR_FULL_BLOCK, p, p);
+    return apr_file_pipe_create_pools(in, out, blocking, p, p);
 }
 
 APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in,{


Last edited by admin on Fri 02 Oct '20 12:43; edited 1 time in total
Back to top
dimitry_unified



Joined: 30 Sep 2020
Posts: 3
Location: Netherlands

PostPosted: Thu 01 Oct '20 14:34    Post subject: Reply with quote

Thank you, external filtering works fine now, with this build!
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sat 03 Oct '20 13:42    Post subject: Reply with quote

New builds with the fix are available now.

Thanks! appreciate it.

Steffen
Back to top


Reply to topic   Topic: mod_ext_filter error View previous topic :: View next topic
Post new topic   Forum Index -> Apache