Le 12/12/2018 à 20:43, PiBa-NL a écrit :
Hi Christopher,

Op 12-12-2018 om 13:49 schreef Christopher Faulet:
Le 12/12/2018 à 12:07, Pi Ba a écrit :
Found the issue on the 10th (I think commit 56b0348).. so yesterday's
commit isn't the (only) problem.. tested with commit 0007d0a the
issue also happens. Reverting only below mentioned commit I can't
easily do atm. I'll check more closely this evening.


Hum, I don't understand, the commit 56b0348 fixes a bug in the H2
multiplexer. you don't use it in your test-case. It should be totally
unrelated.

It wasn't that specific commit that broke my test, its just that i
picked that one because i could... It just that was they day i started
to try 1.9-X on my production environment..

Having spend a bit more time checking/compiling various commits i found
that this is the commit that 'broke' the testcase that was attached
(some of the contents is misplaced/repeated..):
http://git.haproxy.org/?p=haproxy.git;a=commit;h=d247be0620c35ea0a43074fd88c6a520629c1823

p.s. I also send you off-list the full output of the test with the added
configuration options: filter trace name BEFORE / filter compression /
filter trace name AFTER .. (resulting in a 90MB log..)


Hi Pieter,

I've finally found a way to reproduce the bug. I must use a bigger file (10 MB) to hit it. The commit d247be06 reveals the bug but it was introduced by the commit d54a8ceb ("MAJOR: start to change buffer API"). Could you tests the attached patch ? I'm pretty sure it fixes the bug. But, a confirmation is always welcome.

Many thanks for you help !
--
Christopher
>From 91e5c2a0e5bc5985fa89e87043b11ad19c7c5469 Mon Sep 17 00:00:00 2001
From: Christopher Faulet <[email protected]>
Date: Mon, 17 Dec 2018 12:02:57 +0100
Subject: [PATCH] BUG/MEDIUM: compression: Use the right buffer pointers to
 compress input data

A bug was introduced when the buffers API was refactored. It was when wrapping
input data were compressed. the pointer b_peek(in, 0) was used instead of
"b_orig(in)". b_peek(in, 0) is in fact the same as b_head(in).
---
 src/flt_http_comp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index 017080961..487305605 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -1074,10 +1074,10 @@ http_compression_buffer_add_data(struct comp_state *st, struct buffer *in,
 	block2 = data_process_len - block1;
 
 	/* compressors return < 0 upon error or the amount of bytes read */
-	consumed_data = st->comp_algo->add_data(st->comp_ctx, b_head(in) + in_out, block1, out);
+	consumed_data = st->comp_algo->add_data(st->comp_ctx, b_peek(in, in_out), block1, out);
 	if (consumed_data != block1 || !block2)
 		goto end;
-	consumed_data = st->comp_algo->add_data(st->comp_ctx, b_peek(in, 0), block2, out);
+	consumed_data = st->comp_algo->add_data(st->comp_ctx, b_orig(in), block2, out);
 	if (consumed_data < 0)
 		goto end;
 	consumed_data += block1;
-- 
2.19.2

Reply via email to