You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2018/03/14 15:29:06 UTC

[Bug 62180] New: mod_xml2enc destroys error buckets

https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

            Bug ID: 62180
           Summary: mod_xml2enc destroys error buckets
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_xml2enc
          Assignee: bugs@httpd.apache.org
          Reporter: ifjpetrenyim@gmail.com
  Target Milestone: ---

Error bucket is a special kind of meta bucket that is not part of apr but added
in httpd and can be created via the ap_bucket_error_create() call. This type of
bucket is simply destroyed by mod_xml2enc.
I have created a pull request with a fix that resolves this issue:
https://github.com/apache/httpd/pull/48

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #14 from Yann Ylavic <yl...@gmail.com> ---
(In reply to Micha Lenk from comment #13)
> Yann, thanks for jumping on this so fast. I got something to test... :)
You're welcome. Fortunately you didn't test the series one by one :)

> 
> One comment about the current code in trunk (SVN r1829039), file
> modules/filters/mod_xml2enc.c line 550. Shouldn't pending_metadata get reset
> to zero within the if block?
It's a local variable and the filter is leaving at this point.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

nsg-apache-httpd-maintenance@sophos.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nsg-apache-httpd-maintenanc
                   |                            |e@sophos.com

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #5 from Micha Lenk <mi...@lenk.info> ---
Yann, is there any additional information needed from our side?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|PatchAvailable              |FixedInTrunk

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #11 from Yann Ylavic <yl...@gmail.com> ---
v5 committed in r1829038, will let it linger a bit for review before proposing
a backport to 2.4.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #4 from Eric Covener <co...@gmail.com> ---
Hi Yann, if you commit this please add "this closes #48" to the commit to close
out the github PR.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35871|0                           |1
        is obsolete|                            |

--- Comment #10 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 35872
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35872&action=edit
mod_xml2enc: pass all meta buckets down the chain (v5)

An APR_BRIGADE_CONCAT() added for safety (unlikely case where EOS is not the
latest bucket).

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #16 from Micha Lenk <mi...@lenk.info> ---
I've just tested the cherry-picked SVN revisions r1829038 and r1829039 applied
to a httpd-2.4.25 build and can confirm that this variant of the patch also
fixes our issue.

Thanks for considering to backport this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #2 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 35770
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35770&action=edit
mod_xml2enc.c: pass all meta buckets down the chain

How about passing *all* metadata buckets down the chain (and, btw, bail out on
EOS)?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #6 from Yann Ylavic <yl...@gmail.com> ---
I'd like the patch to aggregate meta buckets (besides FLUSH which can't be
retained), and then send them together either before further real data or
before leaving.
I didn't start working on this though, will try soon if you don't beat me at it
;)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Micha Lenk <mi...@lenk.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #17 from Yann Ylavic <yl...@gmail.com> ---
Thanks for testing, backport proposed in r1830524.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Micha Lenk <mi...@lenk.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |micha@lenk.info

--- Comment #1 from Micha Lenk <mi...@lenk.info> ---
Created attachment 35769
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35769&action=edit
mod_xml2enc.c (xml2enc_ffunc): do not remove error buckets

I worked with Mihaly on this issue, and he found the fix. The impact of the
error bucket getting dropped is that any failure raised by another filter
earlier in the output filter chain will get dropped. This means an entirely
broken page is delivered instead of blocking the request with a proper error
message.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35770|0                           |1
        is obsolete|                            |

--- Comment #7 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 35869
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35869&action=edit
mod_xml2enc: pass all meta buckets down the chain (v2)

Something like this maybe, does it work for you?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #13 from Micha Lenk <mi...@lenk.info> ---
Yann, thanks for jumping on this so fast. I got something to test... :)

One comment about the current code in trunk (SVN r1829039), file
modules/filters/mod_xml2enc.c line 550. Shouldn't pending_metadata get reset to
zero within the if block?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35869|0                           |1
        is obsolete|                            |

--- Comment #8 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 35870
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35870&action=edit
mod_xml2enc: pass all meta buckets down the chain (v3)

Well, better if it compiles...

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35870|0                           |1
        is obsolete|                            |

--- Comment #9 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 35871
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35871&action=edit
mod_xml2enc: pass all meta buckets down the chain (v4)

... and yet better without other work (or not) in progress.
Sorry, I need a pause :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #3 from Micha Lenk <mi...@lenk.info> ---
I've just tested your patch, and it fixes our issue with the dropped error
bucket too.

We didn't dare to do a bigger clean-up like you did, because we were not sure
what else could break by doing so. For that reason I've just run our internal
charset conversion and HTML rewriting regression test suite against a httpd
with your patch applied which flagged no issues.

From our perspective your patch is good to go.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #18 from Micha Lenk <mi...@lenk.info> ---
> Thanks for testing, backport proposed in r1830524.

The above mentioned change of the STATUS document lists another SVN revision
(r1830523). So I re-run our tests with that one applied on top. The issue
remains fixed. Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #20 from Christophe JAILLET <ch...@wanadoo.fr> ---
backported in 2.4.x in r1834104

This is part of 2.4.34

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #15 from Micha Lenk <mi...@lenk.info> ---
>> Shouldn't pending_metadata get reset to zero within the if block?
>
> It's a local variable and the filter is leaving at this point.

Right. Thanks for the explanation.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #12 from Yann Ylavic <yl...@gmail.com> ---
+ r1829039.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 62180] mod_xml2enc destroys error buckets

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62180

--- Comment #19 from Yann Ylavic <yl...@gmail.com> ---
Thanks Mika, it was more or less a cosmetic change which allowed me to close
the corresponding pull request on github (with the commit message, I missed
that on the first commits) :p

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org