[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: ra_serf infinite loop with mod_ssl and mod_deflate

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 11 Nov 2014 12:24:17 +0000

Justin Erenkrantz <justin_at_erenkrantz.com> writes:

> On Wed, Nov 5, 2014 at 9:24 AM, Philip Martin <philip_at_codematters.co.uk> wrote:
>> Configure a server with both mod_ssl (HTTPS) and mod_deflate (HTTP
>> compression). Start a checkout and the kill the server. The client
>> goes into an infinite loop in libsvn_ra_serf/update.c:handle_fetch
>>
>> (gdb) n
>> 1147 svn_txdelta_window_t delta_window = { 0 };
>> (gdb) n
>> 1151 status = serf_bucket_read(response, 8000, &data, &len);
>> (gdb) n
>> 1152 if (SERF_BUCKET_READ_ERROR(status))
>
> What's the status code from serf_bucket_read() on line 1151? I would
> expect that the socket read should be generating a ECONNABORTED
> somewhere? -- justin

handle_fetch (request=0x7ffff3e56038, response=0x7ffff3e918b8,
    handler_baton=0x7ffff3e611e0, pool=0x7ffff3e6d028)
    at ../src/subversion/libsvn_ra_serf/update.c:1152
1152 if (SERF_BUCKET_READ_ERROR(status))
(gdb) p status
$13 = 0

At the lowest level there is an APR_EOF:

326 status = read_aggregate(bucket, requested, 1, &vec, &vecs_used);
(gdb) s
read_aggregate (bucket=0x7ffff3e92438, requested=8000, vecs_size=1,
    vecs=0x7fffffffd2b0, vecs_used=0x7fffffffd2ac)
    at buckets/aggregate_buckets.c:229
229 aggregate_context_t *ctx = bucket->data;
(gdb) n
233 *vecs_used = 0;
(gdb)
235 if (!ctx->list) {
(gdb)
236 if (ctx->hold_open) {
(gdb)
240 return APR_EOF;
(gdb)

In the deflate code this is ignored to "flush the zlib buffer":

serf_deflate_read (bucket=0x7ffff3e924b8, requested=8000, data=0x7fffffffd430,
    len=0x7fffffffd428) at buckets/deflate_buckets.c:226
226 if (SERF_BUCKET_READ_ERROR(status)) {
(gdb) p status
$8 = 70014
(gdb) n
230 if (APR_STATUS_IS_EOF(status)) {
(gdb) n
231 status = ctx->stream_status;
(gdb)
232 if (APR_STATUS_IS_EOF(status)) {
(gdb) p status
$9 = 70014
(gdb) n
237 status = APR_SUCCESS;

and later in the same function it's again ignored because the "inflation
wasn't finished":

352 status = serf_bucket_read(ctx->inflate_stream, requested, data,
(gdb) n
355 if (APR_STATUS_IS_EOF(status)) {
(gdb) p status
$10 = 70014
(gdb) n
356 status = ctx->stream_status;
(gdb)
359 if (zRC != Z_STREAM_END)
(gdb)
360 return APR_SUCCESS;

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2014-11-11 13:42:20 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.