You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Bill Marrs <bi...@apocalypse.org> on 2003/07/21 20:31:02 UTC
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error
string not specified)
>We can see that mod_cgi bufferizes the output and sends it with
>Content-Length HTTP header (to mod_deflate). Indeed mod_perl generates
>chunked response. Finally we have the same result. I don't see any problem
>at this moment.
Well, the problem is that I get this error in my error_log:
[Mon Jul 21 14:18:55 2003] [error] 4297: ModPerl::RegistryBB: 20014:Error
string not specified yet at /var/www/perl/test.pl line 6.
Also, more important, the script seems to be terminating and/or any output
following the 'print ""' is not sent to the client as far as I can tell.
>You would probably wish to append your script with
>additional output after the empty string? Something like:
>
>#!/usr/bin/perl
>$|=1;
>print "Content-Type: text/html\n\n";
>print "hello world<P>";
># This line causes the error (?)
>print "";
>print "hello again<P>";
>---
When I do this, the mod_perl variant of the script fails to print "hello
again<P>".
mod_cgi prints everything just fine and gets no errors.
I changed my test script to print a bunch of `date`'s
http://shevek.kenyonhill.com/cgi/test.pl
http://shevek.kenyonhill.com/perl/test.pl
>It may cause a problem for chunked output if mod_deflate does not care to
>keep internal buffer and check its size when flushing...
I may not be understanding the output you sent or what you're saying, but I
still don't follow why this would be a mod_deflate bug if mod_cgi with the
same script has no problem.
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error
string not specified)
Posted by Stas Bekman <st...@stason.org>.
Bill Marrs wrote:
>
>> Please report to the list the bug id so we can document this issue for
>> those who have the same problem with older httpds. Thanks.
>
>
> OK, I've posted it.
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22259
>
> Thanks for the fix!
For the archives: This bug has been fixed in the current httpd-2.0 cvs, and
will be also in the soon to be released 2.0.48.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error
string not specified)
Posted by Bill Marrs <bi...@apocalypse.org>.
>Please report to the list the bug id so we can document this issue for
>those who have the same problem with older httpds. Thanks.
OK, I've posted it.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22259
Thanks for the fix!
-bill
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error
string not specified)
Posted by Stas Bekman <st...@stason.org>.
Bill Marrs wrote:
>
>> Try this patch:
>> [...]
>>
>> Feel free to submit this bug report and the fix to httpd-dev. Please
>> let me know if you do that, so I won't duplicate it. But I'd prefer
>> that you do it so you can make sure that it gets fixed in the next
>> release, since you need it working.
>
>
> I've just verified that your patch fixes my problem.
Great!
> I've never submitted a but report and fix to httpd-dev, but I'm willing
> to do it.
>
> How do I do it?
Open a bugzilla account and add a new bug report:
http://httpd.apache.org/bug_report.html
Please report to the list the bug id so we can document this issue for those
who have the same problem with older httpds. Thanks.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error
string not specified)
Posted by Bill Marrs <bi...@apocalypse.org>.
>Try this patch:
>[...]
>
>Feel free to submit this bug report and the fix to httpd-dev. Please let
>me know if you do that, so I won't duplicate it. But I'd prefer that you
>do it so you can make sure that it gets fixed in the next release, since
>you need it working.
I've just verified that your patch fixes my problem.
I've never submitted a but report and fix to httpd-dev, but I'm willing to
do it.
How do I do it?
-bill
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)
Posted by Slava Bizyayev <sb...@outlook.net>.
> Well, the problem is that I get this error in my error_log:
>
> [Mon Jul 21 14:18:55 2003] [error] 4297: ModPerl::RegistryBB: 20014:Error
> string not specified yet at /var/www/perl/test.pl line 6.
>
> Also, more important, the script seems to be terminating and/or any output
> following the 'print ""' is not sent to the client as far as I can tell.
This is another story! You have a problem with ModPerl::RegistryBB. HTTP log
can't help if ModPerl::RegistryBB aborts at that point. From my point of
view it is supposed to be a warning (or debug/warning) instead of the error
in ModPerl::RegistryBB, because it could be necessary sometimes to flush
empty string (for example, to overwrite the default chunking behavior of
core Apache).
Unfortunately, I can't look into the sources of Apache-2 now.
Can somebody help to patch this problem on Bill's machine first in order to
let us to go ahead with this research?
Thanks,
Slava
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error
string not specified)
Posted by Stas Bekman <st...@stason.org>.
Bill Marrs wrote:
[...]
>> You would probably wish to append your script with
>> additional output after the empty string? Something like:
>>
>> #!/usr/bin/perl
>> $|=1;
>> print "Content-Type: text/html\n\n";
>> print "hello world<P>";
>> # This line causes the error (?)
>> print "";
>> print "hello again<P>";
>> ---
>
>
> When I do this, the mod_perl variant of the script fails to print "hello
> again<P>".
>
> mod_cgi prints everything just fine and gets no errors.
>
> I changed my test script to print a bunch of `date`'s
> http://shevek.kenyonhill.com/cgi/test.pl
> http://shevek.kenyonhill.com/perl/test.pl
Sorry for getting late to this thread, this is a bug in mod_deflate. You don't
see it in mod_cgi, because mod_cgi doesn't really handle buffering and
flushing, since it just reads the data from the pipe to the process.
mod_deflate didn't follow the deflate() spec, saying that the caller shouldn't
call deflate, when there is no data to deflate. Try this patch:
Index: modules/filters/mod_deflate.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_deflate.c,v
retrieving revision 1.26.2.5
diff -u -r1.26.2.5 mod_deflate.c
--- modules/filters/mod_deflate.c 17 May 2003 18:27:43 -0000 1.26.2.5
+++ modules/filters/mod_deflate.c 5 Aug 2003 06:37:59 -0000
@@ -529,9 +529,11 @@
if (APR_BUCKET_IS_FLUSH(e)) {
apr_bucket *bkt;
- zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH);
- if (zRC != Z_OK) {
- return APR_EGENERAL;
+ if (ctx->stream.avail_in > 0) {
+ zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH);
+ if (zRC != Z_OK) {
+ return APR_EGENERAL;
+ }
}
ctx->stream.next_out = ctx->buffer;
Feel free to submit this bug report and the fix to httpd-dev. Please let me
know if you do that, so I won't duplicate it. But I'd prefer that you do it so
you can make sure that it gets fixed in the next release, since you need it
working.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com