Re: dbm_store() returns -1, but no specific error is reported
Re: dbm_store() returns -1, but no specific error is reported
- Subject: Re: dbm_store() returns -1, but no specific error is reported
- From: Anton Rang <email@hidden>
- Date: Wed, 28 Nov 2007 20:05:12 -0600
On Nov 28, 2007, at 10:45 AM, Christian Moen wrote:
darwin-dev,
I'm experiencing strange behaviour with DBM on a Mac OS X 10.5.1 (both
on G5 and Intel) and it would be great to get some feedback from the
list on what the problem might be.
Running a quick dtrace script (attached) reveals that this fails due to
an overflow page not being added:
1 <- memcmp 10001
1 -> __addel 1788
1 -> __add_ovflpage 1789
1 <- __add_ovflpage 7068
1 <- __addel 7067
1 <- hash_access 7005
1 <- dbm_store 7896
So __add_ovflpage is failing. But I'm not sure which source this is
built
from. I thought it was the BerkeleyDB-15 package, but that doesn't seem
to have this function (it has __ham_add_ovflpage instead)...ah, we're
working with LibC-548 instead. [Is the BerkeleyDB code shipped
somehow?]
So, looking at
http://www.opensource.apple.com/darwinsource/10.5/Libc-498/db/hash/hash_page-fbsd.c
it appears that overflow_page() must be returning 0, indicating that
there
are no usable free pages in the database file. There are some strange
(to
my eye) limits on which pages can be used for overflow pages.
This looks like pretty old DBM code. I'm not sure I'd rely on it for
larger
databases. You could probably use the btree instead of hash code
(using the
dbopen interface) and at least get a larger file. But I'd still
wonder if
Apple's shipping a more up-to-date database somewhere....
-- Anton
Attachment:
test.d
Description: Binary data
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden