You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2003/01/16 06:10:46 UTC
how to gracefully resolve problems in bad filters?
Any filter must always send something down-stream, this something should
be at least an empty bucket brigade.
If the input filter doesn't send anything down the stream, apache asserts:
[Thu Jan 16 15:49:56 2003] [crit] [Thu Jan 16 15:49:56 2003] file
http_protocol.c, line 1915, assertion "!(((&(bb)->list))->next == (struct
apr_bucket *)((char *)((&(bb)->list)) - ((long) (((char *) (&(((struct
apr_bucket*)((void *)0))->link))) - ((char *) ((void *)0))))))" failed
and segfaults:
#0 0x402f58b1 in kill () from /lib/i686/libc.so.6
#1 0x402f56a8 in raise () from /lib/i686/libc.so.6
#2 0x402f6a96 in abort () from /lib/i686/libc.so.6
#3 0x080c2c5b in ap_log_assert () at log.c:716
#4 0x08097281 in ap_get_client_block () at http_protocol.c:1893
#5 0x405f5eab in mpxs_ap_get_client_block (my_perl=0x8d27968, r=0x8d6da48,
buffer=0x8be8a84, bufsiz=8192)
at
/home/stas/apache.org/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
:139
#6 0x405f6681 in XS_Apache__RequestRec_get_client_block (my_perl=0x8d27968,
cv=0x8711934) at RequestIO.xs:45
#7 0x404ca9c7 in Perl_pp_entersub (my_perl=0x8d27968) at pp_hot.c:2603
#8 0x404a7afd in Perl_runops_debug (my_perl=0x8d27968) at dump.c:1394
#9 0x404517a1 in S_call_body (my_perl=0x8d27968, myop=0xbfffefe0, is_eval=0)
at perl.c:1931
#10 0x4045134d in Perl_call_sv (my_perl=0x8d27968, sv=0x8d73d08, flags=4)
at perl.c:1849
#11 0x40410712 in modperl_callback (my_perl=0x8d27968, handler=0x8c8dac8,
p=0x8d6da10, r=0x8d6da48, s=0x8118a90, args=0x8d626b4)
at modperl_callback.c:53
#12 0x40410e05 in modperl_callback_run_handlers (idx=6, type=4, r=0x8d6da48,
c=0x0, s=0x8118a90, pconf=0x0, plog=0x0, ptemp=0x0)
at modperl_callback.c:185
...
which is not so nice. For streaming filters we could have a flag that will
be off if nothing was printed, but there is no way to know whether the
filter is implemented using the streaming api or not. More-over one can
switch APIs in the same filter. If this flag is on, we could send an empty
bb downstream.
I suppose that things similar with output filters.
I'll add a test that reproduces a problem (but commented out) and if
anybody has an idea how to handle it gracefully, please speak up.
__________________________________________________________________
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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org