bdb-0.5.0のtests/btree.rbでSEGVします。
再現できる環境とそうでない環境があるようなのですが、
少なくとも手元(Debian/sidのlibdb4.[12]の環境)では100%再現できます。
# ruby_1_8の最新でも試しましたが同様でした。

gdbで追いかけると

  rb_newobj () at gc.c:379
  379         freelist = freelist->as.free.next;

で落ちているようです。

最初bdbの作者のGuy Decouxさんにメールを送ったのですが、
今のところ、bdbとrubyのどっちに問題があるのか分からない
というような返事をいただいています。

-- 
やまだあきら / akira yamada  <http://arika.org>

以下backtraceです:

#0  rb_newobj () at gc.c:379
#1  0x08083e0b in rb_class_allocate_instance (klass=2) at object.c:1540
#2  0x08067ec1 in call_cfunc (func=0x8083e00 <rb_class_allocate_instance>,
    recv=1077161308, len=0, argc=0, argv=0x0) at eval.c:5405
#3  0x0805c032 in rb_call0 (klass=1075764452, recv=1077161308, id=1, oid=2,
    argc=0, argv=0x0, body=0x401edc80, nosuper=0) at eval.c:5536
#4  0x0805c888 in rb_call (klass=1075764452, recv=1077161308, mid=1, argc=0,
    argv=0x0, scope=1) at eval.c:5757
#5  0x0805cbb1 in rb_funcall (recv=1077161308, mid=2, n=0) at ruby.h:631
#6  0x08083dac in rb_obj_alloc (klass=1077161308) at object.c:1528
#7  0x08083e64 in rb_class_new_instance (argc=2, argv=0x2, klass=2)
    at object.c:1565
#8  0x08067eba in call_cfunc (func=0x8083e50 <rb_class_new_instance>,
    recv=1077161308, len=0, argc=0, argv=0xbffeed58) at eval.c:5402
#9  0x0805c032 in rb_call0 (klass=1075764472, recv=1077161308, id=3369, oid=2,
    argc=3, argv=0xbffeed58, body=0x401ecaec, nosuper=0) at eval.c:5536
#10 0x0805c888 in rb_call (klass=1075764472, recv=1077161308, mid=3369,
    argc=3, argv=0xbffeed58, scope=0) at eval.c:5757
#11 0x08057a60 in rb_eval (self=1076926648, n=0x2) at ruby.h:631
#12 0x08059404 in rb_eval (self=1076926648, n=0x2) at eval.c:3201
#13 0x0805c2ff in rb_call0 (klass=1077162548, recv=1076926648, id=13945,
    oid=2, argc=2, argv=0xbffefbf0, body=0x40347f64, nosuper=0) at eval.c:5664
#14 0x0805c888 in rb_call (klass=1077162548, recv=1076926648, mid=13945,
    argc=4, argv=0xbffefbe8, scope=1) at eval.c:5757
#15 0x08057a60 in rb_eval (self=1076926648, n=0x2) at ruby.h:631
#16 0x08057317 in rb_eval (self=1076926648, n=0x2) at eval.c:3427
#17 0x0805c2ff in rb_call0 (klass=1077162548, recv=1076926648, id=10449,
    oid=2, argc=0, argv=0xbfff0a84, body=0x4035068c, nosuper=0) at eval.c:5664
#18 0x0805c888 in rb_call (klass=1077162548, recv=1076926648, mid=10449,
    argc=3, argv=0xbfff0a78, scope=1) at eval.c:5757
#19 0x08057a60 in rb_eval (self=1076926648, n=0x2) at ruby.h:631
#20 0x0805a5f9 in rb_yield_0 (val=1075567272, self=1076926648,
    klass=1075666032, flags=0, avalue=0) at eval.c:4745
#21 0x0805abd9 in rb_yield (val=2) at eval.c:4827
#22 0x401f73b8 in bdb_treat (st=0xbfff14a0, pkey=0x2, key=0xbfff1300,
    data=0xbfff12e0) at common.c:2316
#23 0x401f78d3 in bdb_i_each_kv (st=0xbfff14a0) at common.c:2402
#24 0x0805b999 in rb_ensure (b_proc=0x401f7750 <bdb_i_each_kv>,
    data1=3221165216, e_proc=0x401f72b0 <bdb_each_ensure>, data2=3221165216)
    at eval.c:5211
#25 0x401f7f47 in bdb_each_kvc (argc=0, argv=0x0, obj=1077237808, sens=2,
    replace=0, type=3) at common.c:2570
#26 0x401f84e5 in bdb_each_pair (argc=2, argv=0x2, obj=2) at common.c:2685
#27 0x08067eba in call_cfunc (func=0x401f84a0 <bdb_each_pair>,
    recv=1077237808, len=0, argc=0, argv=0x0) at eval.c:5402
#28 0x0805c032 in rb_call0 (klass=1075586752, recv=1077237808, id=3833, oid=2,
    argc=0, argv=0x0, body=0x401c1d88, nosuper=0) at eval.c:5536
