BDB Lib Crash (4.6.21)

I got core dump again in my application when calling db->put()
I'm opening more than 1000 files it seemed to crashed after 1000 files opened. I know there was a limitation of 1024 file handles per process so that I had already enlarged that by calling setrlimit:
limit.rlim_cur = 10000;
limit.rlim_max = 10000;
n = setrlimit(RLIMIT_NOFILE, &limit); // n == 0 after returned.I'm using 4.6.21, Ubuntu 8.10, 64 bits CPU, multi-thread accessing but I added mutex to make one DB file was accessing by one thread a time, with DB Environment:
    ret = db_env_create(&envp, 0);
    if (ret != 0) {
        ERR("StorageRoot: Error creating env handle: %s\n", db_strerror(ret));
        envp = NULL;
        return NULL;
    /* we can optimize this parameter in DB_CONFIG file */
    ret = envp->set_cachesize(envp, 0, _1M * 64, 0);
    if (ret != 0) {
        ERR("StorageRoot: DB->set_cachesize failed: %s.\n", db_strerror(ret));
        return NULL;
    /* we can optimize this parameter in DB_CONFIG file */
    ret = envp->mutex_set_max(envp, 100000);
    if (ret != 0) {
        ERR("StorageRoot: DB->mutex_set_max failed: %s.\n", db_strerror(ret));
        return NULL;
    envp->set_errpfx  (envp, "store");
    envp->set_errcall (envp, bdb_err_callback);
    envp->set_msgcall (envp, bdb_msg_callback);
    envp->set_data_dir(envp, sr->path);
    /* Open the environment. */
    env_flags = DB_CREATE | DB_RECOVER | DB_INIT_TXN | DB_THREAD | DB_INIT_MPOOL;
    ret = envp->open(envp,
                     env_home,        /* env home directory */
                     env_flags,       /* Open flags */
                     0);              /* File mode (default) */
    if (ret != 0) {
        ERR("StorageRoot: Environment open failed: %s", db_strerror(ret));
        return NULL;
{code}
{code:title=Create DB}
    ret = db_create(&dbp, envp, 0);
    if (ret != 0) {
        ERR("Store: store_open -- %s\n", db_strerror(ret));
        store_destroy(handle);
        return NULL;
    /* Point to the memory malloc'd by db_create() */
    handle->dbp = dbp;
    /* Set the open flags */
    open_flags = DB_CREATE | DB_THREAD;     /* Allow database creation */
    /* Set the page size to 8K */
    dbp->set_pagesize(dbp, _8K);
    /* Now open the database */
    ret = dbp->open(dbp,        /* Pointer to the database */
                    NULL,       /* Txn pointer */
                    handle->db_name, /* File name */
                    NULL,       /* Logical db name */
                    DB_HASH,    /* Database type (using hash) */
                    open_flags, /* Open flags */
                    0);         /* File mode. Using defaults */
{code}
{code:title=Crash Callstack}
#11 0x000000000043e4d2 in sig_handler (sig=11) at main.cpp:278                      <<-- SIGSERV
#12 <signal handler called>
#13 0x00007f363e7a27e1 in __memp_fget (dbmfp=0x7f36241dd440, pgnoaddr=0x7f36241dd9b4, txn=0x0, flags=1, addrp=0x7f36241dd9a8)
    at ../dist/../mp/mp_fget.c:243
#14 0x00007f363e6df62e in __ham_get_cpage (dbc=0x7f36241dd7a0, mode=DB_LOCK_WRITE) at ../dist/../hash/hash_page.c:2356
#15 0x00007f363e6cabbc in __ham_lookup (dbc=0x7f36241dd7a0, key=0x7f3638f6adf0, sought=37, mode=DB_LOCK_WRITE,
    pgnop=0x7f3638f6ac9c) at ../dist/../hash/hash.c:1747
#16 0x00007f363e6c8cd6 in __hamc_put (dbc=0x7f36241dd7a0, key=0x7f3638f6adf0, data=0x7f3638f6adc0, flags=20, pgnop=0x7f3638f6ac9c)
    at ../dist/../hash/hash.c:1014
#17 0x00007f363e74b59e in __dbc_put (dbc_arg=0x7f36241dd7a0, key=0x7f3638f6adf0, data=0x7f3638f6adc0, flags=20)
    at ../dist/../db/db_cam.c:1455
#18 0x00007f363e740578 in __db_put (dbp=0x7f36241dce90, txn=0x0, key=0x7f3638f6adf0, data=0x7f3638f6adc0, flags=20)
    at ../dist/../db/db_am.c:399
#19 0x00007f363e758c9b in __db_put_pp (dbp=0x7f36241dce90, txn=0x0, key=0x7f3638f6adf0, data=0x7f3638f6adc0, flags=20)
    at ../dist/../db/db_iface.c:1562
#20 0x000000000049033d in store_put (handle=0x7f36241dcd80, k=0x116e4e2 "?206pyq\016(1\020c\202o?[", b=0x116e4f6)
    at store.c:453
#21 0x000000000049857b in part_put (self=0x10f4560, dest=0x7f3638f6b010, key=0x116e4e2 "?206pyq\016(1\020c\202o?[",
    block=0x116e4f6) at partition.c:123
#22 0x000000000049681a in onmessage_sync_put (_piranha=0x10f2570, from=0x116e4b0, keep=0x7f3638f6b09c, msgbuf=0x116e410)
    at syncput.c:609
#23 0x00000000004a15d9 in __network_onreceived (self=0x1105c10, from=0x116e4b0, buf=0x116e410) at src/upcall.c:107
   +--../dist/../mp/mp_fget.c--------------------------------------------------------------+
   |229              * Determine the cache and hash bucket where this page lives and get   |
   |230              * local pointers to them.  Reset on each pass through this code, the  |
   |231              * page number can change.                                             |
   |232              */                                                                    |
   |233             MP_GET_BUCKET(dbmfp, *pgnoaddr, &infop, hp, ret);                      |
   |234             if (ret != 0)                                                          |
   |235                     return (ret);                                                  |
   |236             c_mp = infop->primary;                                                 |
   |237                                                                                    |
   |238             /* Search the hash chain for the page. */                              |
   |239             st_hsearch = 0;                                                        |
   |240             b_locked = 1;                                                          |
   |241             SH_TAILQ_FOREACH(bhp, &hp->hash_bucket, hq, __bh) {                    |
   |242                     ++st_hsearch;                                                  |
=*|243                     if (bhp->pgno != *pgnoaddr || bhp->mf_offset != mf_offset)     |
   |244                             continue;                                              |
   |245                                                                                    |
   |246                     /* Snapshot reads -- get the version visible at read_lsn. */   |
   |247                     if (mvcc && !edit && read_lsnp != NULL) {                      |
   |248                             while (bhp != NULL &&                                  |
   |249                                 !BH_OWNED_BY(dbenv, bhp, txn) &&                   |
   |250                                 !BH_VISIBLE(dbenv, bhp, read_lsnp, vlsn))          |
   |251                                     bhp = SH_CHAIN_PREV(bhp, vc, __bh);            |
   |252                                                                                    |
   |253                             DB_ASSERT(dbenv, bhp != NULL);                         |
   |254                     }                                                              |
   |255                                                                                    |
   |256                     makecopy = mvcc && dirty && !BH_OWNED_BY(dbenv, bhp, txn);     |
   |257                                                                                    |
   |258                     if (F_ISSET(bhp, BH_FROZEN) && !F_ISSET(bhp, BH_FREED)) {      |
   |259                             DB_ASSERT(dbenv, frozen_bhp == NULL);                  |
   +---------------------------------------------------------------------------------------+
core process 2549 In: __memp_fget                        Line: 243  PC: 0x7f363e7a27e1
(gdb) f 13
#13 0x00007f363e7a27e1 in __memp_fget (dbmfp=0x7f36241dd440, pgnoaddr=0x7f36241dd9b4, txn=0x0, flags=1, addrp=0x7f36241dd9a8)
    at ../dist/../mp/mp_fget.c:243
(gdb) p bhp
$2 = (BH *) 0x7a1e922e2668c362
(gdb) p bhp->mf_offset
Cannot access memory at address 0x7a1e922e2668c38a
(gdb) p *bhp
Cannot access memory at address 0x7a1e922e2668c362
(gdb)
{code}
On the same environment, I changed to build and link with Lib 4.8.24. It was working fine. Does it a bug of 4.6.21?
I'm curious that the application was working fine at other machines with same 4.6.21 installed with Ubuntu 8.10, which libdb4.6 was install by "apt-get" not by make install, 64 bits CPU. Why it works fine?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Hello,
The thread you mentioned was followed up again in:
Segmentation Faults on AIX with 4.7.25
At this time the problem was reproduced in 4.7.25. The resolution for the problems reported were:
1. Applying patch, patch.4.7.25.16300.dif, on top of
Berkeley DB 4.7.25. In the code that manipulates
db file names the patch will correctly hold the mutex
on the mpool region when freeing memory.
2. If the patch is not applied, a workaround is to set the
EnvironmentConfig setPrivate method to true.
The fix for the issue reported in #16300 is included in Berkeley DB 4.8.
Thanks,
Sandra

Similar Messages

  • BDB Lib Crash (4.8.24)

    I'm using BDB 4.8.25, 64 bits CPU, multi-thread accessing , but the lib crash when I use db->del(). If I don't use db->del(), just use put and get , it is no problem. The stack is
    0x0000000000629e11 in __memp_fget (dbmfp=0x9c8730, pgnoaddr=0x4820b3b4, ip=0x0, txn=0x0, flags=0, addrp=0x4820b360)
    at ../dist/../mp/mp_fget.c:250
    #1 0x000000000067ffff in __bam_get_root (dbc=0x9c8a80, pg=1, slevel=1, flags=1409, stack=0x4820b514)
    at ../dist/../btree/bt_search.c:116
    #2 0x0000000000680659 in __bam_search (dbc=0x9c8a80, root_pgno=1, key=0x4820bd70, flags=1409, slevel=1, recnop=0x0,
    exactp=0x4820b864) at ../dist/../btree/bt_search.c:290
    #3 0x0000000000668d2b in __bamc_search (dbc=0x9c8a80, root_pgno=0, key=0x4820bd70, flags=27, exactp=0x4820b864)
    at ../dist/../btree/bt_cursor.c:2785
    #4 0x0000000000663878 in __bamc_get (dbc=0x9c8a80, key=0x4820bd70, data=0x4820bd40, flags=27, pgnop=0x4820b91c)
    at ../dist/../btree/bt_cursor.c:1088
    #5 0x00000000005dc94f in __dbc_iget (dbc=0x9c8a80, key=0x4820bd70, data=0x4820bd40, flags=27) at ../dist/../db/db_cam.c:934
    #6 0x00000000005dc379 in __dbc_get (dbc=0x9c8a80, key=0x4820bd70, data=0x4820bd40, flags=27) at ../dist/../db/db_cam.c:755
    #7 0x00000000005e4400 in __db_get (dbp=0x9c80a0, ip=0x0, txn=0x0, key=0x4820bd70, data=0x4820bd40, flags=27)
    at ../dist/../db/db_iface.c:778
    #8 0x00000000005e4184 in __db_get_pp (dbp=0x9c80a0, txn=0x0, key=0x4820bd70, data=0x4820bd40, flags=0)
    at ../dist/../db/db_iface.c:693
    #9 0x00000000005be05d in Db::get (this=0x9c8000, txnid=0x0, key=0x4820bd70, value=0x4820bd40, flags=0)
    DB environment is:
    if ((ret = dbenv->set_timeout(200000, DB_SET_LOCK_TIMEOUT)) != 0) {
    log_error("set dbenv timeout error!");
    exit(-1);
    if ((ret = dbenv->set_lk_detect(DB_LOCK_EXPIRE)) !=0 ) {
    log_error("set dbenv lock detect error!");
    exit(-1);
    if ((ret = dbenv->set_cachesize(20, 0, 1)) != 0) {
    log_error("set dbenv cache size error!");
    exit(-1);
    dbenv->open(dataDir, DB_INIT_MPOOL | DB_INIT_LOG | DB_THREAD | DB_CREATE | DB_SYSTEM_MEM, 0664);
    The crash occuers in get method, but if not use db->del(), I had not see the crash again.
    Edited by: user9233151 on 2010-2-28 下午11:47
    Edited by: user9233151 on 2010-2-28 下午11:50
    Edited by: user9233151 on 2010-2-28 下午11:51

    Hi,
    Do you have a small stand-alone test case program to demonstrate the issue? Is this issue reproducible at will?
    Does the problem happen when trying to deleting a specific key/record?
    Any errors messages reported? Is this the complete stack? What does the crash consists in?
    Regards,
    Andrei

  • PLEASE HELP: iTunes Lib. crashed, need playlists back!

    My iPod broke last week, so it got a new hard drive, and will be back tommorrow. Today, my iTunes library totally crashed.. I still have the library files and all that say (damaged) and the temp files, the xml, ets.. I can reimport my songs, I don't care, I just REALLY need my playlists back.. Please help...
    iTunes 7.0.2

    A damaged library cannot be repaired.
    If you still have the files in your 'Previous iTunes Libraries' folder and don't mind to loose the changes you've made since upgrading from iTunes 6 to iTunes 7, there might be a way to restore as much as possible.
    Locate the most recent file in the 'Previous iTunes Libraries' folder.
    My most recent file in there is 'iTunes Library 2006-09-12' (the day I upgraded to iTunes 7).
    Create a copy of that file, rename it to 'iTunes Library' and put it at /Users/Username/Music/iTunes, replacing the existing one.
    Then run iTunes. It should recognize the iTunes 6 format of the file and start determining 'gapless playback information' again.
    After a while you should have your library back.
    All changes you made after upgrading to iTunes 7 are lost of course, but song files you added are still there.
    If your songs files are at the default location (/Users/Username/Music/iTunes) and the 'iTunes Music folder location' (Preferences>Advanced>General) is also set to that location, drag and drop the 'iTunes Music' folder on the library window in iTunes.
    This will add the songs you added since upgrading to iTunes 7, to the library.
    I've done a test of this a few weeks ago and it worked flawless except for Podcasts. Many Podcast entries in the library were duplicated.
    No big deal if you don't have them or maybe a few, but a real annoyance if you have many of them.
    Hope this helps.
    M
    17' iMac 800 MHz, 768 MB RAM, 200 GB HD, DL burner   Mac OS X (10.4.8)   iTunes 7.0.2

  • Dbxml Core Dump Seg Fault

    Hi - We are currently using dbxml for many years successfully on CentOS and FreeBSD.  Recently,we have been trying to get our dbxml application to run on Joyent's SmartOS platform. 
    Through the help of Joyent, we are able to build sbxml 2.5.16 binaries on smartos.  Build ntes here:
    https://github.com/joyent/smartos-live/issues/236
    However, when we run the application, the java core dumps - both on jdk 7 and jdk 6.  Same code runs find on other platforms.  Core dump is included in the above post.  Not sure if anyone here might have an idea on what is causing this. 

    Hi Lauren,
    Thanks for the response.  Here is what I posted about this on the smartos forums.  They helped me in getting dbxml to compile on smartos.  Including using an xquilla patch:
    OK, so the build problem you're having there appears to be an error in the C++ source for xqilla. This diff appears to fix that:
    --- pristine/dbxml-2.5.16/xqilla/src/items/DatatypeFactoryTemplate.hpp 2009-01-07 11:46:13.000000000 +0000 +++ dbxml-2.5.16/xqilla/src/items/DatatypeFactoryTemplate.hpp 2013-07-11 08:17:00.638395661 +0000 @@ -79,7 +79,7 @@ AnyAtomicType::Ptr createInstance(const XMLCh* value, const DynamicContext* context) const { - return createInstanceNoCheck(DatatypeFactoryTemplate<TYPE>::getPrimitiveTypeURI(), + return this->createInstanceNoCheck(DatatypeFactoryTemplate<TYPE>::getPrimitiveTypeURI(), DatatypeFactoryTemplate<TYPE>::getPrimitiveTypeName(), value, context); }
    Here is the post about the core dump:
    Hi - OK, so apparently, the newly compiled code core dumps the JVM every time I try to call the openContainer method.
    At first, I thought this was a code issue or a jdk 7 issue. However, I've compiled dbxml on smartos via the instructions in above thread using both jdk 6 and jdk 7 and I get the same core dump on the same call.
    Also, tested the code on jdk 7 and jdk 6 on FreeBSD, Linux and Solaris and everything works OK.
    I also thought it was a problem with my data, but I tried this create a fresh container using dbxml shell.
    Same thing. So it seems to be a problem with the dbxml build specific to smartos.
    Anyone have any ideas on where I can start looking for a solution?
    $ /opt/local/java/bin/java -d64 -cp ...
    srv context: java.io.BufferedInputStream@1f2f0ce
    A fatal error has been detected by the Java Runtime Environment:
    SIGSEGV (0xb) at pc=0x000000000028a89d, pid=4151, tid=2
    JRE version: 7.0_25-b15
    Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode solaris-amd64 compressed oops)
    Problematic frame:
    C 0x000000000028a89d
    Core dump written. Default location: /home/nxd/srv/adm/core or core.4151
    An error report file with more information is saved as:
    /home/nxd/srv/adm/hs_err_pid4151.log
    If you would like to submit a bug report, please visit:
    http://bugreport.sun.com/bugreport/crash.jsp
    Abort (core dumped)
    ========CORE DUMP
    A fatal error has been detected by the Java Runtime Environment:
    SIGSEGV (0xb) at pc=0x000000000028a89d, pid=4116, tid=2
    JRE version: 7.0_25-b15
    Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode solaris-amd64 compressed oops)
    Problematic frame:
    C 0x000000000028a89d
    Core dump written. Default location: /home/test/srv/adm/core or core.4116
    If you would like to submit a bug report, please visit:
    http://bugreport.sun.com/bugreport/crash.jsp
    The crash happened outside the Java Virtual Machine in native code.
    See problematic frame for where to report the bug.
    T H R E A D
    Current thread (0x000000000041e000): JavaThread "main" [_thread_in_native, id=2, stack(0xfffffd7ffe800000,0xfffffd7ffea00000)]
    siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x000000000028a89d
    Registers:
    RAX=0x000000000028a89d, RBX=0x0000000000000001, RCX=0x0000000002b27ea0, RDX=0x474e5543432b2b00
    RSP=0xfffffd7ffe9fec88, RBP=0xfffffd7ffe9fee30, RSI=0x0000000000000001, RDI=0x0000000000000001
    R8 =0xfffffd7ffe9fecb0, R9 =0xfffffd7fbfeb8e60, R10=0x0000000000000434, R11=0xfffffd7fff202df0
    R12=0x0000000002b27ec0, R13=0x0000000000000002, R14=0x0000000000000001, R15=0x0000000002b28630
    RIP=0x000000000028a89d, RFLAGS=0x0000000000010286
    Top of Stack: (sp=0xfffffd7ffe9fec88)
    0xfffffd7ffe9fec88: fffffd7fff2a2e50 fffffd7ffe9fecc0
    0xfffffd7ffe9fec98: 00000001ff3fc800 fffffd7ffe9fee50
    0xfffffd7ffe9feca8: 0000000002b27ea0 fffffd7ffe9fefa0
    0xfffffd7ffe9fecb8: fffffd7fff3b1422 0000000002b27ea0
    0xfffffd7ffe9fecc8: 0000000002b9b530 fffffd7fbfeefd90
    0xfffffd7ffe9fecd8: fffffd7ff53b7fb3 fffffd7ffe9ff190
    0xfffffd7ffe9fece8: fffffd7ffe9ff090 0000000000000000
    0xfffffd7ffe9fecf8: 0000000000000001 0000000000000000
    0xfffffd7ffe9fed08: ffffff00000000ff 0000000002b8cf00
    0xfffffd7ffe9fed18: fffffd7ffe9ff110 0000000002b1ea40
    0xfffffd7ffe9fed28: 0000000002582310 0000000000000000
    0xfffffd7ffe9fed38: 0000000000000001 6d2e42494c534f5f
    0xfffffd7ffe9fed48: 0000000002b1ea40 0000000000000000
    0xfffffd7ffe9fed58: 0000000000000000 fffffd7ffe9ff080
    0xfffffd7ffe9fed68: fffffd7ffe9ff000 0000000000000000
    0xfffffd7ffe9fed78: 0000000000000000 697600656e6f6e2d
    0xfffffd7ffe9fed88: 2d65646f6e007765 0000000002b27ec0
    0xfffffd7ffe9fed98: 0000000000000002 0000000000000001
    0xfffffd7ffe9feda8: 0000000002b28630 fffffd7ffe9ff090
    0xfffffd7ffe9fedb8: fffffd7fbfe81442 fffffd7fbfe3be1d
    0xfffffd7ffe9fedc8: fffffd7fbfc51f28 000000000028a89d
    0xfffffd7ffe9fedd8: fffffd7fbfe81108 fffffd7fbfeb8e60
    0xfffffd7ffe9fede8: 0000000000000434 fffffd7ffe9fecb0
    0xfffffd7ffe9fedf8: 0000000100000000 fffffd7fbfc9f120
    0xfffffd7ffe9fee08: 0000000002b1ea40 0000000002b27ec0
    0xfffffd7ffe9fee18: 0000000000000001 fffffd7ffe9fee50
    0xfffffd7ffe9fee28: 0000000002b27ea0 fffffd7ffe9fefb0
    0xfffffd7ffe9fee38: fffffd7fff2a302f 00000000000006c9
    0xfffffd7ffe9fee48: 0000000002b27ea0 fffffd7ffe9fefa0
    0xfffffd7ffe9fee58: fffffd7fff3b1422 0000000002b27ea0
    0xfffffd7ffe9fee68: 0000000002b9b530 fffffd7fbfeefd90
    0xfffffd7ffe9fee78: fffffd7ff53b7fb3 fffffd7ffe9ff190
    Instructions: (pc=0x000000000028a89d)
    0x000000000028a87d:
    [error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xb]
    Register to memory mapping:
    RAX=0x000000000028a89d is an unknown value
    RBX=0x0000000000000001 is an unknown value
    RCX=0x0000000002b27ea0 is an unknown value
    RDX=0x474e5543432b2b00 is an unknown value
    RSP=0xfffffd7ffe9fec88 is pointing into the stack for thread: 0x000000000041e000
    RBP=0xfffffd7ffe9fee30 is pointing into the stack for thread: 0x000000000041e000
    RSI=0x0000000000000001 is an unknown value
    RDI=0x0000000000000001 is an unknown value
    R8 =0xfffffd7ffe9fecb0 is pointing into the stack for thread: 0x000000000041e000
    R9 =0xfffffd7fbfeb8e60: _ZTSN5DbXml23DbXmlDebugHookDecoratorE+0x13040 in /home/test/srv/bdbxml.smartos_jdk7/lib/libdbxml-2.5.so at 0xfffffd7fbfc00000
    R10=0x0000000000000434 is an unknown value
    R11=0xfffffd7fff202df0: memcpy+0x60 in /lib/amd64/libc.so.1 at 0xfffffd7fff190000
    R12=0x0000000002b27ec0 is an unknown value
    R13=0x0000000000000002 is an unknown value
    R14=0x0000000000000001 is an unknown value
    R15=0x0000000002b28630 is an unknown value
    Stack: [0xfffffd7ffe800000,0xfffffd7ffea00000], sp=0xfffffd7ffe9fec88, free space=2043k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C 0x000000000028a89d
    C [libc.so.1+0x11302f] SUNW_Unwind_RaiseException+0x50
    C [libstdc++.so.6.0.13+0x1380db] __cxa_throw+0x9b
    C [libdbxml-2.5.so+0x281442] DbXml::SyntaxDatabase::SyntaxDatabase(const DbXml::Syntax(_db_env*, DbXml::Transaction(std::basic_string < char, std::char_traits, std::allocator >, bool, const DbXml::ContainerConfig(bool)&)*)*)+0x33a
    C [libdbxml-2.5.so+0x23be1d] DbXml::Container::openIndexDbs(DbXml::Transaction(const DbXml::ContainerConfig&)*)+0x203
    C [libdbxml-2.5.so+0x23c5a5] DbXml::Container::openInternal(DbXml::Transaction(const DbXml::ContainerConfig(bool)&)*)+0x649
    C [libdbxml-2.5.so+0x23ce52] DbXml::Container::Container(DbXml::Manager(std::basic_string < char, std::char_traits, std::allocator >, DbXml::Transaction(const DbXml::ContainerConfig(bool)&)*)&)+0x212
    C [libdbxml-2.5.so+0x26e2f1] DbXml::Manager::ContainerStore::findContainer(void&, std::basic_string < char, std::char_traits, std::allocator >, DbXml::Transaction(const DbXml::ContainerConfig(bool)&)*)+0xb7
    C [libdbxml-2.5.so+0x26e4b9] DbXml::Manager::openContainer(std::basic_string < char, std::char_traits, std::allocator >, DbXml::Transaction(const DbXml::ContainerConfig(bool)&)*)+0x11b
    C [libdbxml-2.5.so+0x28fa45] DbXml::XmlManager::openContainer(std::basic_string < char, std::char_traits, std::allocator >, const DbXml::XmlContainerConfig&)+0x73
    C [libdbxml_java-2.5.so+0x61b68] Java_com_sleepycat_dbxml_dbxml_1javaJNI_XmlManager_1openContainerInternal_1_1SWIG_10+0x106
    j com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_openContainerInternal__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;[ILjava/lang/String;)J+0
    j com.sleepycat.dbxml.XmlManager.openContainerInternal(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlContainerConfig;)Lcom/sleepycat/dbxml/XmlContainer;+18
    j com.sleepycat.dbxml.XmlManager.openContainer(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlContainerConfig;)Lcom/sleepycat/dbxml/XmlContainer;+3
    j com.lightspoke.dbx.dao.DbxContainerManager.()V+411
    j com.lightspoke.dbx.service.DbxRMIEngine.()V+45
    j com.lightspoke.dbx.service.DbxRMIEngine.main([Ljava/lang/String;)V+29
    v ~StubRoutines::call_stub
    V [libjvm.so+0x54e5d1] void JavaCalls::call_helper(JavaValue*,methodHandle*,JavaCallArguments*,Thread*)+0x5d1
    V [libjvm.so+0x54e81b] void JavaCalls::call(JavaValue*,methodHandle,JavaCallArguments*,Thread*)+0x2b
    V [libjvm.so+0x638695] jni_CallStaticVoidMethod+0x5c1
    C [libjli.so+0x4d83] JavaMain+0x5e7
    C [libc.so.1+0x10cfaa] _thrp_setup+0x8a
    C [libc.so.1+0x10d2c0] _lwp_start+0x0
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_openContainerInternal__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;[ILjava/lang/String;)J+0
    j com.sleepycat.dbxml.XmlManager.openContainerInternal(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlContainerConfig;)Lcom/sleepycat/dbxml/XmlContainer;+18
    j com.sleepycat.dbxml.XmlManager.openContainer(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlContainerConfig;)Lcom/sleepycat/dbxml/XmlContainer;+3
    j com.lightspoke.dbx.dao.DbxContainerManager.()V+411
    j com.lightspoke.dbx.service.DbxRMIEngine.()V+45
    j com.lightspoke.dbx.service.DbxRMIEngine.main([Ljava/lang/String;)V+29
    v ~StubRoutines::call_stub
    P R O C E S S
    Java Threads: ( => current thread )
    0x0000000002410000 JavaThread "Socket Server Thread-2" [_thread_in_native, id=20, stack(0xfffffd7ff4000000,0xfffffd7ff4200000)]
    0x0000000002405000 JavaThread "KaRMI Object Queue" daemon [_thread_blocked, id=19, stack(0xfffffd7ff4400000,0xfffffd7ff4600000)]
    0x00000000021eb800 JavaThread "Service Thread" daemon [_thread_blocked, id=17, stack(0xfffffd7ff4800000,0xfffffd7ff4a00000)]
    0x00000000021e9800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=16, stack(0xfffffd7ffe6ef000,0xfffffd7ffe7ef000)]
    0x00000000021e6800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=15, stack(0xfffffd7ffec0f000,0xfffffd7ffed0f000)]
    0x00000000021e4800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=14, stack(0xfffffd7ff4c00000,0xfffffd7ff4e00000)]
    0x000000000217b800 JavaThread "Finalizer" daemon [_thread_blocked, id=13, stack(0xfffffd7ff5000000,0xfffffd7ff5200000)]
    0x0000000002174800 JavaThread "Reference Handler" daemon [_thread_blocked, id=12, stack(0xfffffd7ffe000000,0xfffffd7ffe200000)]
    =>0x000000000041e000 JavaThread "main" [_thread_in_native, id=2, stack(0xfffffd7ffe800000,0xfffffd7ffea00000)]
    Other Threads:
    0x000000000216c000 VMThread [stack: 0xfffffd7ffe2af000,0xfffffd7ffe3af000] [id=11]
    0x0000000002205800 WatcherThread [stack: 0xfffffd7ffdeff000,0xfffffd7ffdfff000] [id=18]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    PSYoungGen total 19712K, used 16342K [0x00000000eaa00000, 0x00000000ec000000, 0x0000000100000000)
    eden space 16896K, 96% used [0x00000000eaa00000,0x00000000eb9f5a00,0x00000000eba80000)
    from space 2816K, 0% used [0x00000000ebd40000,0x00000000ebd40000,0x00000000ec000000)
    to space 2816K, 0% used [0x00000000eba80000,0x00000000eba80000,0x00000000ebd40000)
    ParOldGen total 43008K, used 0K [0x00000000c0000000, 0x00000000c2a00000, 0x00000000eaa00000)
    object space 43008K, 0% used [0x00000000c0000000,0x00000000c0000000,0x00000000c2a00000)
    PSPermGen total 22528K, used 7661K [0x00000000bae00000, 0x00000000bc400000, 0x00000000c0000000)
    object space 22528K, 34% used [0x00000000bae00000,0x00000000bb57b450,0x00000000bc400000)
    Card table byte_map: [0xfffffd7ff8c00000,0xfffffd7ff8e2a000] byte_map_base: 0xfffffd7ff8629000
    Polling page: 0xfffffd7fff000000
    Code Cache [0xfffffd7ff9000000, 0xfffffd7ff9400000, 0xfffffd7ffc000000)
    total_blobs=371 nmethods=41 adapters=283 free_code_cache=48554Kb largest_free_block=49715392
    Compilation events (10 events):
    Event: 0.848 Thread 0x00000000021e9800 nmethod 34 0xfffffd7ff9072a90 code [0xfffffd7ff9072be0, 0xfffffd7ff9072c78]
    Event: 0.848 Thread 0x00000000021e9800 35 java.util.ArrayList::get (11 bytes)
    Event: 0.848 Thread 0x00000000021e9800 nmethod 35 0xfffffd7ff90788d0 code [0xfffffd7ff9078a20, 0xfffffd7ff9078ad8]
    Event: 0.854 Thread 0x00000000021e9800 36 ! sun.misc.URLClassPath$JarLoader::getResource (91 bytes)
    Event: 0.894 Thread 0x00000000021e9800 nmethod 36 0xfffffd7ff9080490 code [0xfffffd7ff9080840, 0xfffffd7ff9082128]
    Event: 0.907 Thread 0x00000000021e9800 37 java.io.UnixFileSystem::parentOrNull (118 bytes)
    Event: 0.917 Thread 0x00000000021e9800 nmethod 37 0xfffffd7ff907ddd0 code [0xfffffd7ff907df40, 0xfffffd7ff907e598]
    Event: 0.968 Thread 0x00000000021e6800 nmethod 32 0xfffffd7ff908bf50 code [0xfffffd7ff908c660, 0xfffffd7ff90909c8]
    Event: 1.019 Thread 0x00000000021e9800 38 java.util.Arrays::copyOf (19 bytes)
    Event: 1.021 Thread 0x00000000021e9800 nmethod 38 0xfffffd7ff908a250 code [0xfffffd7ff908a3a0, 0xfffffd7ff908a578]
    GC Heap History (0 events):
    No events
    Deoptimization events (6 events):
    Event: 0.351 Thread 0x000000000041e000 Uncommon trap -34 fr.pc 0xfffffd7ff9062f04
    Event: 0.352 Thread 0x000000000041e000 Uncommon trap -34 fr.pc 0xfffffd7ff9062f04
    Event: 0.438 Thread 0x000000000041e000 Uncommon trap -83 fr.pc 0xfffffd7ff9067068
    Event: 0.638 Thread 0x000000000041e000 Uncommon trap -83 fr.pc 0xfffffd7ff9067908
    Event: 0.668 Thread 0x000000000041e000 Uncommon trap -83 fr.pc 0xfffffd7ff9076094
    Event: 0.669 Thread 0x000000000041e000 Uncommon trap -12 fr.pc 0xfffffd7ff9065848
    Internal exceptions (10 events):
    Event: 1.079 Thread 0x000000000041e000 Threw 0x00000000eb94b5b8 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.563 Thread 0x000000000041e000 Threw 0x00000000eb972960 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.564 Thread 0x000000000041e000 Threw 0x00000000eb9756c0 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.564 Thread 0x000000000041e000 Threw 0x00000000eb97fc60 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.565 Thread 0x000000000041e000 Threw 0x00000000eb983ed0 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.565 Thread 0x000000000041e000 Threw 0x00000000eb98d390 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.566 Thread 0x000000000041e000 Threw 0x00000000eb992830 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.566 Thread 0x000000000041e000 Threw 0x00000000eb996070 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.567 Thread 0x000000000041e000 Threw 0x00000000eb9a1d10 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Event: 1.738 Thread 0x000000000041e000 Threw 0x00000000eb9a6840 at /export/HUDSON/workspace/jdk7u25-2-build-solaris-amd64-product/jdk7u25/hotspot/src/share/vm/prims/jvm.c
    Events (10 events):
    Event: 1.565 loading class 0x0000000002a678c0
    Event: 1.565 loading class 0x0000000002a678c0 done
    Event: 1.566 loading class 0x0000000002a67960
    Event: 1.566 loading class 0x0000000002a67960 done
    Event: 1.566 loading class 0x00000000022d9f00
    Event: 1.566 loading class 0x00000000022d9f00 done
    Event: 1.567 loading class 0x0000000002a67eb0
    Event: 1.567 loading class 0x0000000002a67eb0 done
    Event: 1.738 loading class 0x00000000022d9d40
    Event: 1.738 loading class 0x00000000022d9d40 done
    Dynamic libraries:
    0x0000000000400000 /opt/local/jdk1.7.0_25/bin/amd64/dbxrmijvm
    0xfffffd7ffd85c000 /usr/lib/amd64/libthread.so.1
    0xfffffd7ffd700000 /opt/local/jdk1.7.0_25/bin/amd64/../../jre/lib/amd64/jli/libjli.so
    0xfffffd7ffe56f000 /usr/lib/amd64/libdl.so.1
    0xfffffd7fff190000 /usr/lib/amd64/libc.so.1
    0xfffffd7ffc1a0000 /opt/local/jdk1.7.0_25/jre/lib/amd64/server/libjvm.so
    0xfffffd7ffea40000 /usr/lib/amd64/libsocket.so.1
    0xfffffd7ffd85b000 /usr/lib/amd64/libsched.so.1
    0xfffffd7ffc180000 /usr/lib/amd64/libm.so.1
    0xfffffd7ffc150000 /usr/lib/amd64/libCrun.so.1
    0xfffffd7ffdaef000 /usr/lib/amd64/libdoor.so.1
    0xfffffd7ffc110000 /usr/lib/amd64/libdemangle.so.1
    0xfffffd7ffeee0000 /usr/lib/amd64/libm.so.2
    0xfffffd7ffed10000 /usr/lib/amd64/libnsl.so.1
    0xfffffd7ffeab0000 /usr/lib/amd64/libmd.so.1
    0xfffffd7ffea90000 /usr/lib/amd64/libmp.so.2
    0xfffffd7ffc0f0000 /opt/local/jdk1.7.0_25/jre/lib/amd64/libverify.so
    0xfffffd7ffc0a0000 /opt/local/jdk1.7.0_25/jre/lib/amd64/libjava.so
    0xfffffd7ffe670000 /usr/lib/amd64/libscf.so.1
    0xfffffd7ffeba0000 /usr/lib/amd64/libuutil.so.1
    0xfffffd7ffead0000 /usr/lib/amd64/libgen.so.1
    0xfffffd7ffedb0000 /usr/lib/amd64/libnvpair.so.1
    0xfffffd7ffe650000 /usr/lib/amd64/libsmbios.so.1
    0xfffffd7ffc070000 /opt/local/jdk1.7.0_25/jre/lib/amd64/libzip.so
    0xfffffd7ffc040000 /opt/local/jdk1.7.0_25/jre/lib/amd64/libnet.so
    0xfffffd7ffc020000 /opt/local/jdk1.7.0_25/jre/lib/amd64/libnio.so
    0xfffffd7ffeb20000 /usr/lib/amd64/librt.so.1
    0xfffffd7ffc000000 /usr/lib/amd64/libsendfile.so.1
    0xfffffd7ffdd30000 /home/test/srv/bdbxml.smartos_jdk7/lib/libdb_java-4.8.so
    0xfffffd7ffdb60000 /usr/lib/amd64/libresolv.so.2
    0xfffffd7ffeacd000 /usr/lib/amd64/libpthread.so.1
    0xfffffd7ffe630000 /usr/lib/amd64/libgcc_s.so.1
    0xfffffd7ffe220000 /home/test/srv/bdbxml.smartos_jdk7/lib/libdbxml_java-2.5.so
    0xfffffd7ffd950000 /home/test/srv/bdbxml/lib/libdb-4.8.so
    0xfffffd7fc0400000 /home/test/srv/bdbxml/lib/libxqilla.so.5
    0xfffffd7fc0000000 /home/test/srv/bdbxml/lib/libxerces-c-3.0.so
    0xfffffd7fbfc00000 /home/test/srv/bdbxml/lib/libdbxml-2.5.so
    0xfffffd7ff5280000 /usr/lib/amd64/libstdc++.so.6
    VM Arguments:
    jvm_args: -Xss2048k -Djava.library.path=/home/test/srv/bdbxml/lib:/home/test/bdb/lib:/usr/lib:/usr/local/lib:/lib:/usr/lib/amd64: -Djava.rmi.server.codebase=/home/test/srv/lib/dbxrmi.jar -Duka.karmi.config=/home/test/srv/adm/.karmi.property -Djava.rmi.server.hostname=test.gaoxiong -Djava.security.policy=/home/test/adm/DbxRMI.policy -Dlog4j.configuration=file:/home/test/adm/log4j.xml
    java_command: com.lightspoke.dbx.service.DbxRMIEngine
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=/opt/local/java
    PATH=/opt/local/java/bin:/home/test/srv/bdbxml/bin:/opt/local/java/bin:/home/test/srv/bdbxml/bin:/opt/local/java/bin:/home/test/srv/bdbxml/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin:/home/test/srv/bdbxml/bin:
    LD_LIBRARY_PATH=/home/test/srv/bdbxml/lib:/home/test/bdb/lib:/usr/lib:/usr/local/lib:/lib:/usr/lib/amd64:
    SHELL=/bin/bash
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x11b37b4], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGBUS: [libjvm.so+0x11b37b4], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGFPE: [libjvm.so+0x53fc78], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGPIPE: [libjvm.so+0x53fc78], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGXFSZ: [libjvm.so+0x53fc78], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGILL: [libjvm.so+0x53fc78], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGQUIT: [libjvm.so+0xff8ea8], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGHUP: [libjvm.so+0xff8ea8], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGINT: [libjvm.so+0xff8ea8], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGTERM: [libjvm.so+0xff8ea8], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIG39: [libjvm.so+0xffd27c], sa_mask[0]=0x00000000, sa_flags=0x00000008
    SIG40: [libjvm.so+0x53fc78], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    S Y S T E M
    OS: SmartOS x86_64
    Copyright 2010 Sun Microsystems, Inc. All Rights Reserved.
    Copyright 2010-2012 Joyent, Inc. All Rights Reserved.
    Use is subject to license terms.
    See uname -v for assembly date and time.
    uname:SunOS 5.11 joyent_20130530T224720Z i86pc
    (T2 libthread)
    rlimit: STACK 10240k, CORE infinity, NOFILE 65536, AS infinity
    load average:0.01 0.00 0.00
    CPU:total 8 (4 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, tsc
    Memory: 4k page, physical 4194304k(4142372k free)
    vm_info: Java HotSpot(TM) 64-Bit Server VM (23.25-b01) for solaris-amd64 JRE (1.7.0_25-b15), built on Jun 5 2013 21:57:39 by "" with Sun Studio 12u1
    time: Tue Aug 6 01:12:44 2013
    elapsed time: 2 seconds

  • Several alchemy libraries in one swf?

    Hello!
    I've sucessfuly compiled several c/c++ libraries into SWC libraries which I plan to use in my flex project. But I'm wondering is it beter to keep them as separate libraries or make one big glue.gg file with all interop code for all of this libraries?

    Because Alchemy uses statics to keep track of its ram, etc, you sort of can't have more than one instance.  The libraries would be sharing the same ram, which can cause problems.
    However, you can dodge the issue by loading your alchemy libraries into separate Application Domains.  I'm doing this in my project:
    Compile your libs as SWCs
    Extract the SWFs from inside the SWCs
    Embed the library SWFs in your application
    Use Loader.loadBytes to load your library into its own Application Domain
    The other benefit of doing it this way is that if your alchemy lib crashes it won't affect any other alchemy libraries because they're using entirely separate ByteArrays for ram, etc.

  • Native library loading problem

    Hi Folks,
    I currently downloaded, and compiled the bDB core using VS 2010 x64 (I run 64 bit win7, and JRE 64 bit). In Eclipse I'm trying to use the native library (setting up the path correctly), however the java is complaining that it cannot find dependencies.
    I switched to JE, it works fine, but I'm not sure if JE is as performant as the core version. Anybody had the same problem?
    thanks in advance
    Edited by: user5493457 on Mar 22, 2011 3:35 AM

    Hi,
    Please review the building process of the Berkeley DB libraries, to ensure you have correctly built them. Review Building Berkeley DB for Windows, Building the Java API and Java configuration. If you want to build 64-bit libraries, make sure you select x64 as platform configuration in Visual Studio when building.
    I assume you are getting a java.lang.UnsatisfiedLinkError exception at runtime. Just to make sure Eclipse correctly finds the native BDB libraries, in your Run Configuration for the project you're trying to run, under Environment, add a new variable, LD_LIBRARY_PATH with a value of something like D:\BerkeleyDB\db-5.1.25\build_windows\x64\Debug (substitute Debug with Release depending on how you built the libraries) -- this is the path to the location of the native BDB libs, libdb51d.dll and libdb_java51d.dll (or libdb51.dll and libdb_java51.dll), so you should change it as appropriate for your system.
    Also, for that Run Configuration add a new variable, CLASSPATH with a value of something like D:\BerkeleyDB\db-5.1.25\build_windows\x64\Debug\db.jar;D:\BerkeleyDB\db-5.1.25\build_windows\x64\Debug\classes (this is the path to the Java API classes and the Java API jar file -- db.jar). Make sure that "Append environment to native environment" option is checked, in the Run Configurations screen.
    Regards,
    Andrei

  • Berkeley DB on Windows Cluster

    Does anyone have experience running a Windows service that uses Berkeley DB on a typical active/passive Windows Cluster with shared disks? Is it even possible with Berkeley DB? Just to avoid confusion, I am not talking about replication, but about a failover situation, where one instance of the service gets deactivated, another one activated, and both would access the same (shared) RAID5 disk array which holds the BDB database files.
    Karl

    Hi Karl,
    Berkeley DB has not been tested on Windows clusters
    and so it is not an officially supported platform.
    Here's my understanding of the scenario:
    There are two nodes that are connected to the same
    shared disk. One of the nodes is active, and the
    other is a passive standby. The Berkeley DB
    application is running on one node and accessing data
    on the shared disk. When the primary fails, the
    Windows cluster services (I believe it used to be
    called Wolfpack?) will allow you to failover the
    application to the other (passive) node and continue
    processing. There are also services to fail back,
    once the original node is restarted.Yes, that is correct.
    >
    I believe that Windows cluster services will control
    access to the disk and ensure that BDB running on the
    passive node will only access the disk when the
    primary fails.Yes. Actually, the passive node has no control over the
    shared disk, so the BDB application can only open the
    environment after the passive node becomes active and
    gains access to the shared disk.
    So, I'm tempted to say that this scenario should
    work, assuming you're using Windows services
    correctly. To my knowledge, there's nothing in
    Berkeley DB to prevent this usage. On the other
    hand, you'll be relying on the underlying OS services
    to give the correct semantics wrt. accessing the
    shared storage. For example, if BOTH nodes were to
    write to the shared storage, you will most likely get
    data corruption, since BDB does not synchronize disk
    access ACROSS nodes.That will not happen, as the services on the passive node have
    no access to the shared disk.
    I'll continue to ask around for a better answer. In
    the meantime, I'd encourage you to continue your
    testing and keep us posted. If you prefer, you can
    contact me directly at ashok dot joshi at oracle dot
    com.Thanks for your feedback.
    My current theory is that a failover is equivalent to a
    BDB application crashing and being restarted.
    So one has to re-open the environment and run recovery
    before continuing work.
    Karl

  • IPhoto importing pictures and turning royal blue. Why?

    I copied jpg files from a cd to my husband's pc and then wrote these
    pics to a flash drive. I then copied the folder from the flash drive
    and pasted folder to my imac's desktop. Preview shows the files
    as black line drawings on a white background. After importing
    these files to iPhoto, the background changes from white to royal
    blue. Why is this happening?

    Well, "Old Toad", you are my hero of the day. I went to your cellar and downloaded "convert to jpg and embed srgb profile.zip", dragged it to my desktop, dropped a desktop pic into it, imported the pic to
    Iphoto, and "wala" a black line drawing with a WHITE background. TADA. So, since I have a copy of the whole file, "Redwork for Iphoto" on my desktop, which has 100 jpgs in it, should I use your cellar's
    "embed srgb profile2.zip" or embed srgb profile--Apple script.zip" which is lossless for the whole file?
    The file has 100 jpg's that are designs from "Redwork from the WorkBasket", that are pics of the Redwork designs for my embroidery machines. The designs are designed to be embroidered with red thread and the pics in the book are red line drawings on a white background. I have several thousand designs, now, organized into albums (with category dividers) in Iphoto, which I sync to my iphone, so I can see what I have and can use on my embroidery machines. This is the first batch of designs from either the web or from purchased cd's where I have encountered the rgb issue. The royal blue background makes the photos hard to see on my iphone, and you have a way for me to
    "redo" my import process, which will be easy. THANKS..
    PS I think you helped me with Iphoto, once, when my iphoto lib crashed, after I bought my first Apple product 3+ years ago--an imac. I too, live in Temecula. Do you happen to know if there is an
    Apple user group in the area?
    PSS If I owned Bernina's Designer Plus software (which I don't, yet), I would offer to thank you by embroidering your Old Toad pic onto a sweatshirt. If you have any free time, you might stop by
    Temecula Valley Sewing Center and ask either Aileen or Brian if one of their customers could do that for you.
    THANKS AGAIN.

  • SQLite: Assertion failed: db==0 || sqlite3_mutex_held(db- mutex) error

    Hi
    I am current using Berkeley DB version 5.2.36.
    I am getting the Assertion failed: db==0 || sqlite3_mutex_held(db->mutex), file ../lang/sql/generated/sqlite3.c, line 18058 error when I try to execute a 'delete from table' query.
    Please find the stack trace info
    gdb) bt
    #0 0x200000006612a1b0:0 in lwpkill+0x30 ()
    from /usr/lib/hpux32/libpthread.so.1
    #1 0x2000000066093a10:0 in pthread_kill+0x8d0 ()
    from /usr/lib/hpux32/libpthread.so.1
    #2 0x20000000658d05a0:0 in raise+0xe0 () from /usr/lib/hpux32/libc.so.1
    #3 0x20000000659f0cd0:0 in abort+0x170 () from /usr/lib/hpux32/libc.so.1
    #4 0x200000006589b730:0 in _assert+0x260 () from /usr/lib/hpux32/libc.so.1
    #5 0x20000000664b4480:0 in sqlite3DbMallocRaw+0xe0 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #6 0x2000000066505070:0 in sqlite3VdbeRecordUnpack+0x130 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #7 0x2000000066504470:0 in btreeCompare+0x830 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #8 0x2000000066505cf0:0 in btreeCompareShared+0xe0 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #9 0x2000000066c0b1f0:0 in __db_moff+0x280 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #10 0x20000000666b4f70:0 in __bam_cmp+0x8e0 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #11 0x2000000066774640:0 in __bam_search+0x1400 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #12 0x20000000666f0060:0 in __bamc_physdel+0x1a20 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    ---Type <return> to continue, or q <return> to quit---
    #13 0x20000000666e27a0:0 in __bamc_close+0x1550 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #14 0x2000000066b6d9f0:0 in __dbc_close+0xa50 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #15 0x2000000066bd3390:0 in __dbc_close_pp+0xd80 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #16 0x200000006651b140:0 in sqlite3BtreeDelete+0xab0 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #17 0x2000000066594050:0 in sqlite3VdbeExec+0x27050 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #18 0x200000006656c650:0 in sqlite3Step+0x870 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #19 0x2000000066499370:0 in sqlite3_step+0x150 ()
    from /scm/vobs/stgFINPI/rpconv/bdb/lib/HPUX_IA_1131/libdb_sql-5.2.so
    #20 0x400ad20:0 in exec () at testCounter.cpp:71
    #21 0x4014490:0 in truncate () at testCounter.cpp:348
    #22 0x200000006605abc0:0 in __pthread_bound_body+0x190 ()
    from /usr/lib/hpux32/libpthread.so.1
    A sample code to reproduce the above error can also be provided if required.
    Thanks

    Actually on trying again I am noticing:
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:6 erno
    Deleted ::::::::::::::: 54
    writing........55
    ERROR: AsserFailTest: statement aborts at 27: [insert into ctable values(550,'55','xxxxx','550','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    It would be better to have a test that only reproduces the one assert in question
    SQLite: Assertion failed: db==0 || sqlite3_mutex_held(db->mutex) error
    Please verify that I am running the test in a way to get the reported assert.
    Thanks,
    Sandra                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Join query problem

    Hi all,
    I'm new to Berkeley DB and apologise if the answer to my question has been covered elsewhere.
    I've been using the 'Getting Started Guide' (BerkeleyDB-Core-Cxx-GSG.pdf) to familiarise myself with the C++ API. The document has been vastly useful, but it has left me stranded on the subject of join queries. I have used the example in the guide (p 57) carefully to construct my join query between two secondary databases, but I get a segmentation fault that doesn't seem to originate from within my code. The GDB backtrace shows:
    (gdb) backtrace
    #0 0x007fbffb in __db_c_count () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #1 0x00807aef in __db_join_cmp () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #2 0x0013c1af in msort_with_tmp () from /lib/libc.so.6
    #3 0x0013c0a7 in msort_with_tmp () from /lib/libc.so.6
    #4 0x0013c360 in qsort () from /lib/libc.so.6
    #5 0x00806de6 in __db_join () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #6 0x00804384 in __db_join_pp () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #7 0x0079070b in Db::join () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #8 0x0804a9fe in show_join ()
    #9 0x0804a165 in main ()
    The code that I have written to perform the join query looks like:
    int show_join(MyDb &itemnameSDB, MyDb &catnameSDB,
         std::string &itemName, std::string &categoryName)
    std::cout << "Have item : " << itemName << " and category : "
         << categoryName << std::endl;
    // Position cursor at item
    int ret;
    Dbc *item_curs;
    Dbt key, data;
    try {
    itemnameSDB.getDb().cursor(NULL, &item_curs, 0);
    char * c_item = (char *)itemName.c_str();
    key.set_data(c_item);
    key.set_size(strlen(c_item) + 1);
    if ((ret = item_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching item ["
              << c_item << "]" << std::endl;
    catch(DbException &e) {        
    itemnameSDB.getDb().err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    itemnameSDB.getDb().errx("Error! %s", e.what());
    // Position cursor at category
    Dbc *category_curs;
    try {
    catnameSDB.getDb().cursor(NULL, &category_curs, 0);
    char c_category = (char )categoryName.c_str();
    key.set_data(c_category);
    key.set_size(strlen(c_category) + 1);
    if ((ret = category_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching category ["
              << c_category << "]" << std::endl;
    catch(DbException &e) {        
    catnameSDB.getDb().err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    catnameSDB.getDb().errx("Error! %s", e.what());
    // Set up an array of cursors ready for the join
    Dbc *carray[3];
    carray[0] = item_curs;
    carray[1] = category_curs;
    carray[3] = NULL;
    // Perform the join
    Dbc *join_curs;
    try {
    if ((ret = itemnameSDB.getDb().join(carray, &join_curs, 0)) != 0)
         std::cout << "Successful query results should go here." << std::endl;
    catch(DbException &e) {        
    itemnameSDB.getDb().err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    itemnameSDB.getDb().errx("Error! %s", e.what());
    // Iterate through results using the join cursor
    while ((ret = join_curs->get(&key, &data, 0)) == 0)
    std::cout << "Iterating through cursors" << std::endl;
    // If we exited the loop because we ran out of records,
    // then it has completed successfully.
    if (ret == DB_NOTFOUND)
    item_curs->close();
    category_curs->close();
    join_curs->close();
    return(0);
    The seg fault occurs at the line in the final try/catch block where the Db.join() call is made.
    It seems highly likely that I am making a simple mistake due to inexperience (both with Berkeley DB and C++) and am hoping that the problem glares out at someone with deeper knowledge.
    I'm running this under linux if this makes any difference.
    Many thanks for reading this far,
    Dan

    Hi Keith,
    The following test program isn't pretty, but should produce the seg fault that I'm seeing. Much of the code is copy-and-pasted from the C++ API guide. It will need some input data to run - and presumably create the correct error. Save the following as ./small_inventory.txt (this is also just hacked from the guide):
    Oranges#OranfruiRu6Ghr#0.71#451#fruits#TriCounty Produce
    Spinach#SpinvegeVcqXL6#0.11#708#vegetables#TriCounty Produce
    Banana Split#Banadessfif758#11.07#14#desserts#The Baking Pan
    Thanks for your help,
    Dan
    Code follows:
    #include <db_cxx.h>
    #include <iostream>
    #include <fstream>
    #include <cstdlib>
    class InventoryData
    public:
    inline void setPrice(double price) {price_ = price;}
    inline void setQuantity(long quantity) {quantity_ = quantity;}
    inline void setCategory(std::string &category) {category_ = category;}
    inline void setName(std::string &name) {name_ = name;}
    inline void setVendor(std::string &vendor) {vendor_ = vendor;}
    inline void setSKU(std::string &sku) {sku_ = sku;}
    inline double& getPrice() {return(price_);}
    inline long& getQuantity() {return(quantity_);}
    inline std::string& getCategory() {return(category_);}
    inline std::string& getName() {return(name_);}
    inline std::string& getVendor() {return(vendor_);}
    inline std::string& getSKU() {return(sku_);}
    /* Initialize our data members */
    void clear()
    price_ = 0.0;
    quantity_ = 0;
    category_ = "";
    name_ = "";
    vendor_ = "";
    sku_ = "";
    // Default constructor
    InventoryData() { clear(); }
    // Constructor from a void *
    // For use with the data returned from a bdb get
    InventoryData(void *buffer)
    char buf = (char )buffer;
    price_ = *((double *)buf);
    bufLen_ = sizeof(double);
    quantity_ = *((long *)(buf + bufLen_));
    bufLen_ += sizeof(long);
    name_ = buf + bufLen_;
    bufLen_ += name_.size() + 1;
    sku_ = buf + bufLen_;
    bufLen_ += sku_.size() + 1;
    category_ = buf + bufLen_;
    bufLen_ += category_.size() + 1;
    vendor_ = buf + bufLen_;
    bufLen_ += vendor_.size() + 1;
    * Marshalls this classes data members into a single
    * contiguous memory location for the purpose of storing
    * the data in a database.
    char *
    getBuffer()
    // Zero out the buffer
    memset(databuf_, 0, 500);
    * Now pack the data into a single contiguous memory location for
    * storage.
    bufLen_ = 0;
    int dataLen = 0;
         dataLen = sizeof(double);
         memcpy(databuf_, &price_, dataLen);
         bufLen_ += dataLen;
         dataLen = sizeof(long);
         memcpy(databuf_ + bufLen_, &quantity_, dataLen);
         bufLen_ += dataLen;
    packString(databuf_, name_);
    packString(databuf_, sku_);
    packString(databuf_, category_);
    packString(databuf_, vendor_);
    return (databuf_);
    * Returns the size of the buffer. Used for storing
    * the buffer in a database.
    inline size_t getBufferSize() { return (bufLen_); }
    /* Utility function used to show the contents of this class */
    void
    show() {
    std::cout << "\nName: " << name_ << std::endl;
    std::cout << " SKU: " << sku_ << std::endl;
    std::cout << " Price: " << price_ << std::endl;
    std::cout << " Quantity: " << quantity_ << std::endl;
    std::cout << " Category: " << category_ << std::endl;
    std::cout << " Vendor: " << vendor_ << std::endl;
    private:
    * Utility function that appends a char * to the end of
    * the buffer.
    void
    packString(char *buffer, std::string &theString)
    size_t string_size = theString.size() + 1;
    memcpy(buffer+bufLen_, theString.c_str(), string_size);
    bufLen_ += string_size;
    /* Data members */
    std::string category_, name_, vendor_, sku_;
    double price_;
    long quantity_;
    size_t bufLen_;
    char databuf_[500];
    //Forward declarations
    void loadDB(Db &, std::string &);
    int get_item_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey);
    int get_category_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey);
    int show_join(Db &item_index, Db &category_index,
         std::string &itemName, std::string &categoryName);
    int main (){
    Db primary_database(NULL, 0); // Primary
    Db item_index(NULL, 0); // Secondary
    Db category_index(NULL, 0); // Secondary
    // Open the primary database
    primary_database.open(NULL,
                   "inventorydb.db",
                   NULL,
                   DB_BTREE,
                   DB_CREATE,
                   0);
    /* // Setup the secondary to use sorted duplicates.
    // This is often desireable for secondary databases.
    item_index.set_flags(DB_DUPSORT);
    category_index.set_flags(DB_DUPSORT);
    // Open secondary databases
    item_index.open(NULL,
              "itemname.sdb",
              NULL,
              DB_BTREE,
              DB_CREATE,
              0);
    category_index.open(NULL,
              "categoryname.sdb",
              NULL,
              DB_BTREE,
              DB_CREATE,
              0);
    // Associate the primary and the secondary dbs
    primary_database.associate(NULL,
                   &item_index,
                   get_item_name,
                   0);
    primary_database.associate(NULL,
                   &category_index,
                   get_category_name,
                   0);
    // Load database
    std::string input_file = "./small_inventory.txt";
    try {
    loadDB(primary_database, input_file);
    } catch(DbException &e) {
    std::cerr << "Error loading databases. " << std::endl;
    std::cerr << e.what() << std::endl;
    return (e.get_errno());
    } catch(std::exception &e) {
    std::cerr << "Error loading databases. " << std::endl;
    std::cerr << e.what() << std::endl;
    return (-1);
    // Perform join query
    std::string itemName = "Spinach";
    std::string categoryName = "vegetables";
    show_join(item_index, category_index, itemName, categoryName);
    // Close dbs
    item_index.close(0);
    category_index.close(0);
    primary_database.close(0);
    return(0);
    } // End main
    // Used to locate the first pound sign (a field delimiter)
    // in the input string.
    size_t
    getNextPound(std::string &theString, std::string &substring)
    size_t pos = theString.find("#");
    substring.assign(theString, 0, pos);
    theString.assign(theString, pos + 1, theString.size());
    return (pos);
    // Loads the contents of the inventory.txt file into a database
    void
    loadDB(Db &inventoryDB, std::string &inventoryFile)
    InventoryData inventoryData;
    std::string substring;
    size_t nextPound;
    std::ifstream inFile(inventoryFile.c_str(), std::ios::in);
    if ( !inFile )
    std::cerr << "Could not open file '" << inventoryFile
    << "'. Giving up." << std::endl;
    throw std::exception();
    while (!inFile.eof())
    inventoryData.clear();
    std::string stringBuf;
    std::getline(inFile, stringBuf);
    // Now parse the line
    if (!stringBuf.empty())
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setName(substring);
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setSKU(substring);
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setPrice(strtod(substring.c_str(), 0));
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setQuantity(strtol(substring.c_str(), 0, 10));
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setCategory(substring);
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setVendor(substring);
    void buff = (void )inventoryData.getSKU().c_str();
    size_t size = inventoryData.getSKU().size()+1;
    Dbt key(buff, (u_int32_t)size);
    buff = inventoryData.getBuffer();
    size = inventoryData.getBufferSize();
    Dbt data(buff, (u_int32_t)size);
    inventoryDB.put(NULL, &key, &data, 0);
    inFile.close();
    int
    get_item_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey)
    * First, obtain the buffer location where we placed the item's name. In
    * this example, the item's name is located in the primary data. It is the
    * first string in the buffer after the price (a double) and the quantity
    * (a long).
    u_int32_t offset = sizeof(double) + sizeof(long);
    char itemname = (char )pdata->get_data() + offset;
    // unused
    (void)pkey;
    * If the offset is beyond the end of the data, then there was a problem
    * with the buffer contained in pdata, or there's a programming error in
    * how the buffer is marshalled/unmarshalled. This should never happen!
    if (offset > pdata->get_size()) {
    dbp->errx("get_item_name: buffer sizes do not match!");
    // When we return non-zero, the index record is not added/updated.
    return (-1);
    /* Now set the secondary key's data to be the item name */
    skey->set_data(itemname);
    skey->set_size((u_int32_t)strlen(itemname) + 1);
    return (0);
    int
    get_category_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey)
    * First, obtain the buffer location where we placed the item's name. In
    * this example, the item's name is located in the primary data. It is the
    * first string in the buffer after the price (a double) and the quantity
    * (a long).
    u_int32_t offset = sizeof(double) + sizeof(long);
    char itemname = (char )pdata->get_data() + offset;
    offset += strlen(itemname) + 1;
    char sku = (char )pdata->get_data() + offset;
    offset += strlen(sku) + 1;
    char category = (char )pdata->get_data() + offset;
    // unused
    (void)pkey;
    * If the offset is beyond the end of the data, then there was a problem
    * with the buffer contained in pdata, or there's a programming error in
    * how the buffer is marshalled/unmarshalled. This should never happen!
    if (offset > pdata->get_size()) {
    dbp->errx("get_item_name: buffer sizes do not match!");
    // When we return non-zero, the index record is not added/updated.
    return (-1);
    /* Now set the secondary key's data to be the item name */
    skey->set_data(category);
    skey->set_size((u_int32_t)strlen(category) + 1);
    return (0);
    int
    show_join(Db &itemnameSDB, Db &catnameSDB,
         std::string &itemName, std::string &categoryName)
    std::cout << "Have item : " << itemName << " and category : "
         << categoryName << std::endl;
    // Position cursor at item
    int ret;
    Dbc *item_curs;
    Dbt key, data;
    try {
    itemnameSDB.cursor(NULL, &item_curs, 0);
    char * c_item = (char *)itemName.c_str();
    key.set_data(c_item);
    key.set_size(strlen(c_item) + 1);
    if ((ret = item_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching item ["
              << c_item << "]" << std::endl;
    // while (ret != DB_NOTFOUND)
    //      printf("Database record --\n");
    //     std::cout << "Key : " << (char *)key.get_data() << std::endl;
    //      ret = item_curs->get(&key, &data, DB_NEXT_DUP);
    catch(DbException &e) {        
    itemnameSDB.err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    itemnameSDB.errx("Error! %s", e.what());
    // Position cursor at category
    Dbc *category_curs;
    try {
    catnameSDB.cursor(NULL, &category_curs, 0);
    char c_category = (char )categoryName.c_str();
    key.set_data(c_category);
    key.set_size(strlen(c_category) + 1);
    if ((ret = category_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching category ["
              << c_category << "]" << std::endl;
    //!! Debug, print everything
    // Dbt temp_key, temp_data;
    // while ((ret = category_curs->get(&temp_key, &temp_data, DB_NEXT)) == 0) {        
    // std::cout << "Key : " << (char *)temp_key.get_data() << std::endl;
    catch(DbException &e) {        
    catnameSDB.err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    catnameSDB.errx("Error! %s", e.what());
    // Set up an array of cursors ready for the join
    Dbc *carray[3];
    carray[0] = item_curs;
    carray[1] = category_curs;
    carray[3] = NULL;
    // Perform the join
    Dbc *join_curs;
    try {
    if ((ret = itemnameSDB.join(carray, &join_curs, 0)) != 0)
         std::cout << "Successful query results should go here." << std::endl;
    catch(DbException &e) {        
    itemnameSDB.err(e.get_errno(), "Error[3]!");
    } catch(std::exception &e) {
    itemnameSDB.errx("Error! %s", e.what());
    // Iterate through results using the join cursor
    while ((ret = join_curs->get(&key, &data, 0)) == 0)
    std::cout << "Iterating through cursors" << std::endl;
    // If we exited the loop because we ran out of records,
    // then it has completed successfully.
    if (ret == DB_NOTFOUND)
    item_curs->close();
    category_curs->close();
    join_curs->close();
    return(0);
    }

  • BDB crash question...

    This is a follow-up to the issue I posted here: DB_MULTIVERSION question...
    This also involves a database that is working fine with MVCC enabled. When we turn MVCC off, we are able to reproduce a particular crash in BDB with our particular database setup and only when the databases are filled with a particular set of data. The data in question is a 700MB database, and I'm not sure what about it is causing the crash, but I have trouble reproducing it if I wipe the databases clean and perform the same actions.
    BT:
    (gdb) bt
    #0 0x00002b50a08687bb in __ham_add_dup () from /usr/local/BerkeleyDB.4.7/lib/libdb_cxx-4.7.so
    #1 0x00002b50a085cf1b in __hamc_put () from /usr/local/BerkeleyDB.4.7/lib/libdb_cxx-4.7.so
    #2 0x00002b50a08d06e5 in __dbc_put () from /usr/local/BerkeleyDB.4.7/lib/libdb_cxx-4.7.so
    #3 0x00002b50a08d10de in __dbc_put () from /usr/local/BerkeleyDB.4.7/lib/libdb_cxx-4.7.so
    #4 0x00002b50a08c3cde in __db_put () from /usr/local/BerkeleyDB.4.7/lib/libdb_cxx-4.7.so
    #5 0x00002b50a08dae6c in __db_put_pp () from /usr/local/BerkeleyDB.4.7/lib/libdb_cxx-4.7.so
    #6 0x00002b50a082895c in Db::put () from /usr/local/BerkeleyDB.4.7/lib/libdb_cxx-4.7.so
    CRASH:
    hash_dup.c:132 - return (hcp->opd->am_put(hcp->opd, NULL, nval, flags, NULL));
    opd is NULL.
    INFO:
    We are using the hash access method with a custom hashing function. This particular database has two secondaries attached to it, both of which allow duplicates. We open our environment with DB_CREATE | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_TXN | DB_THREAD | DB_RECOVER | DB_SYSTEM_MEM | DB_INIT_REP. We are not actively using replication (the code is #ifdef'd out).
    What information can I get to you to help us diagnose the cause of this crash? I note that I can re-enable DB_MULTIVERSION and the crash no longer occurs. Thank you very much.

    Hi Shishir,
    newbdb wrote:
    Once it crashed, I was trying to run db_checkpoint before bringing the environment up(with db_recovery) again and db_checkpoint did not come back. Is it because of possible recovery required ?Why would you run db_checkpoint after a crash? There are so many utilities that you can run after a crash (recover, verify, dump, deadlock), but not checkpoint.
    If the application or system crashes, the log is reviewed during recovery (from the last checkpoint in case of normal recovery, or from the first log file available in case of catastrophic recovery). Any database changes described in the log that were part of committed transactions and that were never written to the actual database itself are written to the database as part of recovery. Now, if you are going to write a checkpoint after the crash... normal recovery is not going to work. In case there are problems, the checkpoint may not work, as it happens in your case.
    Thanks,
    Bogdan Coman

  • /var/lib/pacman crashed

    Hi,
    yesterday my filesystem crashed. /var has its own partition. This particulaur
    partition crashed. fsck left me with a corrupted /var/lib/pacman. Some
    entries are deleted. Installing new packages or making new packages fails
    due to some not fullfilled dependencies. In fact this packages are installed.
    Now, whenever a dependency is missed I can easily make pacman -Sf package.
    This helps, but I like to have an repaired database. Any idea/hack is welcome!
    Thanks neri

    Hi,
    apeiro wrote:
    This has happened to a couple other people.  I've always recommended a cronjob that tars up your /var/lib/pacman/local once a night.
    Would you guys want this set up on a default install, or is this better left to the administrator of the system?
    Ok, I got to get myself together. Such a bottle of chianto classico is
    recomended on casual times. It leaves you with a pleasant loss of gravity.
    Regarding your question. I use this particular box as my desktop and boot it
    every day. I did a pacman -Syu at this time booting it. You mentioned other
    people also had a crashed file system. Maybe it is something in pacman,
    maybe something in the tools used by pacman (tar etc.) Is it possible to
    contact other with the same problem? If it occurs more often it should be
    investigated.
    Xentacs post (thanks for that) made me thinking. Maybe it's possible to
    write a shellscript, which uses pacman, the untared package db and the
    find command to restore the local db. It is for experiencend users 'cause
    there is no chance to handle manually installed files (such as nvidia driver
    install script) automatically.
    Should we have a cron job by default? Why not, it doesn't hurt. Loosing
    your local db does hurt. I experienced that. At least, it is _very_ annoying.
    I will think about the shellscript when I'm back to 9.81m/s*s. That's for
    now. Time to go to bed. See ya tomorrow.
    bye neri
    ps. apeiro, I'm not offending mentioning pacman as possible source. The
    chance that it is related to the problem is very little. Maybe it is something
    else. For example, it happened on a true SMP box. Could there be race
    conditions in tar? I don't know. If there are probs they are gonna be really
    hard to track down. We just shouldn't exclude until we really know. Just
    let's keep an eye open.

  • Error Message "Script: chrome://tavgp/content/libs/include.js:595" Choice of "Continue" or "Stop script" When choosing "continue" firefox launches but after a while crashes. Using Windows 7

    Error Message
    "Script: chrome://tavgp/content/libs/include.js:595"
    Choice of "Continue" or "Stop script"
    When choosing "continue" firefox launches but after a while crashes. Using Windows 7

    That is a problem with an AVG extension (toolbar).
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • BDB crashed diplaying realloc message

    Hi,
    I have one critical issue. The application with BDB 4.6.21 is running on HP-UX crashed displaying the following error messages:
    Cache Mgr : realloc: 8264: Not enough space
    Cache Mgr : DB_TXN->abort: log undo failed for LSN: 41 2628895: Not enough space
    Cache Mgr : PANIC: Not enough space
    Cache Mgr : PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
    What's the reason of "realloc" and "Not enough space" error?
    Young

    Hi Young,
    That error indicates that the process is running out of memory. As this happens while attempting to abort a transaction, Berkeley DB cannot continue and panics, leading to the <tt>DB_RUNRECOVERY</tt> message and return.
    Do you know how much memory is available to the process, and how much you expect it to use? The maximum can be controlled on most Unix systems with a combination of the "ulimit" command and kernel parameters ("maxdsiz" on HP-UX).
    Regards,
    Michael Cahill, Oracle Berkeley DB.

  • IPhoto 6.0.5 Crashes when opening after asking to import photos not in lib

    Hi, I wonder if any one can help me with this. Each time i open iPhoto (6.0.5) I get a message stating "67 photos have been found in the iPhoto Library folder that were not imported. Would you like to import them?" if I click yes the program starts to import them then crashes. The next time I try to open the same message appears this time saying 96 photos have been found. Occasionally it will produce a dialogue box stating that some of the photos are duplicates and I check the box to same don't import but it the crashes in the same way. If I click no to the import iPhoto opens fine.
    I have already tried doing a full rebuild of the cache and a repair of the disk permissions but the same problem occurs. Obviously the simplest solution is just to click no but is there any way of finding these photos in my Library and deleting them?
    Black MacBook 2GHz Intel Core Duo, 2GB DDR2 SDRAM OS 10.4.7    

    Hi! Here's what I think is happening:
    - A bad image or file in those 67 photos is causing iPhoto to crash.
    - iPhoto, when it is trying to import, puts those photos in a temporary folder while it organizes the photos into the Originals folder by year and roll, creates thumbnails and does general tasks.
    - Every time it encounters the bad file, it crashes and leaves the import unfinished. On relaunch, it wants to start importing again.
    You have to break the cycle and hopefully find the bad image file. Go into your iPhoto Library and look for a folder called "Import". Remove that folder, or iPhoto will keep trying to import from it. You can manually attempt to import those 67 photos later, to identify the bad file.

Maybe you are looking for