DB_PRIVATE

Matthias Andree matthias.andree at gmx.de
Sat Dec 4 14:24:20 CET 2004


David Relson <relson at osagesoftware.com> writes:

>> Berkeley DB library configured to support only DB_PRIVATE
>> environments
>
>> bogofilter: DB_ENV->open, err: Invalid argument
>> 
>> I'm no programmer, db or otherwise. But I did search for the last hour
>> or so to try to figure out what to do to fix it.
>> I even installed the newest current BerkeleyDB 4.3.21. That didn't
>> help.  So I went back to the previous bogofilter 0.92.4. All works
>> fine again. My question is. Do I just need to dig deeper on
>> configuring BerkeleyDB?
>> Or is this an install problem?
>> 
>> -jim
>
> Jim,
>
> You sent the message to me, personally, but I'm replying to you via
> the mailing list.  Matthias is our Berkeley DB expert and will be able
> to supply the definitive answer.
>
> As a first bit of info, what distro are you running and how did you load
> DB-4.3.21 (from source, rpm, deb, ???)

Did you configure a static compile? What did bogofilter's configure use
for LIBDB? ("grep LIBDB src/Makefile" will tell you)

What *exact* machine do you run (try: uname -a)

Do you set LD_ASSUME_KERNEL in your environment (if running on Linux)?
Try "printenv | sort"

How *exactly* have you compiled/installed DB-4.3.21?

Do you have its config.log still around? If so, upload it to the web
site, an FTP server (please compress).

Same for bogofilter's config.log.

> Looking at the source code (file datastore_db.c) we have
>
>    /*
>     * Hint from Keith Bostic, SleepyCat support, 2004-11-29,
>     * we can use the DB_PRIVATE flag, that rebuilds the database
>     * environment in heap memory, so we don't need to remove it.
>     */
>
>     e = env->open(env, directory, dbenv_defflags | DB_PRIVATE |
>                   DB_CREATE | DB_RECOVER, 0664);    
>     ...

That's the exact opposite, and the only special case where bogofilter
does not need a _shared_ environment (as we hold the global exclusive
lock, run recovery to propagate unsynched changes from the log, and are
removing the environment right away).

All other uses of bogofilter require a shared environment, i. e. one
without DB_PRIVATE - and that doesn't work for Jim for some reason. This
appears to be more common for DB 4.3 for some reason. Not sure what has
changed WRT POSIX threads or mutex support.

Playing with the BDB mutex ./configure options may help.  If someone
finds out, please let me know.

I have found this:
http://svn.haxx.se/users/archive-2004-07/1717.shtml
but haven't yet wrapped my mind fully around why these mutexes don't
work with a static libpthreads and thereabouts.

-- 
Matthias Andree



More information about the Bogofilter mailing list