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

Re: apr_off_t is of an ambiguous size.

From: Ben Reser <ben_at_reser.org>
Date: 2004-01-18 03:10:54 CET

On Sat, Jan 17, 2004 at 06:08:29PM -0500, Greg Hudson wrote:
> I think I'd rather we just hide our heads in the sand and assume that
> svn_offset_t is at least as big as apr_off_t. If we ever run into
> 128-bit apr_off_t values and people want to use >64-bit offsets, we're
> in more trouble than we can really solve with a bounds check here.

But we already know that this isn't true. Out of the box on 32-bit
archs running Linux apr_off_t is going to be a 32-bit int. svn_offset_t
is 64-bits on all platforms.

Anybody who tries to use such a platform for a file larger than 2
gigabytes could encouter undefined behavior due to the difference
between apr_off_t and svn_offset_t. A 2 gigabyte file is not
unrealistic, so if it happens we should produce an error rather than
having undefined behavior.

Obviously the only solution for those people will be to rebuild their
APR with a 64-bit apr_off_t. So in this situation this person will
receive an error message which they can track down and realize they need
to rebuild APR appropriately. If we stick our heads in the sand we'll
have bizzare behavior without an error message.

Sure a 128-bit apr_off_t would be a problem, but an edge case that's not
likely to happen. A 64-bit off_t supports files up to 8 exabytes. I
have to doubt that subversion is going to run reliably for anything that
big. Can BDB even scale that big? I kinda doubt there's a database
available to us that can handle that.

At this point I don't think anyone is going to attempt to put even a
single exabyte file into subversion. But I do suspect we'll have people
looking to put multiple gigabyte files into it. I seem to recall
someone discussing storing disk images in subversion at one point.

Let's solve the problems we've got today. If and when we see 128-bit
apr_off_t's we can worry about them then.

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 18 03:11:30 2004

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.