[elephant-devel] Elephant/BDB problems on recent 64-bit Linux systems

Petter Gustad elephant at gustad.com
Tue Jan 4 23:00:25 UTC 2011


From: Petter Gustad <elephant at gustad.com>
Subject: Re: [elephant-devel] Elephant/BDB problems on recent 64-bit Linux systems
Date: Tue, 04 Jan 2011 13:21:28 +0100 (CET)

This was a classical my-config.sexp error... I had my include
directory specified as:

 (:berkeley-db-include-dir . "/usr/include/")

But on older Gentoo system /usr/include/db.h is a symbolic link to
db4.7/db.h whereas on more recent systems it is a symbolic link to
db4.8/db.h. After specifying

 (:berkeley-db-include-dir . "/usr/include/db4.7/")

it worked. The reason for the crash is that offset of
env->set_lk_max_locks does not point to the right offset since I was
using the a header file which did not correspond to the binary
library.

Ian, thank you for pointing me in the right direction. 


//Petter

P.S. I will repeat the symtoms here in case somebody else runs into a
similar problem. Hopefully you get a hit on this message if you search
for any of the errors using Google.

I could reproduce the problem by:

(asdf:initialize-source-registry '(:source-registry :ignore-inherited-configuration))
(ql:quickload "bordeaux-threads")
(ql:quickload "cl-base64")
(ql:quickload "uffi")
(ql:quickload "fiveam")
(push (make-pathname :directory '(:relative "elephant-1.0")) asdf:*central-registry*)
(asdf:oos 'asdf:load-op :elephant)
(asdf:oos 'asdf:load-op :elephant-tests)
;; (in-package :elephant-tests)
;; (setf *default-spec* *testbdb-spec*)
;; (do-backend-tests)
(asdf:oos 'asdf:load-op :ele-bdb)
(in-package :db-bdb)
(db-env-set-max-locks (db-env-create) 2000)

Running SBCL 1.0.44 gives me a memory corruption error:

  Unhandled memory fault at #x7D0.

Looking at the stack I see:

0: (SB-SYS:MEMORY-FAULT-ERROR)
1: ("foreign function: call_into_lisp")
2: ("foreign function: post_signal_tramp")
3: ("foreign function: strlen")
4: (DB-BDB::DB-ENV-SET-MAX-LOCKS
    #<unavailable argument>
    #<unavailable argument>)


Using CCL I get  a similar fault:

exception in foreign context
Exception occurred while executing foreign code
 at strlen + 18
? for help
[24895] Clozure CL kernel debugger:  
current thread: tcr = 0x7fbbe11ce570, native thread ID = 0x6140, interrupts enabled


(#x00007FBBE0F697E0) #x00003020016FA5DC : #<Function %DB-ENV-SET-MAX-LOCKS #x00003020016FA52F> + 173
(#x00007FBBE0F69800) #x00003020016FA27C : #<Function DB-ENV-SET-MAX-LOCKS #x00003020016FA24F> + 45
(#x00007FBBE0F69820) #x00003020017A96FC : #<Method-Function OPEN-CONTROLLER (BDB-STORE-CONTROLLER) #x00003020017A93DF> + 797
(#x00007FBBE0F69918) #x0000300000216E3C : #<Function %%BEFORE-AND-AFTER-COMBINED-METHOD-DCODE #x0000300000216ABF> + 893
(#x00007FBBE0F69990) #x00003000001FAE1C : #<Function %%STANDARD-COMBINED-METHOD-DCODE #x00003000001FAD0F> + 269
(#x00007FBBE0F699F8) #x00003020011A9EF4 : #<Function OPEN-STORE #x00003020011A9DAF> + 325








More information about the elephant-devel mailing list