X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=smHyOpsZSNlUEug1H7VypexfzeJgYzKD46V9PxgHMPK
	4BbGCIGNLlNVFD60LOaJpyelzX29Wvau3uYfisg8bLOH/J7obCYaFXdaR/wva30m
	lXEcCFHqbJIW6Uut1dAqf9cL4Wzvbd68vWylyw41xvfVunl9h/EvSTNiakLQj1NM
	=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=SooMeun7pW61WsWrFIGNvCM2x1Y=; b=d2UWx/+X0Ka37A8/f
	c3K+DQE4tL/JWWy2EEKY2jx9zHnUZsPb1OTYkiLWX9JWOxhcCWB8Zt7VKV28YOx3
	dGn2FF/8W3bL2p080GkK8r3+1QkU262mFp1x1jQo8OymSpYr4OzHrlLpx0D3HHse
	sUS+gVKSrstqSpkiYaa8g5GWms=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_NEUTRAL autolearn=ham version=3.3.2
X-HELO: bureau81.ns.utoronto.ca
Message-ID: <52555E65.1070000@cs.utoronto.ca>
Date: Wed, 09 Oct 2013 09:47:17 -0400
From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: checking in >= 256k file fatally corrupts rcs file
References: <20131008102204.GB9241@plunk.org> <525499E5.4090608@etr-usa.com>
In-Reply-To: <525499E5.4090608@etr-usa.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes

On 08/10/2013 7:48 PM, Warren Young wrote:
> On 10/8/2013 04:22, Don Hatch wrote:
>>
>> Checking in a text file of size >= 256k
>> corrupts the rcs file, irretrievably losing most of the contents
>
> It's documented in the rcs NEWS file:
>
>     - Env var RCS_MEM_LIMIT controls stdio threshold.
>
>       For speed, RCS uses memory-based routines for files up to
>       256 kilobytes, and stream-based (stdio) routines otherwise.
>       You can change this threshold value by setting the environment
>       variable ‘RCS_MEM_LIMIT’ to a non-negative integer, measured in
>       kilobytes.  An empty ‘RCS_MEM_LIMIT’ value is silently ignored.
>
> So, use the new environment variable, or build up your huge diffs a 
> few steps at a time, so as to avoid spamming this buffer.
So in other words, a misguided performance optimization [1] that almost 
certainly has little measurable impact on performance [2] has introduced 
a silent data corruption bug (or tickled a latent one somewhere else). 
Lovely.

The gcc devs have the right philosophy: features that break things badly 
get reverted immediately regardless of whose fault the bug is, and will 
be considered for re-inclusion once the bug has been fixed on the side. 
In this case, though, the I'm not sure re-inclusion is even warranted.

[1] Modern filesystems and filesystem caching are pretty darn good at 
handling temporary files these days. Further, if you really care about 
using RAM to improve performance, 256kB is an absurdly low limit for a 
buffer size, and has been for most of the last decade.

[2] I'd be shocked if even 0.1% of checkins were large enough to have a 
noticeable latency in a modern system, and even more shocked if the 0.1% 
that are large enough to be slow were still small enough that 256kB of 
buffering made any difference in their runtime. Unless the code is 
calling fsync() after every newline or something, in which case that's 
what needs to be fixed.

$0.02
Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

