[darcs-devel] [issue1746] reading files it should not

Kevin Quick bugs at darcs.net
Thu Feb 18 19:01:37 UTC 2010


New submission from Kevin Quick <quick at sparq.org>:

I caught newer darcs wasting time reading files it should be ignoring.  
In worst-case scenarios this causes it to fail by running out of 
memory.  I discovered this because I happened to copy a couple of very 
large datafiles into my working tree.

$ cd [some-large-darcs-repo]
$ darcs-2.0.2 -v
2.0.2 (release)
$ darcs.net -v
2.3.1 (+ 468 patches)
$ darcs show repo
          Type: darcs
        Format: hashed
      Pristine: HashedPristine
   Num Patches: 3491
$ darcs show files | wc -l
5053
$

The darcs.net is up-to-date as of today, 18 Feb 2010.

$ time darcs-2.0.2 w -l
M filea
M fileb

real    1m10.187s
user    0m31.342s
sys     0m6.154s
$ time darcs.net w -l
M filea
M fileb

real    0m53.732s
user    0m33.392s
sys     0m1.899s

And now to create the problem:

$ dd if=/dev/zero of=datafile1 bs=1024 count=1750000
[creates a 1.7GB file]
$ dd if=/dev/zero of=datafile2 bs=1024 count=1750000

$ time darcs-2.0.2 w -l
M filea
M fileb
a ./datafile1                                                        
a ./datafile2
                                                                     
real    1m4.777s
user    0m31.536s
sys     0m5.669s


Old darcs noticed the new files but other than that, it clearly didn't 
waste any time on them.  Not so with new darcs:

$ time darcs.net w -l
darcs: out of memory (requested 1808793600 bytes)

real    1m42.485s
user    0m8.956s
sys     0m28.924s

Trail of darcs.net --exact-version:

Compiled with:

HTTP-4000.0.9
array-0.2.0.0
base-4.1.0.0
bytestring-0.9.1.4
containers-0.2.0.1
directory-1.0.0.3
extensible-exceptions-0.1.1.0
filepath-1.1.0.2
hashed-storage-0.4.7
haskeline-0.6.2.2
html-1.0.1.2
mmap-0.4.1
mtl-1.1.0.2
network-2.2.1.7
old-time-1.0.0.2
parsec-3.0.1
process-1.0.1.1
random-1.0.0.1
regex-compat-0.92
terminfo-0.3.1.1
text-0.7.1.0
unix-2.3.2.0
zlib-0.5.2.0

----------
messages: 10019
nosy: darcs-devel, dmitry.kurochkin, quick
priority: bug
status: unknown
title: reading files it should not

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1746>
__________________________________


More information about the darcs-devel mailing list