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

Re: Bugs in 1.8.5 libsvn_subr which make 32-bit threaded svnserve sometimes hang and eat 100% cpu

From: Stefan Sperling <stsp_at_elego.de>
Date: Thu, 13 Feb 2014 13:29:25 +0100

On Thu, Feb 13, 2014 at 03:49:46PM +0400, vitalif_at_yourcmc.ru wrote:
> This patch fixes the bug which makes 32-bit svnserve hang after some period of time
> doing an infinite loop inside ensure_data_insertable() because cache->data_used becomes
> a very big value, and ensure_data_insertable() never removes entries smaller than
> cache->data_used / cache->used_entries / 8.

As per our patch submission guidelines, can you please format log messages
for your patches as described here?
http://subversion.apache.org/docs/community-guide/conventions.html#log-messages

Thanks!

> --- a/subversion/libsvn_subr/cache-membuffer.c 2014-02-12 21:42:12.483208244 +0000
> +++ b/subversion/libsvn_subr/cache-membuffer.c 2014-02-12 21:45:54.275215290 +0000
> @@ -1374,7 +1374,9 @@ membuffer_cache_set_internal(svn_membuff
> * the old spot, just re-use that space. */
> if (entry && ALIGN_VALUE(entry->size) >= size && buffer)
> {
> - cache->data_used += size - entry->size;
> + /* not "+=" because (size - entry_size) is almost always a big 32-bit
> + unsigned representation of a negative value on 32-bit platforms */
> + cache->data_used = cache->data_used + size - entry->size;
> entry->size = size;
>
> #ifdef SVN_DEBUG_CACHE_MEMBUFFER

Style nit: I believe the above comment will be much less clear when read
without its preceding context line in the diff, because the reader won't
have an obvious way of connecting the reference to "+=" to anything.

Can you try to improve the wording a bit, and write in complete sentences
with proper punctuation? Or perhaps we simply drop the comment altogether?
Received on 2014-02-13 13:30:27 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.