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

svn client fails with Berkeley DB error Cannot allocate memory - repository broken

From: Martin J. Evans <martin.evans_at_easysoft.com>
Date: 2004-06-03 19:42:50 CEST

Hi subversion developers,

I've posted this problem to the users list and although I've had some
suggestions I am stuck with what looks like a serious bug in subversion.

The basic problem I'm seeing is I have a small perl script which when run using
a HTTP (remotely) or FILE (locally) URL returns:

Berkeley DB error while opening 'transactions' table for filesystem
/var/subversion/distribution/linux-x86/db:
Cannot allocate memory

and the repository is then broken. I am using subversion 1.0.2 and cannot
upgrade currently but others in the users list seem to see a similar problem
with 1.0.4. I can reproduce at will. I have tried doubling the lock values in
DB_CONFIG - it made no difference. The machine subversion is running on is
Linux with kernel 2.4.23, dual Xeon 2.4GHz and 2Gb of memory. subversion was
compiled with gcc 2.95.3 and uses glibc 2.2.4 and BDB 4.2.52.

I can replicate the problem at will now by doing this:

1. get hold of subversion sources
   cd /tmp
   svn co http://svn.collab.net/repos/svn/trunk subversion
   cd subversion
   find . -name .svn -exec rm -fr {} \;

2. create test repository
   cd dir where repositories create (/var/subversion/distribution for me).
   svnadmin create test-martin

3. import subversion tree into test repository.
   cd /tmp/subversion
   svn import . file:///var/subversion/distribution/test-martin -m "test"

4. prove the db is OK

   cd /var/subversion/distribution
   svnadmin recover test-martin

sh-2.05$ svnadmin recover test-martin/
Please wait; recovering the repository may take some time...

Recovery completed.
The latest repos revision is 1.

5. run the attached perl program with:

   /tmp/x.pl -u file:///var/subversion/distribution/test-martin

Couldn't open a repository: Unable to open an ra_local session to URL: Unable
to open repository
'file:///var/subversion/distribution/test-martin/doc/book/README': Berkeley DB
error while opening 'uuids' table for filesystem
/var/subversion/distribution/test-martin/db:
Cannot allocate memory at /tmp/x.pl line 17

6. demonstrate DB is now broken and unrecoverable

   cd /var/subversion/distribution
   svnadmin recover test-martin

sh-2.05$ svnadmin recover test-martin
Please wait; recovering the repository may take some time...
svn: DB_RUNRECOVERY: Fatal error, run database recovery

This is repeatable at will for me.

I've followed the excellent hint from C. Michael Pilato and used db_stat before
and after running the perl script. The results were:

before:
2000 Maximum number of locks possible.
2000 Maximum number of lockers possible.
2000 Maximum number of lock objects possible.
9 Maximum number of locks at any one time.
17 Maximum number of lockers at any one time.
9 Maximum number of lock objects at any one time.

after:
2000 Maximum number of locks possible.
2000 Maximum number of lockers possible.
2000 Maximum number of lock objects possible.
883 Maximum number of locks at any one time.
1760 Maximum number of lockers at any one time.
19 Maximum number of lock objects at any one time.

I have never managed to recover a repository broken in this way but am open to
suggestions. All the arguments for changing the attached perl script to make it
succeed are irrelevant to me - I can make the script work fine via http by
reducing the number of max_client in apache or by introducing sleeps into it
(speed was never important for it). The error appears to happen at the
server end and it leaves my repository broken.

What I particularly don't like about it is that I can make this
happen using a http URL which implies to me I could break other public
repositories and they could break my public repositories. Needless to say I've
not tried this.

I am part of a team which proposed a move to subversion but am not looking
forward to explaining why anyone can break a repository. As such if anyone has
any suggestions to try I would be delighted to hear from you.

Thank you.

Martin

--
Martin J. Evans
Easysoft Ltd, UK
Development


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
End of MIME message

  • application/octet-stream attachment: x.pl
Received on Thu Jun 3 19:46:35 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.