diff problem

Alistair Bell alistair at bellsonline.com
Tue Dec 8 12:20:42 CST 2009


Hi Tim et al,

I had a similar problem recently, and I tracked it down to a stack
overflow in the diff code. (This was using Mercurial 1.3.1, 64-bit
Linux and GCC 3.4.6.) I think the developer of the diff code assumed
that the compiler would optimize tail-recursion, and for some reason
it didn't. I switched the code over to use iteration rather than
tail-recursion and it worked great after that.

I'll post a patch on mercurial-devel.

Alistair

--- Original Message ---
Hi,
I recently attempted to commit a 5.3 MB file with 5.7 MB worth of
changes to its most recent revision (which was 5.1 MB in size). The
commit failed and as I further investigated the cause I discovered that
hg diff also fails after about 40 seconds by simply exiting without
giving an error message. If I simply delete half of the new file for
testing purposes the diff succeeds. The exact file size at which it
fails seems to vary though so it doesn't seem like a problem with the
file content.
I found this message on the mercurial list
http://marc.info/?l=mercurial&m=117499200905031&w=2 but am unsure
whether lack of memory if the cause of my problem as the file sizes do
not seem excessive (especially compared to the sizes that other folks on
the list mention having problems with) and I am able to get a diff from
the diff program as well as kdiff3 and meld.
I would appreciate any thoughts or insight,
Sincerely,
Tim


More information about the Mercurial mailing list