#29 0x0805c888 in rb_call (klass=1075586752, recv=1077237808, mid=3833,
    argc=0, argv=0x0, scope=0) at eval.c:5757
#30 0x08057a60 in rb_eval (self=1076926648, n=0x2) at ruby.h:631
#31 0x08056e4a in rb_eval (self=1076926648, n=0x2) at eval.c:2977
#32 0x0805c2ff in rb_call0 (klass=1076958208, recv=1076926648, id=10505,
    oid=2, argc=0, argv=0xbfff28dc, body=0x401d7cf0, nosuper=0) at eval.c:5664
#33 0x0805c888 in rb_call (klass=1076958208, recv=1076926648, mid=10505,
    argc=0, argv=0xbfff28dc, scope=1) at eval.c:5757
#34 0x0805cab7 in rb_f_send (argc=0, argv=0xbfff28dc, recv=1076926648)
    at ruby.h:631
#35 0x08067eba in call_cfunc (func=0x805ca40 <rb_f_send>, recv=1076926648,
    len=0, argc=0, argv=0xbfff28d8) at eval.c:5402
#36 0x0805c032 in rb_call0 (klass=1075764392, recv=1076926648, id=3889, oid=2,
    argc=1, argv=0xbfff28d8, body=0x401ebd40, nosuper=0) at eval.c:5536
#37 0x0805c888 in rb_call (klass=1075764392, recv=1076926648, mid=3889,
    argc=1, argv=0xbfff28d8, scope=1) at eval.c:5757
#38 0x08057a60 in rb_eval (self=1076926648, n=0x2) at ruby.h:631
#39 0x08057112 in rb_eval (self=1076926648, n=0x2) at eval.c:3064
#40 0x08057260 in rb_eval (self=1076926648, n=0x2) at eval.c:3113
#41 0x0805c2ff in rb_call0 (klass=1077142568, recv=1076926648, id=5113, oid=2,
    argc=0, argv=0xbfff3dbc, body=0x40353404, nosuper=0) at eval.c:5664
#42 0x0805c888 in rb_call (klass=1077142568, recv=1076926648, mid=5113,
    argc=1, argv=0xbfff3db8, scope=0) at eval.c:5757
#43 0x08057a60 in rb_eval (self=1076927708, n=0x2) at ruby.h:631
#44 0x08061a40 in block_pass (self=1076927708, node=0x4033f7ec) at eval.c:8407
#45 0x08058532 in rb_eval (self=1076927708, n=0x2) at eval.c:2963
#46 0x0805a5f9 in rb_yield_0 (val=1076926648, self=1076927708,
    klass=1077147588, flags=0, avalue=0) at eval.c:4745
#47 0x0805abd9 in rb_yield (val=2) at eval.c:4827
#48 0x080bebff in rb_ary_each (ary=1076926828) at array.c:1112
#49 0x08067ec1 in call_cfunc (func=0x80bebd0 <rb_ary_each>, recv=1076926828,
    len=0, argc=0, argv=0x0) at eval.c:5405
#50 0x0805c032 in rb_call0 (klass=1075733872, recv=1076926828, id=3833, oid=2,
    argc=0, argv=0x0, body=0x401e614c, nosuper=0) at eval.c:5536
#51 0x0805c888 in rb_call (klass=1075733872, recv=1076926828, mid=3833,
    argc=0, argv=0x0, scope=0) at eval.c:5757
#52 0x08057a60 in rb_eval (self=1076927708, n=0x2) at ruby.h:631
#53 0x08056e4a in rb_eval (self=1076927708, n=0x2) at eval.c:2977
#54 0x0805c2ff in rb_call0 (klass=1077143828, recv=1076927708, id=5113, oid=2,
    argc=0, argv=0xbfff5e5c, body=0x4033f968, nosuper=0) at eval.c:5664
#55 0x0805c888 in rb_call (klass=1077143828, recv=1076927708, mid=5113,
    argc=1, argv=0xbfff5e58, scope=0) at eval.c:5757
#56 0x08057a60 in rb_eval (self=1076929788, n=0x2) at ruby.h:631
#57 0x08061a40 in block_pass (self=1076929788, node=0x4033f7ec) at eval.c:8407
#58 0x08058532 in rb_eval (self=1076929788, n=0x2) at eval.c:2963
#59 0x0805a5f9 in rb_yield_0 (val=1076927708, self=1076929788,
    klass=1077147588, flags=0, avalue=0) at eval.c:4745
#60 0x0805abd9 in rb_yield (val=2) at eval.c:4827
#61 0x080bebff in rb_ary_each (ary=1076929748) at array.c:1112
#62 0x08067ec1 in call_cfunc (func=0x80bebd0 <rb_ary_each>, recv=1076929748,
    len=0, argc=0, argv=0x0) at eval.c:5405
#63 0x0805c032 in rb_call0 (klass=1075733872, recv=1076929748, id=3833, oid=2,
    argc=0, argv=0x0, body=0x401e614c, nosuper=0) at eval.c:5536
#64 0x0805c888 in rb_call (klass=1075733872, recv=1076929748, mid=3833,
    argc=0, argv=0x0, scope=0) at eval.c:5757
#65 0x08057a60 in rb_eval (self=1076929788, n=0x2) at ruby.h:631
#66 0x08056e4a in rb_eval (self=1076929788, n=0x2) at eval.c:2977
#67 0x0805c2ff in rb_call0 (klass=1077143828, recv=1076929788, id=5113, oid=2,
    argc=0, argv=0xbfff7efc, body=0x4033f968, nosuper=0) at eval.c:5664
#68 0x0805c888 in rb_call (klass=1077143828, recv=1076929788, mid=5113,
    argc=1, argv=0xbfff7ef8, scope=0) at eval.c:5757
#69 0x08057a60 in rb_eval (self=1076885608, n=0x2) at ruby.h:631
#70 0x08056e4a in rb_eval (self=1076885608, n=0x2) at eval.c:2977
#71 0x0805c2ff in rb_call0 (klass=1076887188, recv=1076885608, id=16625,
    oid=2, argc=0, argv=0x0, body=0x403059fc, nosuper=0) at eval.c:5664
#72 0x0805c888 in rb_call (klass=1076887188, recv=1076885608, mid=16625,
    argc=0, argv=0x0, scope=0) at eval.c:5757
#73 0x08057a60 in rb_eval (self=1076886508, n=0x2) at ruby.h:631
#74 0x08059404 in rb_eval (self=1076886508, n=0x2) at eval.c:3201
#75 0x0805c2ff in rb_call0 (klass=1076886348, recv=1076886508, id=16513,
    oid=2, argc=0, argv=0x0, body=0x40307db0, nosuper=0) at eval.c:5664
#76 0x0805c888 in rb_call (klass=1076886348, recv=1076886508, mid=16513,
    argc=0, argv=0x0, scope=2) at eval.c:5757
#77 0x08057a60 in rb_eval (self=1076886508, n=0x2) at ruby.h:631
#78 0x08059404 in rb_eval (self=1076886508, n=0x2) at eval.c:3201
#79 0x0805c2ff in rb_call0 (klass=1076886348, recv=1076886508, id=5033, oid=2,
    argc=0, argv=0x0, body=0x40308abc, nosuper=0) at eval.c:5664
#80 0x0805c888 in rb_call (klass=1076886348, recv=1076886508, mid=5033,
    argc=0, argv=0x0, scope=0) at eval.c:5757
#81 0x08057a60 in rb_eval (self=1076886348, n=0x2) at ruby.h:631
#82 0x08059404 in rb_eval (self=1076886348, n=0x2) at eval.c:3201
#83 0x0805c2ff in rb_call0 (klass=1077113348, recv=1076886348, id=5113, oid=2,
    argc=0, argv=0xbfffb910, body=0x4033790c, nosuper=0) at eval.c:5664
#84 0x0805c888 in rb_call (klass=1077113348, recv=1076886348, mid=5113,
    argc=2, argv=0xbfffb908, scope=0) at eval.c:5757
#85 0x08057a60 in rb_eval (self=1076957068, n=0x2) at ruby.h:631
#86 0x08057933 in rb_eval (self=1076957068, n=0x2) at eval.c:3251
#87 0x0805c2ff in rb_call0 (klass=1076960328, recv=1076957068, id=5113, oid=2,
    argc=0, argv=0x0, body=0x4033826c, nosuper=0) at eval.c:5664
#88 0x0805c888 in rb_call (klass=1076960328, recv=1076957068, mid=5113,
    argc=0, argv=0x0, scope=0) at eval.c:5757
#89 0x08057a60 in rb_eval (self=1076960328, n=0x2) at ruby.h:631
#90 0x0805c2ff in rb_call0 (klass=1076960308, recv=1076960328, id=5113, oid=2,
    argc=0, argv=0xbfffcfbc, body=0x4033dc44, nosuper=0) at eval.c:5664
#91 0x0805c888 in rb_call (klass=1076960308, recv=1076960328, mid=5113,
    argc=1, argv=0xbfffcfb8, scope=0) at eval.c:5757
#92 0x08057a60 in rb_eval (self=1075759552, n=0x2) at ruby.h:631
#93 0x08057d31 in rb_eval (self=1075759552, n=0x2) at ruby.h:636
#94 0x0805a5f9 in rb_yield_0 (val=1076958108, self=1075759552,
    klass=1077234668, flags=0, avalue=2) at eval.c:4745
#95 0x08061280 in proc_invoke (proc=1076959268, args=1076958108, self=6,
    klass=0) at ruby.h:631
#96 0x0805f7c6 in call_end_proc (data=2) at eval.c:7435
#97 0x0805faa6 in rb_exec_end_proc () at eval.c:7516
#98 0x08053bc2 in ruby_finalize_0 () at eval.c:1392
#99 0x08053c4f in ruby_cleanup (ex=0) at eval.c:1420
#100 0x08053e51 in ruby_stop (ex=2) at eval.c:1467
#101 0x08053e9f in ruby_run () at eval.c:1479
#102 0x08052025 in main (argc=2, argv=0x2, envp=0xbfffe3b4) at main.c:50