Segment fault in concurrent access to BDB

Hi, All
I am extending a single thread BDB application to allow concurrent
access to the DB from 2 threads, transaction is not needed.
The environment is opened with the flag (DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK).
Then I open a new DB under the same directory in each thread, and
modify the DB simultaneously.  my expectation was that each thread
will not conflict with each other and in turn improve the
throughput. While the program constantly crashed because of segment
fault in file (src/lock/lock.c:832, both threads crashed on this
line).
I inspected the back trace, the only suspecious thing I found is that
the 2 threads are using the same locker object[1], so I'm wondering if
anyone has similar experience implementing concurrent BDB
applications? And what's possible cause of my problem and possible
fixes? Thanks.
[1]
thread 1: #0  0x00002aaab3651a7f in __lock_get_internal (lt=0x13cbda0, sh_locker=0x2aab0119f258, flags=4, obj=0x1c55650, lock_mode=DB_LOCK_WRITE, timeout=0, lock=0x2aab449fe8a0)
    at ../src/lock/lock.c:832
thread 2: #0  0x00002aaab3651a7f in __lock_get_internal (lt=0x13cbda0, sh_locker=0x2aab0119f258, flags=4, obj=0x13da640, lock_mode=DB_LOCK_WRITE, timeout=0, lock=0x2aab3ffc78a0)
    at ../src/lock/lock.c:832

Hi, Mike
Thanks for the timely reply!
I referred to the Berkeley DB Transaction Guide, while the doc does not mention the consequence if you violate the scenario requirement. 
1. I choose the default Data Store model, and my program will allow multiple writers, what's the expected behavior? 2 threads using the same locker compete different locks is supposed to segment fault?  I'm also curious about how a put(key, data) correspond to a locker, keys in the memory page map to the same locker?
2. I try to enable concurrent reader & writer without transaction, while the guide assumes transaction is enable, is Data Store able to achieve this? Or at least Concurrent Data Store is required?
Thank you very much!

Similar Messages

  • 32 bit Firefox Segmentation fault on 64 bit host

    Hi,
    I'm running CentOS 5.2 x86_64 (64 bit). I've done may
    installs and got flash working using a 32bit firefox.
    This is a newly installed host and I have a 32 bit firefox
    installed yet flash 10 always causes a segmentation fault when I
    access a web page that has flash content.
    strace on firefox shows:
    write(2, "/usr/lib/firefox-3.0.4/run-mozil"...,
    97/usr/lib/firefox-3.0.4/run-mozilla.sh: line 131: 6278
    Segmentation fault "$prog" ${1+"$@"}
    I can't see the problem. As I said previously, I've had
    firefox and flash (32bit) working perfectly happliy on 64 bit
    before but it is now broken.
    Any with any clues?
    Thanks in advance.

    Pl post details of exact OS, database and client versions.
    Yes, you can install 32-bit client software, as long as you use a separate ORACLE_BASE and ORACLE_HOME to do so.
    HTH
    Srini

  • Segmentation Fault in db- put() fun with BDB ver 4.5.20/4.6.19 in linux

    I am working on porting an application that runs on sun solaris sparc (OS ver 5.8) with Berkeley DB ver 4.2.50 into suse linux [ Linux version 2.6.5-7.244-smp (gcc version 3.3.3 (SuSE Linux)) ]. I have compiled the application in linux and i am getting segmentation fault error while running the application. The error occurs while the objects are loaded from the database into berkeley cache. The application fails in db->put function while loading the objects. This segmentation fault error is not consistently occuring every time on the same object. Sometimes it throws the error while loading the first object itself or sometimes it throws after loading couple of objects. But the stack trace shows the same function whenever it crashes.
    Given below is the stack trace of the application when it throws SIGSEGV.
    [INFO] [-1756589376] 14:23:24.406 BerkeleyCache : restoring database table metadata for table [BSCOffice]...
    [INFO] [-1756589376] 14:23:24.406 BerkeleyCache : restoring database index metadata for table [BSCOffice]...
    [INFO] [-1756589376] 14:23:24.408 Obj [BSCOffice] Col [BSCOfficeId] : Typ[TEXT] MaxLen[10] Null[Y]
    [INFO] [-1756589376] 14:23:24.408 Obj [BSCOffice] Col [City] : Typ[TEXT] MaxLen[100] Null[Y]
    [INFO] [-1756589376] 14:23:24.408 BerkeleyCache : creating table [BSCOffice.tbl]
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 182927004352 (LWP 14638)]
    0x0000002a9643203a in __db_check_txn () from /opt/home/pesprm/local/db-4.6.19/db-4.6.19/build_unix/.libs/libdb-4.6.so
    (gdb) where
    #0 0x0000002a9643203a in __db_check_txn () from /opt/home/pesprm/local/db-4.6.19/db-4.6.19/build_unix/.libs/libdb-4.6.so
    #1 0x0000002a9643475b in __db_put_pp () from /opt/home/pesprm/local/db-4.6.19/db-4.6.19/build_unix/.libs/libdb-4.6.so
    #2 0x000000000043586b in esp::BerkeleyCache::insert_i (this=0x7fbfffe380, transactionId=866640768, pObj=0x7fbfffd3e0) at BerkeleyCache.cpp:838
    #3 0x00000000004119c5 in RefServer::loadObject (this=0x7fbfffdbe0, objInfo=<value optimized out>, strPrimaryObjName=@0x7fbfffd6f0,
    procParams=<value optimized out>) at BerkeleyCache.h:569
    #4 0x0000000000419166 in RefServer::loadObjects (this=0x7fbfffdbe0) at RefServer.cpp:579
    #5 0x0000000000419748 in main (argc=<value optimized out>, argv=<value optimized out>) at RefServer.cpp:296
    The code that calls the db->put() function is given below:
    <pre>
    bool BerkeleyCache::insert_i(size_t transactionId, const CachePersistable* pObj)
         bdbcache::Table* pTable = findTable_i(pObj->getPersistInfo().getObjectName());
         if (pTable == NULL)
              return false;
         DB_TXN* txnp = (DB_TXN*)transactionId;
         if (txnp == NULL)
              return false;
         bdbcache::Index* pPrimaryKey = pTable->getPrimaryKey();
         if (pPrimaryKey == NULL)
              return false;
         if (pTable->getDataOffset() == -1)
              pTable->setDataOffset( (int)(pObj->getDataBufferStartPos() - pObj->getDataStartPos()) );
         DB* pdb = pTable->getDB();
         int rc = 0;
         Synchronize sync(pPrimaryKey->getKeyBufferCriticalSection());
         pPrimaryKey->getKeyValues(pObj, pPrimaryKey->getKeyBuffer());
         DBT key, data;
         memset(&key, 0, sizeof(DBT));
         key.flags = DB_DBT_USERMEM;
         key.data = (void*)pPrimaryKey->getKeyBuffer().getBuffer();
         key.ulen = key.size = pPrimaryKey->getKeyBuffer().getBufferLength();
         memset(&data, 0, sizeof(DBT));
         data.flags = DB_DBT_USERMEM;
         if (pTable->isPrimaryDb())
              data.data = (void*)pObj->getDataBufferStartPos();
              data.ulen = data.size = pObj->getDataBufferSize();
              rc = pdb->put(pdb, (DB_TXN*)transactionId, &key, &data, DB_NOOVERWRITE);
         else
              const PersistInfo::Property* prop = pTable->getJoinProperty();
              Variant var = pObj->getValue( prop );
              int n = 0;
              switch (prop->_eType)
                   case PersistInfo::CHAR_ARRAY:
                   case PersistInfo::STRING:
                   case PersistInfo::VAR_STRING:
                        const char* pch = (const char*)var;
                        data.data = (void*)pch;
                        data.ulen = data.size = (int)strlen(pch) + 1;
                        break;
                   case PersistInfo::INT:
                        n = (int)var;
                        data.data = (void*)&n;
                        data.ulen = data.size = sizeof(int);
                        break;
              rc = pdb->put(pdb, (DB_TXN*)transactionId, &key, &data, 0);
         if (rc!= DB_SUCCESS)
              //_app.logError("BerkeleyCache : DB->put() failed [%s]", db_strerror(rc));
              _app.logInfo("ERROR:BerkeleyCache : DB->put() failed [%s]", db_strerror(rc));
              return false;
         return true;
    </pre>
    At the end of this function, the return value of db->put is checked for DB_SUCCESS. The application never executed this line when it throws SIGSEGV.
    I have tried using the BDB versions 4.5.20/4.6.18/4.6.19 with the application and it throws segmentation fault error with all versions of BDB. Following are the cache related configurable parameters that we use in our application.
    cache size = 16 MB
    page size = 16 KB
    max locks = 3000000
    dirty read = N
    We are using the Sybase Adaptive DB server running in Solaris/Linux servers. The same application that runs in Solaris connecting to Sybase DB (in solaris) is working perfectly fine. And the application that i am working in linux connects to the Sybase DB running in linux server.
    Please let me know what could be the issue that is causing our application to segmentation fault.
    Thanks
    Senthil

    I am working on porting an application that runs on
    sun solaris sparc (OS ver 5.8) with Berkeley DB ver
    4.2.50 into suse linux [ Linux version
    2.6.5-7.244-smp (gcc version 3.3.3 (SuSE Linux)) ].
    I have compiled the application in linux and i am
    getting segmentation fault error while running the
    application. The error occurs while the objects areWhich indicates in almost every typical case, for a well used library like berkeleydb, an application issue.
    loaded from the database into berkeley cache. The
    application fails in db->put function while loading
    the objects. This segmentation fault error is not
    consistently occuring every time on the same object.Also indicative of typical misuse of heap, pointer errors, or otherwise undefined behavior on the application's part.
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 182927004352 (LWP 14638)]
    0x0000002a9643203a in __db_check_txn () from
    /opt/home/pesprm/local/db-4.6.19/db-4.6.19/build_unix/
    .libs/libdb-4.6.so
    (gdb) where
    #0 0x0000002a9643203a in __db_check_txn () from
    /opt/home/pesprm/local/db-4.6.19/db-4.6.19/build_unix/
    .libs/libdb-4.6.so
    #1 0x0000002a9643475b in __db_put_pp () from
    /opt/home/pesprm/local/db-4.6.19/db-4.6.19/build_unix/
    .libs/libdb-4.6.so
    #2 0x000000000043586b in
    esp::BerkeleyCache::insert_i (this=0x7fbfffe380,
    transactionId=866640768, pObj=0x7fbfffd3e0) at
    BerkeleyCache.cpp:838
    #3 0x00000000004119c5 in RefServer::loadObject
    (this=0x7fbfffdbe0, objInfo=<value optimized out>,
    strPrimaryObjName=@0x7fbfffd6f0,
    procParams=<value optimized out>) at
    BerkeleyCache.h:569
    4 0x0000000000419166 in RefServer::loadObjects
    (this=0x7fbfffdbe0) at RefServer.cpp:579
    #5 0x0000000000419748 in main (argc=<value optimized
    out>, argv=<value optimized out>) at
    RefServer.cpp:296Did you build the libraries stripped or otherwise remove debugging information?
    run "file /opt/home/pesprm/local/db-4.6.19/db-4.6.19/build_unix/.libs/libdb-4.6.so"
    Also, if I'm not mistaken this is Linux you're porting to, right? Might want to drop the "/opt" Solaris-ism as you continue to port more to Linux.
    The code that calls the db->put() function is given
    below:
         if (pTable->getDataOffset() == -1)Does this return an unsigned or signed value?
    pTable->setDataOffset(
    t( (int)(pObj->getDataBufferStartPos() -
    pObj->getDataStartPos()) );You cast to int here, what's the background reasoning for it?
         DB* pdb = pTable->getDB();
         int rc = 0;You don't check pdb is valid.
    Synchronize
    e sync(pPrimaryKey->getKeyBufferCriticalSection());
    pPrimaryKey->getKeyValues(pObj,
    , pPrimaryKey->getKeyBuffer());
         DBT key, data;
         memset(&key, 0, sizeof(DBT));
         key.flags = DB_DBT_USERMEM;
    key.data =
    = (void*)pPrimaryKey->getKeyBuffer().getBuffer();Do you verify this is even valid? Have you also checked the code within a debugger and verified the logic is correct?
    key.ulen = key.size =
    = pPrimaryKey->getKeyBuffer().getBufferLength();Same thing.
         memset(&data, 0, sizeof(DBT));
         data.flags = DB_DBT_USERMEM;
         if (pTable->isPrimaryDb())
              data.data = (void*)pObj->getDataBufferStartPos();
              data.ulen = data.size = pObj->getDataBufferSize();How do we know these are even valid? You're coming from the perspective that your code makes no mistakes when I have a hunch it does.
    rc = pdb->put(pdb, (DB_TXN*)transactionId, &key,
    y, &data, DB_NOOVERWRITE);Right, and this will most definitely result in a segmentation violation if you don't pass it valid data.
    You're on Linux, I highly suggest you download and build Valgrind, run your application w/ valgrind --tool=memcheck, and get back to us. Also, don't strip debugging information from the berkeley db libraries during this phase of troubleshooting - especially when you're still porting something over.
    I have tried using the BDB versions
    4.5.20/4.6.18/4.6.19 with the application and it
    throws segmentation fault error with all versions of
    BDB.Because the issue isn't within BDB.
    We are using the Sybase Adaptive DB server running in
    Solaris/Linux servers. The same application that
    runs in Solaris connecting to Sybase DB (in solaris)
    is working perfectly fine.More correctly, it was working perfectly fine under Solaris. That doesn't even mean that it's not taking part in undefined behavior - it just means it "worked."

  • Can't access mailbox, can't ipurge - segmentation fault

    Running 10.4.8 with all security updates.
    The user's mailbox can't be accessed using mail clients -- the client connects and correctly reports the number of messages in the mailbox, but refuses to show a header list. SquirrelMail just comes back with "Connection dropped by IMAP server."
    ipurge, on the other hand, comes back with:
    Working on user/username...
    Segmentation fault
    Using Server Admin, I have tried reconstructing the user's mailbox and repairing the database, but neither make any difference.
    Out of over 1,200 users, this is the only reporting this type of problem.
    Anyone have any ideas how I might be able to figure out what's going on and salvage the user's 700+ messages?
      Mac OS X (10.4.8)  

    My mistake: malbfr's repair of the database did work; I hadn't completely reloaded the webpage I was looking at and so did not see the header list.
    All is well.

  • Segmentation fault when using snapshot isolation with Berkeley DB 6.1.19 and 5.1.29

    Hello,
    I have been experimenting with snapshot isolation with Berkeley DB, but I find that it frequently triggers a segmentation fault when write transactions are in progress.  The following test program reliably demonstrates the problem in Linux using either 5.1.29 or 6.1.19. 
    https://anl.app.box.com/s/3qq2yiij2676cg3vkgik
    Compilation instructions are at the top of the file.  The test program creates a temporary directory in /tmp, opens a new environment with the DB_MULTIVERSION flag, and spawns 8 threads.  Each thread performs 100 transactional put operations using DB_TXN_SNAPSHOT.  The stack trace when the program crashes generally looks like this:
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7ffff7483700 (LWP 11871)]
    0x00007ffff795e190 in __memp_fput ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    (gdb) where
    #0  0x00007ffff795e190 in __memp_fput ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #1  0x00007ffff7883c30 in __bam_get_root ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #2  0x00007ffff7883dca in __bam_search ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #3  0x00007ffff7870246 in ?? () from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #4  0x00007ffff787468f in ?? () from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #5  0x00007ffff79099f4 in __dbc_iput ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #6  0x00007ffff7906c10 in __db_put ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #7  0x00007ffff79191eb in __db_put_pp ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #8  0x0000000000400f14 in thread_fn (foo=0x0)
        at ../tests/transactional-osd/bdb-snapshot-write.c:154
    #9  0x00007ffff7bc4182 in start_thread (arg=0x7ffff7483700)
        at pthread_create.c:312
    #10 0x00007ffff757f38d in clone ()
        at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
    I understand that this test program, with 8 concurrent (and deliberately conflicting) writers, is not an ideal use case for snapshot isolation, but this can be triggered in other scenarios as well.
    You can disable snapshot isolation by toggling the value of the USE_SNAP #define near the top of the source, and the test program then runs fine without it.
    Can someone help me to identify the problem?
    many thanks,
    -Phil

    Hi Phil,
       We have taken a look at this in more detail and there was a bug in the code.   We have fixed the bug.     We will roll it into our next 6.1 release that we do.   If you would like an early patch that will go on top of 6.1.19, please email me at [email protected], reference this forum post and I can get a patch sent out to you.   It will be a .diff file that apply on the source code and then rebuild the library.  Once again thanks for finding the issue, and providing a great test program which tremendously helped in getting this resolved.
    thanks
    mike

  • Concurrent access to Berkeley Db using c++

    Hi
    I'm trying to implement a concurrent persistent queue using Berkeley DB. As a starter I tried to make two process which both appends to the DB:
    #include <unistd.h>
    #include <sstream>
    #include <db_cxx.h>
    class Queue : public DbEnv
    public:
    Queue ( ) :
    DbEnv(0),
    db(0)
    set_flags(DB_CDB_ALLDB, 1);
    open("/tmp/db", DB_INIT_LOCK |
    DB_INIT_LOG |
    DB_INIT_TXN |
    DB_INIT_MPOOL |
    DB_RECOVER |
    DB_CREATE |
    DB_THREAD,
    0);
    db = new Db(this, 0);
    db->set_flags(DB_RENUMBER);
    db->open(NULL, "db", NULL, DB_RECNO, DB_CREATE | DB_AUTO_COMMIT | DB_THREAD, 0);
    virtual ~Queue ()
    db->close(0);
    delete db;
    close(0);
    protected:
    Db * db;
    class Enqueue : public Queue
    public:
    Enqueue ( ) : Queue() { }
    virtual ~Enqueue () { }
    bool push(const std::string& s)
    int res;
    DbTxn * txn;
    try {
    txn_begin(NULL, &txn, DB_TXN_SYNC | DB_TXN_WAIT );
    db_recno_t k0[4]; // not sure how mutch data is needs???
    k0[0] = 0;
    Dbt val((void*)s.c_str(), s.length());
    Dbt key((void*)&k0, sizeof(k0[0]));
    key.set_ulen(sizeof(k0));
    key.set_flags(DB_DBT_USERMEM);
    res = db->put(txn, &key, &val, DB_APPEND);
    if( res == 0 ) {
    txn->commit(0);
    return true;
    } else {
    std::cerr << "push failed: " << res << std::endl;
    txn->abort();
    return false;
    } catch( DbException e) {
    std::cerr << "DB What()" << e.what() << std::endl;
    txn->abort();
    return false;
    } catch( std::exception e) {
    std::cerr << "What()" << e.what() << std::endl;
    txn->abort();
    return false;
    } catch(...) {
    std::cerr << "Unknown error" << std::endl;
    txn->abort();
    return false;
    using namespace std;
    int main(int argc, const char *argv[])
    fork(); // create two independent processes
    Enqueue e;
    stringstream ss;
    for(int i = 0; i < 10; i++){
    ss.str("");
    ss << "asdf" << i;
    cout << ss.str() << endl;
    if( ! e.push(ss.str()) )
    break;
    return 0;
    Compiling it:
    $ g++ test.cxx -I/usr/include/db4.8 -ldb_cxx-4.8
    Create the db-dir
    $ mkdir /tmp/db
    And when I run it I get all kind of errors (segmentations fault, allocation error, and some times it actually works)
    I'm sure that I have missed some locking, but I just do not know how to do it. So, any hints and/or suggestions to fix this are most welcome.
    Best regards
    Allan W. Nielsen

    Okay, I think I found a way to do this. It is not pretty, and I think I can be done easier...
    The application is a call home process, where the producer is added data, and producer tries to send it home. If the consumer fails to send it home, it must try again. The database must not block for producer while the consumer is trying to sink data.
    The code has a file lock, and will only allow one consumer process.
    Here are the code:
    #include <db_cxx.h>
    #include <sstream>
    #include <fstream>
    #include <vector>
    #include <boost/interprocess/sync/file_lock.hpp>
    class Queue : public DbEnv
    public:
    Queue ( bool sync ) :
    DbEnv(0),
    db(0)
    set_flags(DB_CDB_ALLDB, 1);
    if( sync )
    set_flags(DB_TXN_NOSYNC, 0);
    else
    set_flags(DB_TXN_NOSYNC, 1);
    open("/tmp/db", DB_INIT_LOCK |
    DB_INIT_LOG | DB_INIT_TXN | DB_INIT_MPOOL |
    DB_REGISTER | DB_RECOVER | DB_CREATE | DB_THREAD,
    0);
    db = new Db(this, 0);
    db->set_flags(DB_RENUMBER);
    db->open(NULL, "db", NULL, DB_RECNO, DB_CREATE | DB_AUTO_COMMIT | DB_THREAD, 0);
    virtual ~Queue ()
    db->close(0);
    delete db;
    close(0);
    protected:
    Db * db;
    struct Transaction
    Transaction() : t(0) { }
    bool init(DbEnv * dbenv ){
    try {
    dbenv->txn_begin(NULL, &t, 0);
    } catch( DbException e) {
    std::cerr << "DB What()" << e.what() << std::endl;
    return false;
    } catch( std::exception e) {
    std::cerr << "What()" << e.what() << std::endl;
    return false;
    } catch(...) {
    std::cerr << "Unknown error" << std::endl;
    return false;
    return true;
    ~Transaction(){ if( t!=0) t->abort(); }
    void abort() { t->abort(); t = 0; }
    void commit() { t->commit(0); t = 0; }
    DbTxn * t;
    struct Cursor
    Cursor() : c(0) { }
    bool init( Db * db, DbTxn * t) {
    try {
    db->cursor(t, &c, 0);
    } catch( DbException e) {
    std::cerr << "DB What()" << e.what() << std::endl;
    return false;
    } catch( std::exception e) {
    std::cerr << "What()" << e.what() << std::endl;
    return false;
    } catch(...) {
    std::cerr << "Unknown error" << std::endl;
    return false;
    return true;
    ~Cursor(){ if( c!=0) c->close(); }
    void close(){ c->close(); c = 0; }
    Dbc * c;
    class Enqueue : public Queue
    public:
    Enqueue ( bool sync ) : Queue(sync) { }
    virtual ~Enqueue () { }
    bool push(const std::string& s)
    int res;
    Transaction transaction;
    if( ! transaction.init(this) )
    return false;
    try {
    db_recno_t k0[4]; // not sure how mutch data is needs???
    k0[0] = 0;
    Dbt val((void*)s.c_str(), s.length());
    Dbt key((void*)&k0, sizeof(k0[0]));
    key.set_ulen(sizeof(k0));
    key.set_flags(DB_DBT_USERMEM);
    res = db->put(transaction.t, &key, &val, DB_APPEND);
    if( res == 0 ) {
    transaction.commit();
    return true;
    } else {
    std::cerr << "push failed: " << res << std::endl;
    return false;
    } catch( DbException e) {
    std::cerr << "DB What()" << e.what() << std::endl;
    return false;
    } catch( std::exception e) {
    std::cerr << "What()" << e.what() << std::endl;
    return false;
    } catch(...) {
    std::cerr << "Unknown error" << std::endl;
    return false;
    const char * create_file(const char * f ){
    std::ofstream _f;
    _f.open(f, std::ios::out);
    _f.close();
    return f;
    class Dequeue : public Queue
    public:
    Dequeue ( bool sync ) :
    Queue(sync),
    lock(create_file("/tmp/db-test-pop.lock")),
    number_of_records_(0)
    std::cout << "Trying to get exclusize access to database" << std::endl;
    lock.lock();
    virtual ~Dequeue ()
    bool pop(size_t number_of_records, std::vector<std::string>& records)
    if( number_of_records_ != 0 ) // TODO, warning
    abort();
    Cursor cursor;
    records.clear();
    if( number_of_records_ != 0 )
    abort(); // TODO, warning
    // Get a cursor
    try {
    db->cursor(0, &cursor.c, 0);
    } catch( DbException e) {
    std::cerr << "DB What()" << e.what() << std::endl;
    abort();
    return false;
    // Read and delete
    try {
    Dbt val;
    db_recno_t k0 = 0;
    Dbt key((void*)&k0, sizeof(k0));
    for( size_t i = 0; i < number_of_records; i ++ ) {
    int get_res = cursor.c->get(&key, &val, DB_NEXT);
    if( get_res == 0 )
    records.push_back(std::string((char *)val.get_data(), val.get_size()));
    else
    break;
    number_of_records_ = records.size();
    if( number_of_records_ == 0 ) {
    abort();
    return false;
    } else {
    return true;
    } catch( DbException e) {
    std::cerr << "DB read/delete What() " << e.what() << std::endl;
    abort();
    return false;
    } catch( std::exception e) {
    std::cerr << "DB read/delete What() " << e.what() << std::endl;
    abort();
    return false;
    bool commit()
    if( number_of_records_ == 0 )
    return true;
    Transaction transaction;
    Cursor cursor;
    if( ! transaction.init(this) )
    return false;
    if( ! cursor.init(db, transaction.t) )
    return false;
    // Read and delete
    try {
    Dbt val;
    db_recno_t k0 = 0;
    Dbt key((void*)&k0, sizeof(k0));
    for( size_t i = 0; i < number_of_records_; i ++ ) {
    int get_res = cursor.c->get(&key, &val, DB_NEXT);
    if( get_res == 0 )
    cursor.c->del(0);
    else
    break; // this is bad!
    number_of_records_ = 0;
    cursor.close();
    transaction.commit();
    return true;
    } catch( DbException e) {
    std::cerr << "DB read/delete What() " << e.what() << std::endl;
    return false;
    } catch( std::exception e) {
    std::cerr << "DB read/delete What() " << e.what() << std::endl;
    return false;
    void abort()
    number_of_records_ = 0;
    private:
    boost::interprocess::file_lock lock;
    size_t number_of_records_;
    sigset_t orig_mask;
    };

  • Segment fault (Core dump)

    Hi
    when i run the following Pro*c file in Unix Environment im getting the SEGMENTATION FAULT(CORE DUMP) error. I used DBX to debug the code. I couldnt find out the proper reason for this error form the dbx output.
    This is the output i got from DBX.
    *signal SEGV (no mapping at the fault address) in _doprnt at 0xfb98736c*
    *0xfb98736c: _doprnt+0x2798:     stb     %o0, [%o1]*
    I did the showmemuse and show leaks, the output for this commands :
    (dbx) showmemuse
    Checking for memory use...
    Blocks in use report (blocks in use: 575 total size: 328086 bytes)
    Total % of Num of Avg Allocation call stack
    Size All Blocks Size
    ======= ==== ====== ====== =======================================
    134876 41% 30 4495 kpummapg < kghgex
    18098 5% 1 18098 lxldlbb < lxlinit < kpummpin < kpupin < sqgctx < sqgrct < sqlcmex < sqlcxt
    16552 5% 4 4138 kogmapg < kghgex
    16516 5% 4 4129 kogmapg < kogmasg
    12288 3% 6 2048 nlhtnsl < nlhthnew
    10350 3% 5 2070 calloc < nsbGetBFS
    9688 2% 1 9688 kouogini < kouoini < kpuinit0 < kpuinit < sqgctx < sqgrct < sqlcmex < sqlcxt
    8200 2% 1 8200 findbuf < doprnt < _fprintf < main
    8120 2% 4 2030 sqlrlc < sqlcopydfn
    8080 2% 1 8080 kpuinit0 < kpuinit < sqgctx < sqgrct < sqlcmex < sqlcxt < main
    7168 2% 1 7168 calloc < nsgbliuc < nsgblini < niotns < nigcall < osncon < kpuadef < upiini
    7168 2% 3 2389 lxldlod < lxdlobj
    5976 1% 4 1494 sqlrlc < sqlcopydfn
    4640 1% 1 4640 sqlrlc < sqldrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
    4640 1% 1 4640 sqlrlc < sqlbrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
    4128 1% 1 4128 calloc < nsgbliuc < nsgblini < niotns < nigcall < osncon < kpuadef < upiini
    4024 1% 1 4024 sqlrlc < sqlbrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
    3408 1% 1 3408 sqlrlc < sqldrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
    2452 <1% 8 306 calloc < nsmal
    2156 <1% 7 308 calloc < nlemfins
    (dbx) showleaks
    Checking for memory leaks...
    Actual leaks report (actual leaks: 1 total size: 30 bytes)
    Total Num of Leaked Allocation call stack
    Size Blocks Block
    Address
    ====== ====== ========== =======================================
    30 1 0x9c9c8 getOutFileName < main
    Possible leaks report (possible leaks: 0 total size: 0 bytes)
    i know its because of Pad pointer and something related to Pointer or array overflow. But i couldnt find out where exactly happening....
    Following is my Code, please help me to find out the error and what i need to change in my code:
    #ifndef ORA_PROC
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>
    #include <ctype.h>
    #include <math.h>
    #else
    typedef struct FILE FILE;
    #endif
    /*** Added by TCS Begins ***/
    char getOutFileName(char );
    char getEnvVar(char );
    void prepare_declare_oracle_cursors();
    void get_calendar_dates();
    void get_issues();
    void get_master_cusip_no();
    void get_run_date_finish();
    void get_payments();
    int get_pub_dates();
    void get_rights();
    void get_s_h_meetings();
    void get_special_codes();
    void get_agents();
    void get_currency();
    void get_payment_codes();
    void get_issue_codes();
    void get_standard_footnotes();
    void get_index_codes();
    void get_exchanges();
    void get_tax_codes();
    void get_tenders();
    int check_if_holiday(int );
    void sql_error(int , int , char *);
    void login_error();
    void no_pub_dates();
    void no_cal_dates();
    void no_finish_date();
    void save_payment_footnote(char , char [3],int , char );
    void save_issue_footnote(char );
    int print_footnotes();
    int print_foreign_tax();
    int get_partial_run_time();
    void save_rght_footnotes();
    int print_supplimental();
    int convert_tender_price(char *);
    void pad_s_h_meetings();
    int strip_out_codes(char *);
    char *getSqlLogonString();
    /**** TCS ADD Ends ****/
    EXEC SQL INCLUDE sqlca;
    EXEC SQL INCLUDE ddr_create_all_tapes.h;
    #define TRUE 1
    #define ORA_NOT_FOUND     ( sqlca.sqlcode == 1403 )
    /* The Definitions of SUCCESS and FAILURE were switched to test the
    idea that SUCCESS should be Zero and FAILURE should be Non-Zero
    #define SUCCESS 1
    #define FAILURE 0
    #define SUCCESS 0
    #define FAILURE -1
    #define SYSOK          0
    #define SYSERR          1
    #define DEBUGGING     0
    #define DEBUG_LEVEL     0
    /*     #define DEBUGGING     1
         #define DEBUG_LEVEL     2
    int          first_cal_date;
    int          footnote_count;
    int          foreign_count;
    int          last_cal_date;
    int          total_records;
    int          which_tape = 0;
    char          cusip_table_name[30];
    char          field_type_code;
    char          final_cusip_number[10];
    /**** char          footnote_text[300][300];
    char          foreign_text[60][100]; **** Commented by TCS as per the change request ****/
    /*** Added by TCS as per the change request ***/
    char          footnote_text[200][300];
    char          foreign_text[200][300];
    /*** TCS Add Ends ***/
    char          freq_type_code;
    char          init_cusip_number[10];
    char          rec_type_code;
    char          payment_where_clause[600];
    char          rights_where_clause[600];
    char          tenders_where_clause[600];
    char          s_h_meet_where_clause[600];
    char          last_run_time[18];
    char          supp_info_buffer[321];
    int          call_flag;
    int          tenders_flag;
    int          rights_flag;
    int          s_h_meet_flag;
    int          rght_foot_pos;
    double          hold_double;
    int          hold_int;
    char          hold_char[100];
    int i=0;
    FILE      *fp;
    FILE     pfp;          / this is used for a report file to correspond to
    the partial tape file */
    int main(int argc, char argv[]) / Modified by TCS */
         char          ddr_tape_name[100];
         char          ddr_partial_rpt[100];
         char          copyright_notice[100];
         long           file_position;
         char           *logname;
         /* READ IN PARAMETERS AND SET UP VARIABLES */
         memset (oracle_uid.arr, 0, sizeof(oracle_uid.arr));
    memset (oracle_pwd.arr, 0, sizeof(oracle_pwd.arr));
    strcpy (oracle_uid.arr, argv[1]);
    oracle_uid.len = strlen(oracle_uid.arr);
    strcpy (oracle_pwd.arr, argv[2]);
    oracle_pwd.len = strlen(oracle_pwd.arr);
    printf("Calling getSqlLogonString");
    logname = getSqlLogonString();
         which_tape = atoi(argv[1]);
         memset (last_run_time, 0, sizeof(last_run_time));
         if ( ( DEBUGGING ) && ( DEBUG_LEVEL > 1 ) )
         printf ("Oracle username: %s\n", oracle_uid.arr);
         printf ("Oracle password: %s\n", oracle_pwd.arr);
         printf ("Oracle username/password@database: %s\n", logname); /** Added by TCS **/
         printf ("Which Tape: %d\n", which_tape);
         hold_double = 0.0;
         hold_int = 0;
         memset (hold_char, ' ', sizeof(hold_char));
         EXEC SQL WHENEVER SQLERROR DO login_error();
    /*      EXEC SQL CONNECT :oracle_uid IDENTIFIED BY :oracle_pwd; */
         EXEC SQL CONNECT :logname ;
         printf ("Connected to ORACLE... \n");
         EXEC SQL WHENEVER SQLERROR continue;
         get_pub_dates();
         memset (ddr_tape_name, 0, sizeof(ddr_tape_name));
         memset (ddr_partial_rpt, 0, sizeof(ddr_partial_rpt));
         memset (cusip_table_name, 0, sizeof(cusip_table_name));
         memset (payment_where_clause, 0, sizeof(payment_where_clause));
         memset (rights_where_clause, 0, sizeof(rights_where_clause));
         memset (tenders_where_clause, 0, sizeof(tenders_where_clause));
         memset (s_h_meet_where_clause, 0, sizeof(s_h_meet_where_clause));
         /* SET UP VARIABLES BASED ON THE DIFFERENT FREQUENCY OF TAPE */
         switch (which_tape)
              case 0:
                   get_partial_run_time();
                   /*sprintf (ddr_tape_name,
                        "idb_tape$out:ddr_partial%1d.asc", p_count); ** Comented by TCS **/
                   sprintf (ddr_tape_name,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_ASC")); /* Added by TCS */
                   strcpy (cusip_table_name,
                        "IDB.DDR_PARTIAL_TAPE_TABLE");
                   /*sprintf (ddr_partial_rpt,
                        "idb_tape$out:ddr_partial%1d.rpt", p_count); ** Commented by TCS **/
                   sprintf (ddr_partial_rpt,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_RPT")); /* Added by TCS */
                   get_calendar_dates();
                   freq_type_code = '0';
                   sprintf (payment_where_clause,
    "AND PYMT_PUB_DATE IS NULL \
    AND ((PYMT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND PYMT_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (PYMT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND PYMT_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_from.arr, p_to.arr, p_from.arr, p_to.arr);
                   sprintf (rights_where_clause,
    "AND RGHT_PUB_DATE IS NULL \
    AND ((RGHT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND RGHT_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (RGHT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND RGHT_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_from.arr, p_to.arr, p_from.arr, p_to.arr);
                   sprintf (tenders_where_clause,
    "AND TNDR_PUB_DATE IS NULL \
    AND ((TNDR_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND TNDR_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (TNDR_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND TNDR_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_from.arr, p_to.arr, p_from.arr, p_to.arr);
                   sprintf (s_h_meet_where_clause,
    "AND SMTG_PUB_DATE IS NULL \
    AND ((SMTG_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND SMTG_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (SMTG_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
    AND SMTG_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_from.arr, p_to.arr, p_from.arr, p_to.arr);
                   break;
              case 3:
    /*     PARTIAL 5     */
                   get_partial_run_time();
                   p_count = 5;
                   /**sprintf (ddr_tape_name,
                        "idb_tape$out:ddr_partial%1d.asc", p_count); ** Comented by TCS **/
                   sprintf (ddr_tape_name,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_ASC")); /* Added by TCS */
    /* for testing only I am using seperate TABLE     */
                   /**strcpy (cusip_table_name,
                        "IDB.DDR_PARTIAL5_TAPE_TABLE"); ** Commented by TCS **/
                   strcpy (cusip_table_name,
                        "IDB.DDR_PARTIAL_TAPE_TABLE");
                   /*sprintf (ddr_partial_rpt,
                        "idb_tape$out:ddr_partial%1d.rpt", p_count); ** Commented by TCS **/
                   sprintf (ddr_tape_name,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_RPT")); /* Added by TCS */
                   get_calendar_dates();
                   freq_type_code = '3';
                   sprintf (payment_where_clause,
    "AND ( (PYMT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (PYMT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_to.arr, p_to.arr);
                   sprintf (rights_where_clause,
    "AND ((RGHT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (RGHT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_to.arr, p_to.arr);
                   sprintf (tenders_where_clause,
    "AND ((TNDR_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (TNDR_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_to.arr, p_to.arr);
                   sprintf (s_h_meet_where_clause,
    "AND ((SMTG_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
    OR (SMTG_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
    p_to.arr, p_to.arr);
                   break;
              case 1:
                   /**strcpy (ddr_tape_name,
                        "idb_tape$out:ddr_daily_tape.asc"); ** Commented by TCS **/
                   sprintf (ddr_tape_name,"%s",getOutFileName("DDR_DAILY_TAPE_ASC")); /* Added by TCS */
                   strcpy (cusip_table_name,
                        "IDB.DDR_DAILY_TAPE_TABLE");
                   get_calendar_dates();
                   freq_type_code = '1';
                   sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
    = TO_DATE('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)", pub_to_date.arr);
                   sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
    = TO_DATE('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)", pub_to_date.arr);
                   sprintf (tenders_where_clause, "AND (TNDR_PUB_DATE \
    = TO_DATE('%s','DD-MON-RR') OR TNDR_PUB_DATE IS NULL)", pub_to_date.arr);
                   sprintf (s_h_meet_where_clause, "AND (SMTG_PUB_DATE \
    = TO_DATE('%s','DD-MON-RR') OR SMTG_PUB_DATE IS NULL)", pub_to_date.arr);
                   break;
              case 5:
                   /*strcpy (ddr_tape_name,
                        "idb_tape$out:ddr_weekly_tape.asc"); ** Commented by TCS **/
                   sprintf (ddr_tape_name, "%s",getOutFileName("DDR_WEEKLY_TAPE_ASC")); /* Added by TCS */
                   strcpy (cusip_table_name,
                        "IDB.DDR_WEEKLY_TAPE_TABLE");
                   get_calendar_dates();
                   freq_type_code = '2';
                   sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (tenders_where_clause, "AND (TNDR_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR TNDR_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   /* ram - 6/28/95 - reverted back to original criteria: */
                   /* include on weekly tape based on pub-date, regardless of */
                   /* whether in calendar or not */
                   sprintf (s_h_meet_where_clause, "AND (SMTG_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR SMTG_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   break;
              case 12:
                   /* ram - 7/13/95          */
                   /* changed monthly "6" to "12" */
                   /*strcpy (ddr_tape_name,
                        "idb_tape$out:ddr_monthly_tape.asc"); ** Commented by TCS **/
                   sprintf (ddr_tape_name, "%s", getOutFileName("DDR_MONTHLY_TAPE_ASC")); /* Added by TCS */
                   strcpy (cusip_table_name,
                        "IDB.DDR_MONTHLY_TAPE_TABLE");
                   freq_type_code = '3';
                   sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (tenders_where_clause, "AND (TNDR_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR TNDR_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   break;
              case 8:
                   /*strcpy (ddr_tape_name,
                        "idb_tape$out:ddr_quarterly_tape.asc");** Commented by TCS **/
                   sprintf (ddr_tape_name,"%s",getOutFileName("DDR_QUARTERLY_TAPE_ASC")); /* Added by TCS */
                   strcpy (cusip_table_name,
                        "IDB.DDR_QUARTERLY_TAPE_TABLE");
                   freq_type_code = '3';
                   sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (tenders_where_clause, "AND (A.TNDR_TENDER_DATE \
    = TO_DATE('%s','DD-MON-RR'))", pub_to_date.arr);               break;
              case 9:
                   /*strcpy (ddr_tape_name,
                        "idb_tape$out:ddr_annual_tape.asc"); ** Comented by TCS **/
                   sprintf (ddr_tape_name,"%s", getOutFileName("DDR_ANNUAL_TAPE_ASC")); /* Added by TCS */
                   strcpy (cusip_table_name,
                        "IDB.DDR_ANNUAL_TAPE_TABLE");
                   freq_type_code = '4';
                   sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') \
    OR PYMT_PUB_DATE = TO_DATE('29-OCT-1929','DD-MON-YYYY'))",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (tenders_where_clause, "AND (A.TNDR_TENDER_DATE \
    = TO_DATE('%s','DD-MON-RR'))", pub_to_date.arr);               break;
              case 15:
                   /*strcpy (ddr_tape_name,
                        "idb_tape$out:ddr_general_tape.asc"); ** Commented by TCS **/
                   sprintf (ddr_tape_name,"%s", getOutFileName("DDR_GENERAL_TAPE_ASC")); /* Added by TCS */
                   strcpy (cusip_table_name,
                        "IDB.DDR_GENERAL_TAPE_TABLE");
                   freq_type_code = '3';
                   sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
    BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
    pub_from_date.arr, pub_to_date.arr);
                   sprintf (tenders_where_clause, "AND (A.TNDR_TENDER_DATE \
    = TO_DATE('%s','DD-MON-RR'))", pub_to_date.arr);               break;
              default:
                   exit (printf ("Invalid tape option: %d\n", which_tape)); /*** %s changed by TCS to %d ***/
                   break;
         if ((fp = fopen(ddr_tape_name, "w+")) == NULL)
              exit (printf ("Unable to open asc <%s> file for write access\n",
                   ddr_tape_name));
    /*     GR. Partial 5
         if (which_tape == 0 || which_tape == 3 )
              if ((pfp = fopen(ddr_partial_rpt, "w+")) == NULL)
                   exit (printf ("Unable to open asc <%s> file \
    for write access\n", ddr_partial_rpt));
         /* WRITE THE HEADER RECORD ON THE TAPE */
         memset (copyright_notice, 0, sizeof(copyright_notice));
         sprintf (copyright_notice, "COPYRIGHT (c) %.4s STANDARD & POOR'S \
    CORPORATION. ALL RIGHTS RESERVED", year.arr);
         fprintf (fp, "%-80.80sDIVIDEND%8d%17.17s ",
    copyright_notice, control_date, run_date_start.arr);
         file_position = ftell(fp);
         fprintf (fp, "\n");
         total_records = 0;
         /* GET THE SPECIAL CATEGORY RECORDS */
         get_special_codes();
         /* SELECT FROM THE DRIVER TABLE TO GET ALL THE OTHER RECORDS */
         get_master_cusip_no();
         printf("After get_master_cusip_no()");
         get_run_date_finish();
         printf("After get_run_date_finish()");
         if ( DEBUGGING )
              printf ("initial cusip = %s\n", init_cusip_number);
              printf ("final cusip = %s\n", final_cusip_number);
              printf ("record type is %c\n", rec_type_code);
         /* WRITE THE TRAILER RECORD */
         fprintf (fp, "%8d%-17.17s%07d%-9.9s1%-9.9s%c\n", control_date,
    run_date_finish.arr, total_records, init_cusip_number , final_cusip_number,
    rec_type_code);
         /* re-wind and add to the header record ... */
         rewind(fp);
         fseek(fp, file_position - 33, 0);
         fprintf (fp, "%07d%-9.9s1%-9.9s%c", total_records, init_cusip_number,
    final_cusip_number, rec_type_code);
         fclose(fp);
    /*     GR Partial 5
         if (which_tape == 0 || which_tape == 3 )
              fclose(pfp);
         printf ("\nDONE: %07d%-9.9s1%-9.9s%c\n", total_records, init_cusip_number,
    final_cusip_number, rec_type_code);
    return (0); /*** Added by TCS ***/
    void prepare_declare_oracle_cursors() /* Modified by TCS */
         /* We'll us dynamic sql to get the appropriate where clause but use */
         /* a bind variable for the master cusip number. So we prepare and */
         /* declare get_issues, get_payments, get_tenders, get rights, and */
         /* get_s_h_meetings cursors only once, outside the driving loop. */
         EXEC SQL BEGIN DECLARE SECTION;
              /**** TCS Comment begins as per the change request ****
              VARCHAR          sql_stmt1[1500];*/     /* issues */
              /*VARCHAR          sql_stmt2[3000];     *//* payments */
              /*VARCHAR          sql_stmt3[500];          *//* tenders */
              /*VARCHAR          sql_stmt4[500];          *//* rights */
              /*VARCHAR          sql_stmt5[500];          *//* s_h_meetings */
              /**** TCS Add begins as per the change request ****/
              VARCHAR          sql_stmt1[2000];     /* issues */
              VARCHAR          sql_stmt2[4000];     /* payments */
              VARCHAR          sql_stmt3[1000];     /* tenders */
              VARCHAR          sql_stmt4[1000];     /* rights */
              VARCHAR          sql_stmt5[1000];     /* s_h_meetings */
              /**** TCS Add ends ****/
         EXEC SQL END DECLARE SECTION;
         /* prepare and declare the get_issues cursor */
         memset (sql_stmt1.arr, 0, sizeof(sql_stmt1.arr));
         sprintf (sql_stmt1.arr, "SELECT \
    A.ISSU_PAR_VALUE, \
    DECODE (A.ISSU_MARKET_SYMBOL||A.ISSU_NASDAQ,'OTCY','NASD', A.ISSU_MARKET_SYMBOL), \
    A.ISSU_C_RATE, A.ISSU_C_FREQ, A.ISSU_C_NEW_AMOUNT, A.ISSU_C_NEW_Q1, \
    A.ISSU_C_NEW_Q2, A.ISSU_C_NEW_Q3, A.ISSU_C_OLD_AMOUNT, A.ISSU_C_OLD_Q1, \
    A.ISSU_C_OLD_Q2, A.ISSU_C_OLD_Q3, A.ISSU_CURRENCY, \
    A.ISSU_UPD_HIS, A.ISSU_COMMENT, A.TAX_EXEMPT_FLAG,\
    B.SEC_TYPE_CODE, B.ACQ_BY_IND, B.ACQ_ISSUER_NO, \
    rtrim(substr(B.ACQ_ISSUER_DESCR,1,30)), \
    B.INDEX_CODE, B.TRFR_AGT_CODE, B.NY_AGT_CODE, B.TICKER_SYMBOL, \
    B.TICKER_SYMBOL2, \
    rtrim(substr(C.ISSR_DDR_ISSUER_DESCR,1,60)), \
    rtrim(substr(E.ISSUE_DESCR,1,30)), \
    rtrim(substr(D.ISSUER_DESCR1,1,30)), \
    F.TRFR_DAYS \
    FROM IDB.DDR_ISSUES A, IDB.DDR_ISSUES_2 B, IDB.DDR_ISSUERS C, \
    BLIS.CUSIP_ISSUERS D, BLIS.CUSIP_ISSUES E, IDB.DDR_TRANSFER F \
    WHERE A.ISSU_CUSIP_NO = :master_cusip_no \
    AND A.ISSU_CUSIP_NO = B.ISSU_CUSIP_NO(+) \
    AND SUBSTR(A.ISSU_CUSIP_NO, 1, 6) = C.ISSR_ISSUER_NO(+) \
    AND SUBSTR(A.ISSU_CUSIP_NO, 1, 6) = D.ISSUER_NO \
    AND A.ISSU_CUSIP_NO = E.CUSIP_NO \
    AND A.ISSU_TRANSFER_CODE = F.TRFR_TR_CD(+) ");
         sql_stmt1.len = strlen(sql_stmt1.arr);
         EXEC SQL PREPARE ISSUES FROM :sql_stmt1;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in preparing ISSUES");
         EXEC SQL DECLARE ISSUES_C CURSOR FOR ISSUES;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in declaring ISSUES");
         /* now the get_payments cursor */
         memset (sql_stmt2.arr, 0, sizeof(sql_stmt2.arr));
         sprintf (sql_stmt2.arr, "SELECT \
    a.PYMT_RP_DIV, \
    a.PYMT_RP_DEC, \
    a.PYMT_RP_EXD, \
    a.PYMT_RP_REC, \
    a.PYMT_RP_PAY, \
    a.PYMT_RP_DUE, \
    a.PYMT_RP_TAX, \
    a.PYMT_RP_ANN, \
    a.PYMT_PRP_DIV, \
    a.PYMT_PRP_DEC, \
    a.PYMT_PRP_EXD, \
    a.PYMT_PRP_REC, \
    a.PYMT_PRP_PAY, \
    a.PYMT_PRP_DUE, \
    a.PYMT_PRP_TAX, \
    a.PYMT_PRP_ANN, \
    NVL(a.PYMT_SEQ_NO,0), \
    TO_CHAR(a.PYMT_DECLARED, 'YYMMDD'), \
    TO_CHAR(a.PYMT_EX_DATE, 'YYMMDD'), \
    TO_CHAR(a.PYMT_STK_REC, 'YYMMDD'), \
    TO_CHAR(a.PYMT_TRANSFER_DATE, 'YYMMDD'), \
    TO_CHAR(a.PYMT_PAYABLE, 'YYMMDD'), \
    a.PYMT_CODES, \
    NVL(a.PYMT_CASH_DIVD,0.0), \
    NVL(b.ORDINARY_INCOME,0.0), \
    NVL(b.CAP_GAINS,0.0), \
    NVL(b.SHORT_TM_CAP_GAINS,0.0), \
    NVL(b.LONG_TM_CAP_GAINS,0.0), \
    NVL(b.RETURN_OF_CAPITAL,0.0), \
    b.STK_DIVD_IND, \
    NVL(a.PYMT_STK_DIVD,0), \
    b.FRAC_IN_CASH_STK_IND, \
    NVL(b.FRAC_IN_CASH_PRICE,0.0), \
    NVL(a.PYMT_SPLIT_NEW,0), \
    NVL(a.PYMT_SPLIT_OLD,0), \
    TO_CHAR(a.PYMT_DB_DATE, 'YYMMDD'), \
    NVL(b.ARREARS_PAID,0.0), \
    NVL(b.ARREARS_DUE,0.0), \
    b.SPINOFF_IND, \
    b.SPINOFF_ISSUE_NO, \
    b.SPINOFF_ISSUER_DESCR, \
    b.SPINOFF_ISSUE_DESCR, \
    NVL(b.TAX_CODE,0), \
    NVL(b.TAX_CODE_2,0), \
    NVL(b.OLD_SEQ_NO,0), \
    b.ORDINARY_INCOME_CODE, \
    b.CAP_GAINS_CODE, \
    b.SHORT_TM_CAP_GAINS_CODE, \
    b.LONG_TM_CAP_GAINS_CODE, \
    b.RETURN_OF_CAPITAL_CODE, \
    TO_CHAR(b.CALL_DATE, 'YYMMDD'), \
    NVL(b.CALL_PRICE,0.0), \
    b.CALL_PRICE_CURRENCY, \
    b.CALL_AGT_NO, \
    b.ACCRUED_DIVD_IND, \
    TO_CHAR(a.PYMT_DB_DATE, 'YYMMDD'), \
    a.PYMT_DB_TEXT, \
    a.PYMT_DVD_TEXT, \
    a.PYMT_YEAR, \
    TO_CHAR(a.PYMT_STK_REC, 'fmMon dd'), \
    TO_CHAR(a.PYMT_DB_DATE, 'fmMon dd'), \
    b.NY_CALL_AGT_NO, \
    NVL(b.FOREIGN_TAX_RATE, 0.0), \
    NVL(b.NET_RATE, 0.0), \
    NVL(b.FEE, 0.0), \
    NVL(b.COMMISSION, 0.0), \
    a.PYMT_CASH_DIVD_FNS, \
    a.PYMT_STK_DIVD_FNS, \
    a.PYMT_DECLARED_FNS, \
    a.PYMT_EX_DATE_FNS, \
    a.PYMT_STK_REC_FNS, \
    a.PYMT_PAYABLE_FNS, \
    a.PYMT_SPLIT_FNS, \
    NVL (TO_NUMBER (TO_CHAR(a.PYMT_PUB_DATE, 'YYYYMMDD')), 0), \
    NVL (TO_NUMBER (TO_CHAR(a.PYMT_TRANSFER_DATE, 'YYYYMMDD')), 0), \
    NVL (TO_NUMBER (TO_CHAR(a.PYMT_STK_REC, 'YYYYMMDD')), 0), \
    NVL (TO_NUMBER (TO_CHAR(a.PYMT_DB_DATE, 'YYYYMMDD')), 0) \
    FROM IDB.DDR_PAYMENTS A, IDB.DDR_PAYMENTS_2 B \
    WHERE A.PYMT_CUSIP_NO = :master_cusip_no \
    AND A.PYMT_CUSIP_NO = B.PYMT_CUSIP_NO (+) \
    AND A.PYMT_SEQ_NO = B.PYMT_SEQ_NO (+) \
    AND NVL(INSTR(A.PYMT_CODES,'CO'),0) NOT IN (1,3,5,7,9,11) ");
         strcat (sql_stmt2.arr, payment_where_clause);
         sql_stmt2.len = strlen(sql_stmt2.arr);
         EXEC SQL PREPARE PAYMENTS FROM :sql_stmt2;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in preparing PAYMENTS");
         EXEC SQL DECLARE PAYMENTS_C CURSOR FOR PAYMENTS;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in declaring PAYMENTS");
         /* now the get_tenders cursor */
         memset (sql_stmt3.arr, 0, sizeof(sql_stmt3.arr));
    /* FXL ADD SUBSTR to tndr_price_qual: substr(A.TNDR_PRICE_QUAL,1,14), 3/23/99,
    to to_number 3/29/99 */
         sprintf (sql_stmt3.arr, "SELECT \
    B.TNDR_AGT_NO, \
    B.NY_AGT_NO, \
    TO_CHAR(A.TNDR_TENDER_DATE, 'YYMMDD'), \
    A.TNDR_PRICE, \
    to_number(A.TNDR_PRICE_QUAL), \
    A.TNDR_TE_SIZE, \
    TNDR_TE_TEXT_1 \
    FROM IDB.DDR_TENDERS A, IDB.DDR_TENDERS_2 B \
    WHERE TNDR_CUSIP_NO = :master_cusip_no \
    AND TNDR_CUSIP_NO = TNDR_ISSUE_NO(+) \
    AND A.TNDR_TENDER_DATE = B.TNDR_TENDER_DATE(+) ");
         strcat (sql_stmt3.arr, tenders_where_clause);
         sql_stmt3.len = strlen(sql_stmt3.arr);
         EXEC SQL PREPARE TENDERS FROM :sql_stmt3;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in preparing TENDERS");
         EXEC SQL DECLARE TENDERS_C CURSOR FOR TENDERS;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in declaring TENDERS");
         /* now the get_rights cursor */
         memset (sql_stmt4.arr, 0, sizeof(sql_stmt4.arr));
    /* ADD TO_CHAR(A.RGHT_DB_DATE, 'YYMMDD') */
         sprintf (sql_stmt4.arr, "SELECT \
    B.NO_RIGHTS_ISSUED, \
    B.SHS_REQ_FOR_PURCH, \
    B.RGHTS_REQUIRED, \
    B.QTY_SHS_PURCHASED, \
    B.TYPE_SHS_ELIGIBLE, \
    B.NEW_SHS_CUSIP_NO, \
    B.NEW_CO_ISSUER_DESCR, \
    TO_CHAR(A.RGHT_RECORD, 'YYMMDD'), \
    TO_CHAR(A.RGHT_EX_DATE, 'YYMMDD'), \
    TO_CHAR(B.NYC_RECORD_DATE, 'YYMMDD'), \
    TO_CHAR(A.RGHT_EXPIRE, 'YYMMDD'), \
    TO_CHAR(A.RGHT_DB_DATE, 'YYMMDD'), \
    A.RGHT_PRICE, \
    NVL(A.RGHT_RECORD_FNS,' '), \
    NVL(A.RGHT_EXPIRE_FNS,' '), \
    NVL(A.RGHT_EX_DATE_FNS,' '), \
    NVL(A.RGHT_PRICE_FNS,' '), \
    NVL(A.RGHT_BASIS_FNS,' '), \
    A.RGHT_FOOTNOTE, \
    B.US_INELIGIBILITY_IND, \
    B.RGHT_TRFR_IND \
    FROM IDB.DDR_RIGHTS A, IDB.DDR_RIGHTS_2 B \
    WHERE RGHT_CUSIP_NO = :master_cusip_no \
    AND RGHT_CUSIP_NO = RGHT_ISSUE_NO(+) \
    AND A.RGHT_RECORD = B.RGHT_RECORD_DATE(+) ");
         strcat (sql_stmt4.arr, rights_where_clause);
         sql_stmt4.len = strlen(sql_stmt4.arr);
         EXEC SQL PREPARE RIGHTS FROM :sql_stmt4;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in preparing RIGHTS");
         EXEC SQL DECLARE RIGHTS_C CURSOR FOR RIGHTS;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in declaring RIGHTS");
         /* ram - added logic on 7/18/95 */
         /* for the standard footnotes cursor */
         EXEC SQL DECLARE STANDARD_FOOTNOTES_C CURSOR
         FOR
         SELECT SFTN_S_F_TEXT, SFTN_S_F_TYPE
         FROM IDB.DDR_STANDARD_FOOTNOTES
         WHERE SFTN_S_F_TYPE = :standard_footnote_type;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in declaring STANDARD_FOOTNOTES");
         /* now the issue footnotes cursor */
         EXEC SQL DECLARE ISSUE_FOOTNOTES_C CURSOR
         FOR
         SELECT FTNT_F_TEXT, FTNT_F_TYPE
         FROM IDB.DDR_FOOTNOTES
         WHERE FTNT_CUSIP_NO = :master_cusip_no
         AND FTNT_SYMBOL = :footnote_symbol
         AND FTNT_YEAR IS NULL;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in declaring ISSUE_FOOTNOTES");
         /* now the payment footnotes cursor */
         EXEC SQL DECLARE PAYMENT_FOOTNOTES_C CURSOR
         FOR
         SELECT FTNT_F_TEXT, FTNT_F_TYPE
         FROM IDB.DDR_FOOTNOTES
         WHERE FTNT_CUSIP_NO = :master_cusip_no
         AND FTNT_SYMBOL = :footnote_symbol
         AND FTNT_YEAR = :footnote_year;
         if (sqlca.sqlcode)
              sql_error (SYSERR, sqlca.sqlcode,
                   "Error in declaring PAYMENT_FOOTNOTES");
         /* now the get_s_h_meetings cursor */
         /* ONLY for certain tape types. */
    /*     GR PARTial 5
         if (which_tape == 0 || which_tape == 3 || which_tape == 1 || which_tape == 5)
              memset (sql_stmt5.arr, 0, sizeof(sql_stmt5.arr));
              /* ram - 6/15/95 - changed ORigunal to smtg */
              /* TO_CHAR(ORIGINAL_REC_DATE, 'YYMMDD'), \ */
              sprintf (sql_stmt5.arr, "SELECT \
    TO_CHAR(SMTG_MTG_DATE, 'YYMMDD'), \
    TO_CHAR(SMTG_REC_DATE, 'YYMMDD'), \
    SMTG_FOOTNOTE \
    FROM IDB.DDR_S_H_MEETINGS \
    WHERE SMTG_CUSIP_NO = :master_cusip_no ");
              strcat (sql_stmt5.arr, s_h_meet_where_clause);
              sql_stmt5.len = strlen(sql_stmt5.arr);
              EXEC SQL PREPARE S_H_MEET FROM :sql_stmt5;
              if (sqlca.sqlcode)
                   sql_error (SYSERR, sqlca.sqlcode,
                        "Error in preparing S_H_MEET");
              EXEC SQL DECLARE S_H_MEET_C CURSOR FOR S_H_MEET;
              if (sqlca.sqlcode)
                   sql_error (SYSERR, sqlca.sqlcode,
                        "Error in declaring S_H_MEET");
         } /* end of if (which_tape == 0 || which_tape == 1 || which_tape == 5) */
    /* replaced get_calendar_dates function with use of PLSQL - ram - 5/24/95 */
    void get_calendar_dates() /* Modified by TCS */
         /* put first and last calendar dates into global ints */
         /* first_cal_date and last_cal_date (YYYYMMDD) using */
         /* ddr package function get_business_days. */
         /* The package object ddr is owned by idb, so I'll */
         /* specify this, just in case accounts other than idb */
         /* run this code. (EXECUTE priviledge is granted to */
         /* "idb_user" role.) */
    EXEC SQL BEGIN DECLARE SECTION;
              int          cal_start;
              int          cal_end;
              int          return_val;
    EXEC SQL END DECLARE SECTION;
         /* initialize destination globals */

    You actually need to run it with "check -access"; memuse and leaks won't help with the crash, which happens because of illegal memory access. Hopefully, "check -access" will help you to locate the bad guy, but that's not panacea either.
    To be precise:
    - start dbx
    $ dbx <your app>
    - issue
    (dbx) check -access
    (dbx) run
    and wait for dbx to stop and report suspicious memory access.

  • InDesign Server CS6 (MacOS) - JavaScripting & Troubleshooting "Bus error" or "Segmentation fault"

    I'm attempting to convert a workflow from InDesign CS5.5 Desktop with AppleScript to InDesign Server CS6 with JavaScript. It seems most of our templates work fine but every now and then I run into one that seems to work properly but right after we export to PDF and JPG which is the final step in the script I get either a Bus error or a Segmentation fault error. The files do export and the console sits idle for a few seconds then I get the crash. It doesn't seem to give me anything else and I can't find a crash dump or core file anywhere on disk to examine.
    The exact same input files on InDesign CS5.5 Desktop completing a very similar automation task via AppleScript work without an issue or error. I'm not certain if it's a problem with the way the InDesign files were put together, a version problem between a CS5.5 file and CS6, or something that I'm doing wrong in the script.
    Is there a way to get InDesign Server to go into debug or verbose mode so that it will show more than just two word errors on crash?  I've read a few people talking here about the debug version but every path I've found to get access to the debug version runs into a roadblock with a bad link.
    I would appreciate a point in the current right direction for how to debug these templates this script.

    Re: verbose mode. These are not InDesign error messages. They are system errors, saying that an app (InDesign?) crashed, went away, hence could not issue any kind of message. Crash logs are the place to start. If they don't help, and the crash is outside your code, after that it's over to the maintainer (Adobe?)
    Worth sharing a suitable crash log, as the list of routines active at the crash can narrow down issues.

  • Segmantation Fault  ---- signal SEGV (access to address exceeded protection

    Hi,
    I am using Sun Studio 12. When I am debugging my application it gave segmentation fault. Is this related to stack overflow.
    Appreciated your help in advance.
    DBX
    (dbx) cont
    t@27 (l@27) signal SEGV (access to address exceeded protections) in t_splay at 0
    xf6d55040
    0xf6d55040: t_splay+0x0198: st %o0, [%o1 + 24]
    Current function is MANH::CLS::StringW::AllocBufferAlways
    dbx: warning: can't find file "/export/home/clsdev/cls/3.0/ClsStringW.cpp"
    dbx: warning: see `help finding-files'
    (dbx) where
    current thread: t@27
    dbx: warning: undefined type number (0,3652) at /u02/wmpso/math2006r1qa/programs
    /PkShipWaveS:PickWave.cpp stab #3778 nHAny_ptr(0,125):t(0,3651)=*(0,3652),
    assuming type `(int {assumed})'
    dbx: warning: undefined type number (0,2371) at /u02/wmpso/math2006r1qa/programs/PkSWaveS:SWave.cpp stab #2629 nHAny_ptr(0,133):t(0,2370)=*(0,2371),
    assuming type `(int {assumed})'
    [1] t_splay(0x17c9310, 0xf8b558f8, 0xf8f9eb6c, 0xf8b6db60, 0x1932420, 0xf8b558f8), at 0xf6d55040
    [2] t_delete(0x17c9310, 0x80, 0xf8f9eb6c, 0xf8589994, 0xf6de8288, 0x1932420), at 0xf6d54d40
    [3] realfree(0x17c9288, 0x81, 0x939ac, 0xf6dbb88c, 0x0, 0x1), at 0xf6d54954
    [4] cleanfree(0x0, 0x1e, 0x930fc, 0xf6dbbb78, 0xf6de8288, 0xf6defad4), at 0xf6d551dc
    [5] mallocunlocked(0x20, 0x80, 0x17c9288, 0x17c9290, 0xf57d0090, 0x391e9), at 0xf6d54334
    [6] malloc(0x20, 0x1, 0x940a8, 0xf85b7744, 0xf6de8288, 0xf6df09b0), at 0xf6d54224
    [7] operator new(0x20, 0x1, 0xc, 0x137d4, 0xf9bea810, 0xf3473e6c), at 0xf9bd7064
    =>[8] AllocBufferAlways(this = 0xf34761f4, DataLength = 4U), line 6423 in "StringW.cpp"
    [9] AllocBufferCopyData(this = 0xf34761f4, DataLength = 4U, pSource = 0x1295994 "WAVE"), line 6453 in "StringW.cpp"
    [10] StringW::StringW(this = 0xf34761f4, pSource = 0x1295994 "WAVE"), line 292 in "StringW.cpp"
    [11] PWave::runWave(this = 0x1805c60), line 332 in "PWave.cpp"
    [12] SWave::runPickWave(this = 0x17f1c60), line 975 in "SWave.cpp"
    [13] SWave::runWaveForSelection(this = 0x17f1c60), line 702 in "SWave.cpp"
    (dbx)
    The ptrace of the corefile:
    $ pstack core.8
    core 'core.8' of 3812: /mos-app/mosapp/programs/SWaveS -n SWaveS -d MDSPROD -e /w
    ----------------- lwp# 1 / thread# 1 --------------------
    f6dc0154 __lwp_park (161a460, 161a428, 0, 0, 0, 0) + 14
    f6dba1e4 cond_wait_queue (161a460, 161a428, 0, 0, 0, 0) + 28
    f6dba764 cond_wait (161a460, 161a428, 0, 1000, 0, 0) + 10
    f923b5a8 __1cMVISConditionEwait6MrnIVISMutex__v_ (161a440, 161a420, 0, 0, 0, 438dac) + 20
    f8b3c588 __1cSVISProtocolManagerRwait_for_shutdown6M_v_ (1619b88, 1000, 0, f8f7526c, 6714, 1) + cc
    f8ac048c __1cGVISORBDrun6M_v_ (1619b88, 0, 0, f8f95e88, fffffffc, 162a950) + b8
    fe239888 __1cIPkServerJrunServer6Mippw_i_ (ffbff35c, 9, ffbff508, 137d4, f9dda810, 15e9cb0) + de0
    001eea54 __1cFwmain6Fippw_i_ (9, ffbff508, 20, 151234c, 1512310, f5a68b00) + dc4
    001edb88 main (9, ffbff674, ffbff69c, 1517800, f5a68a40, f5a68a80) + 138
    001ed620 _start   (0, 0, 0, 0, 0, 0) + 108
    ----------------- lwp# 2 / thread# 2 --------------------
    f6dc0e80 __pollsys (f58fbd08, 0, f58fbd70, 0, 0, 0) + 8
    f6d61f24 pselect (f58fbd08, f6deba68, f6deba68, 0, f58fbd70, 0) + 1c8
    f6d6229c select (0, 0, 0, 0, f58fbddc, 6) + a0
    fb44dd88 __1cGPkMSOSFsleep6FI_v_ (a, f58fbf0c, 0, 0, 0, 0) + 90
    fe222618 __1cKPkTimerIntDRun6M_v_ (15e9a10, 0, 0, 0, 0, 1) + d0
    f85b21a4 __1cEMANHDCLSHThread2KThreadMain6Fpv_3_ (15e9a10, f58fc000, 0, 0, f85b2118, 1) + 8c
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 3 / thread# 3 --------------------
    f6dc0154 __lwp_park (1629c00, 1629b58, f42fbda0, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (1629c00, 1629b58, f42fbda0, 0, 0, 0) + 28
    f6dba65c cond_wait_common (1629c00, 1629b58, f42fbda0, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (1629c00, 1629b58, f42fbe68, 0, f5936020, 0) + 34
    f6dba8e8 cond_timedwait (1629c00, 1629b58, f42fbe68, 47f25504, 847509, 211d424) + 14
    f923b744 __1cMVISConditionJtimedwait6MrnIVISMutex_L_C_ (1629be0, 1629b50, 12c, 0, 0, 0) + 54
    f8bc2650 __1cNVISThreadPoolQ_garbage_collect6M_v_ (1629b48, 0, 0, 0, 0, 0) + 48
    f8bc3a34 ???????? (161ca08, 0, 0, 0, f8faa3bc, f8bc3a30)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (161ca08, f42fc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 4 / thread# 4 --------------------
    f6dc1818 doorreturn (0, 0, 0, 0, f5920400, f6decbc0) + 10
    f5f30c30 door_create_func (0, f41fc000, 0, 0, f5f30c10, 0) + 20
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 5 / thread# 5 --------------------
    f6dc0e80 __pollsys (1644b58, 3, f40fbc18, 0, 0, 7530) + 8
    f6d5cf48 poll (1644b58, 3, 7530, 10624c00, 0, 0) + 7c
    f8bccbf4 __1cOVISSocketMTSCMFbegin6M_v_ (16297d8, 1644b58, f8f7526c, f5f7d530, 1624a5c, 0) + 12c
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (1629980, f40fc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 6 / thread# 6 --------------------
    f6dc0154 __lwp_park (162b130, 162b088, f3ffbda0, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162b130, 162b088, f3ffbda0, 0, 0, 0) + 28
    f6dba65c cond_wait_common (162b130, 162b088, f3ffbda0, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (162b130, 162b088, f3ffbe68, 0, f5920c00, 0) + 34
    f6dba8e8 cond_timedwait (162b130, 162b088, f3ffbe68, 47f25504, 9c1e63, 270798c) + 14
    f923b744 __1cMVISConditionJtimedwait6MrnIVISMutex_L_C_ (162b110, 162b080, 12c, 0, 0, 0) + 54
    f8bc2650 __1cNVISThreadPoolQ_garbage_collect6M_v_ (162b078, 0, 0, 0, 0, 0) + 48
    f8bc3a34 ???????? (161cb48, 0, 0, 0, f8faa3bc, f8bc3a30)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (161cb48, f3ffc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 7 / thread# 7 --------------------
    f6dc0e80 __pollsys (1644f18, 3, f3efbc18, 0, 0, 7530) + 8
    f6d5cf48 poll (1644f18, 3, 7530, 10624c00, 0, 0) + 7c
    f8bccbf4 __1cOVISSocketMTSCMFbegin6M_v_ (162ad08, 1644f18, f8f7526c, f5f7d530, 1624cb4, 1) + 12c
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (162aeb0, f3efc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 8 / thread# 8 --------------------
    f6dc0e80 __pollsys (162cd00, 1, f3dfbeb0, 0, 0, 7530) + 8
    f6d5cf48 poll (162cd00, 1, 7530, 10624c00, 0, 0) + 7c
    f8c06ca4 ???????? (162dc90, 0, 0, f924915c, 162de24, 162de8c)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (162de38, f3dfc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 9 / thread# 9 --------------------
    f6dc0154 __lwp_park (162ff18, 162fee0, f3cfbd48, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162ff18, 162fee0, f3cfbd48, 0, 0, 0) + 28
    f6dba65c cond_wait_common (162ff18, 162fee0, f3cfbd48, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (162ff18, 162fee0, f3cfbe10, 0, 0, 0) + 34
    f6dba8e8 cond_timedwait (162ff18, 162fee0, f3cfbe10, 0, 24aaa48, 4bb2e) + 14
    f923b9e4 __1cMVISConditionJtimedwait6MrnIVISMutex_X_C_ (162fef8, 162fed8, 0, 0, 162fee0, 162ff18) + c8
    f5dceca0 __1cSNotifierMainThreadFbegin6M_v_ (162fe38, 0, 0, 0, f5ee5acc, 1a4e068) + 4a0
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (162fe38, f3cfc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 10 / thread# 10 --------------------
    f6dc0e80 __pollsys (1633980, 3, f3bfbe28, 0, 0, a7f8) + 8
    f6d5cf48 poll (1633980, 3, aaad, 10624c00, a5395d, 294e5740) + 7c
    f8a645fc __1cNVISDispatcherIdispatch6MpnHtimeval__I_ (1637830, f8fdf8d8, 1, f8a64864, 0, f9271e58) + 38
    f8a7395c __1cGDSUserFbegin6M_v_ (16308e8, f5f7d530, 0, 0, f8f8f078, f8a7a7f0) + 104
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (163090c, f3bfc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 14 / thread# 14 --------------------
    f6dc0154 __lwp_park (162b0c0, 162b088, 0, 0, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162b0c0, 162b088, 0, 0, 0, 0) + 28
    f6dba764 cond_wait (162b0c0, 162b088, 0, 1000, 0, f8fab0c4) + 10
    f923b5a8 __1cMVISConditionEwait6MrnIVISMutex__v_ (162b0a0, 162b080, 1, 1, f8fab17c, 2) + 20
    f8bc2490 __1cNVISThreadPoolN_perform_task6MpnOVISTPoolWorker__v_ (162b078, 1645cc8, 0, 1, 5, f8f7526c) + 240
    f8bc3890 ???????? (1645cc8, 0, 0, 0, f8faa3d0, 3b19f0)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (1645cc8, f37fc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 15 / thread# 15 --------------------
    f6dc0154 __lwp_park (162b0c0, 162b088, 0, 0, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162b0c0, 162b088, 0, 0, 0, 0) + 28
    f6dba764 cond_wait (162b0c0, 162b088, 0, 1000, 0, f8fab0c4) + 10
    f923b5a8 __1cMVISConditionEwait6MrnIVISMutex__v_ (162b0a0, 162b080, 1, 1, f8fab17c, 2) + 20
    f8bc2490 __1cNVISThreadPoolN_perform_task6MpnOVISTPoolWorker__v_ (162b078, 16305b0, 0, 1, 4, f8f7526c) + 240
    f8bc3890 ???????? (16305b0, 0, 0, 0, f8faa3d0, 3b19f0)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (16305b0, f36fc000, 0, 0, f92399b8, 1) + 28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 16 / thread# 16 --------------------
    f6dc0154 __lwp_park (165e798, 165e778, f38fbb20, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (165e798, 165e778, f38fbb20, 0, 0, 0) + 28
    f6dba65c cond_wait_common (165e798, 165e778, f38fbb20, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (165e798, 165e778, f38fbc64, ff3ee0f8, ff3f06d0, 0) + 34
    f6dba8e8 cond_timedwait (165e798, 165e778, f38fbc64, ff3ee0f8, ff3f06d0, 0) + 14
    f6dba928 pthread_cond_timedwait (165e798, 165e778, f38fbc64, 0, f858a490, f38fbc64) + c
    f846d454 __1cEMANHDCLSLConditionalEWait6MkI_i_ (165e790, 1d4c0, a, 0, 0, f6decbc0) + 12c
    fb49bb84 __1cGPkPingDRun6M_v_ (165e760, 0, 0, 0, 0, 1) + 3a4
    f85b21a4 __1cEMANHDCLSHThread2KThreadMain6Fpv_3_ (165e760, f38fc000, 0, 0, f85b2118, 1) + 8c
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 17 / thread# 17 --------------------
    f6d54dd8 t_splay (1a0f848, 80, 2, f8589994, f6de8284, 9) + 10
    f6d54874 realfree (1a0f7c0, 81, 93a88, 25dee0, 0, 80000) + 8c
    f6d550fc cleanfree (0, 1b, 931d8, 2364c0, f6de8284, f6defad4) + 5c
    f6d54254 mallocunlocked (20, 80, 1a0f7c0, 1a0f7c8, 0, f5922c00) + f4
    f6d54144 malloc (20, 1, 94184, f85b7744, f6de8284, f6df09b0) + 4c
    f9dc7064 __1c2n6FI_pv_ (20, 16, 1c, 137d4, f9dda810, f35f3e6c) + 2c
    f859b6dc __1cEMANHDCLSHStringWRAllocBufferAlways6MkI_b_ (f35f61f4, 4, 4, 1, 16, 1c) + 94
    f859b88c __1cEMANHDCLSHStringWTAllocBufferCopyData6MkIpkw_b_ (f35f61f4, 4, 1295994, 137d4, f9dda810, 1a0f7c8) + ac
    f8589994 __1cEMANHDCLSHStringW2t5B6Mpkw_v_ (f35f61f4, 1295994, f35f66b0, f35f66ac, f35f66a8, 0) + 74
    0025dee0 __1cIPickWaveHrunWave6M_v_ (184e518, f35f83cc, f35f83d4, 128da9c, 0, 80000) + 3270
    002364c0 __1cIShipWaveLrunPickWave6M_i_ (180ca78, 15d6164, 0, f35f97b4, f35f97b0, 33) + 488
    0022c924 __1cIShipWaveTrunWaveForSelection6M_i_ (180ca78, 5, 0, 128bff4, 0, 34) + 1954
    002254a8 __1cIShipWaveHrunWave6M_v_ (180ca78, 1658740, 1657f58, 1657f04, 1e24, 80000) + 14c0
    001fccac __1cKWaveIFImplLrunShipWave6M_v_ (1657ef0, 528, 1288cac, 1288cec, 0, 80000) + 1fc
    0020c3fc __1cKWaveThreadDRun6M_v_ (17dd2e0, 0, 0, 0, 0, 1) + 84
    f85b21a4 __1cEMANHDCLSHThread2KThreadMain6Fpv_3_ (17dd2e0, f35fc000, 0, 0, f85b2118, 1) + 8c
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    + 8
    f6d61f24 pselect (f58fbd08, f6deba68, f6deba68, 0, f58fbd70, 0) + 1c8
    f6d6229c select (0, 0, 0, 0, f58fbddc, 6) + a0
    fb44dd88 __1cGPkMSOSFsleep6FI_v_ (a, f58fbf0c, 0, 0, 0, 0) + 90
    fe222618 __1cKPkTimerIntDRun6M_v_ (15e9a10, 0, 0, 0, 0, 1) + d0
    f85b21a4 __1cEMANHDCLSHThread2KThreadMain6Fpv_3_ (15e9a10, f58fc000, 0, 0, f85b
    2118, 1) + 8c
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 3 / thread# 3 --------------------
    f6dc0154 __lwp_park (1629c00, 1629b58, f42fbda0, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (1629c00, 1629b58, f42fbda0, 0, 0, 0) + 28
    f6dba65c cond_wait_common (1629c00, 1629b58, f42fbda0, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (1629c00, 1629b58, f42fbe68, 0, f5936020, 0) + 34
    f6dba8e8 cond_timedwait (1629c00, 1629b58, f42fbe68, 47f25504, 847509, 211d424)
    + 14
    f923b744 __1cMVISConditionJtimedwait6MrnIVISMutex_L_C_ (1629be0, 1629b50, 12c,
    0, 0, 0) + 54
    f8bc2650 __1cNVISThreadPoolQ_garbage_collect6M_v_ (1629b48, 0, 0, 0, 0, 0) + 48
    f8bc3a34 ???????? (161ca08, 0, 0, 0, f8faa3bc, f8bc3a30)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (161ca08, f42fc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 4 / thread# 4 --------------------
    f6dc1818 doorreturn (0, 0, 0, 0, f5920400, f6decbc0) + 10
    f5f30c30 door_create_func (0, f41fc000, 0, 0, f5f30c10, 0) + 20
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 5 / thread# 5 --------------------
    f6dc0e80 __pollsys (1644b58, 3, f40fbc18, 0, 0, 7530) + 8
    f6d5cf48 poll (1644b58, 3, 7530, 10624c00, 0, 0) + 7c
    f8bccbf4 __1cOVISSocketMTSCMFbegin6M_v_ (16297d8, 1644b58, f8f7526c, f5f7d530,
    1624a5c, 0) + 12c
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (1629980, f40fc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 6 / thread# 6 --------------------
    f6dc0154 __lwp_park (162b130, 162b088, f3ffbda0, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162b130, 162b088, f3ffbda0, 0, 0, 0) + 28
    f6dba65c cond_wait_common (162b130, 162b088, f3ffbda0, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (162b130, 162b088, f3ffbe68, 0, f5920c00, 0) + 34
    f6dba8e8 cond_timedwait (162b130, 162b088, f3ffbe68, 47f25504, 9c1e63, 270798c)
    + 14
    f923b744 __1cMVISConditionJtimedwait6MrnIVISMutex_L_C_ (162b110, 162b080, 12c,
    0, 0, 0) + 54
    f8bc2650 __1cNVISThreadPoolQ_garbage_collect6M_v_ (162b078, 0, 0, 0, 0, 0) + 48
    f8bc3a34 ???????? (161cb48, 0, 0, 0, f8faa3bc, f8bc3a30)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (161cb48, f3ffc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 7 / thread# 7 --------------------
    f6dc0e80 __pollsys (1644f18, 3, f3efbc18, 0, 0, 7530) + 8
    f6d5cf48 poll (1644f18, 3, 7530, 10624c00, 0, 0) + 7c
    f8bccbf4 __1cOVISSocketMTSCMFbegin6M_v_ (162ad08, 1644f18, f8f7526c, f5f7d530,
    1624cb4, 1) + 12c
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (162aeb0, f3efc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 8 / thread# 8 --------------------
    f6dc0e80 __pollsys (162cd00, 1, f3dfbeb0, 0, 0, 7530) + 8
    f6d5cf48 poll (162cd00, 1, 7530, 10624c00, 0, 0) + 7c
    f8c06ca4 ???????? (162dc90, 0, 0, f924915c, 162de24, 162de8c)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (162de38, f3dfc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 9 / thread# 9 --------------------
    f6dc0154 __lwp_park (162ff18, 162fee0, f3cfbd48, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162ff18, 162fee0, f3cfbd48, 0, 0, 0) + 28
    f6dba65c cond_wait_common (162ff18, 162fee0, f3cfbd48, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (162ff18, 162fee0, f3cfbe10, 0, 0, 0) + 34
    f6dba8e8 cond_timedwait (162ff18, 162fee0, f3cfbe10, 0, 24aaa48, 4bb2e) + 14
    f923b9e4 __1cMVISConditionJtimedwait6MrnIVISMutex_X_C_ (162fef8, 162fed8, 0, 0,
    162fee0, 162ff18) + c8
    f5dceca0 __1cSNotifierMainThreadFbegin6M_v_ (162fe38, 0, 0, 0, f5ee5acc, 1a4e06
    8) + 4a0
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (162fe38, f3cfc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 10 / thread# 10 --------------------
    f6dc0e80 __pollsys (1633980, 3, f3bfbe28, 0, 0, a7f8) + 8
    f6d5cf48 poll (1633980, 3, aaad, 10624c00, a5395d, 294e5740) + 7c
    f8a645fc __1cNVISDispatcherIdispatch6MpnHtimeval__I_ (1637830, f8fdf8d8, 1, f8a
    64864, 0, f9271e58) + 38
    f8a7395c __1cGDSUserFbegin6M_v_ (16308e8, f5f7d530, 0, 0, f8f8f078, f8a7a7f0) +
    104
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (163090c, f3bfc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 14 / thread# 14 --------------------
    f6dc0154 __lwp_park (162b0c0, 162b088, 0, 0, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162b0c0, 162b088, 0, 0, 0, 0) + 28
    f6dba764 cond_wait (162b0c0, 162b088, 0, 1000, 0, f8fab0c4) + 10
    f923b5a8 __1cMVISConditionEwait6MrnIVISMutex__v_ (162b0a0, 162b080, 1, 1, f8fab
    17c, 2) + 20
    f8bc2490 __1cNVISThreadPoolN_perform_task6MpnOVISTPoolWorker__v_ (162b078, 1645
    cc8, 0, 1, 5, f8f7526c) + 240
    f8bc3890 ???????? (1645cc8, 0, 0, 0, f8faa3d0, 3b19f0)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (1645cc8, f37fc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 15 / thread# 15 --------------------
    f6dc0154 __lwp_park (162b0c0, 162b088, 0, 0, 0, 0) + 14
    f6dba1e4 cond_wait_queue (162b0c0, 162b088, 0, 0, 0, 0) + 28
    f6dba764 cond_wait (162b0c0, 162b088, 0, 1000, 0, f8fab0c4) + 10
    f923b5a8 __1cMVISConditionEwait6MrnIVISMutex__v_ (162b0a0, 162b080, 1, 1, f8fab
    17c, 2) + 20
    f8bc2490 __1cNVISThreadPoolN_perform_task6MpnOVISTPoolWorker__v_ (162b078, 1630
    5b0, 0, 1, 4, f8f7526c) + 240
    f8bc3890 ???????? (16305b0, 0, 0, 0, f8faa3d0, 3b19f0)
    f92399e0 __1cJVISThreadG_start6Fpv_1_ (16305b0, f36fc000, 0, 0, f92399b8, 1) +
    28
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 16 / thread# 16 --------------------
    f6dc0154 __lwp_park (165e798, 165e778, f38fbb20, 1, 0, 0) + 14
    f6dba1e4 cond_wait_queue (165e798, 165e778, f38fbb20, 0, 0, 0) + 28
    f6dba65c cond_wait_common (165e798, 165e778, f38fbb20, 0, 0, 0) + 298
    f6dba7f4 condtimedwait (165e798, 165e778, f38fbc64, ff3ee0f8, ff3f06d0, 0) +
    34
    f6dba8e8 cond_timedwait (165e798, 165e778, f38fbc64, ff3ee0f8, ff3f06d0, 0) + 1
    4
    f6dba928 pthread_cond_timedwait (165e798, 165e778, f38fbc64, 0, f858a490, f38fb
    c64) + c
    f846d454 __1cEMANHDCLSLConditionalEWait6MkI_i_ (165e790, 1d4c0, a, 0, 0, f6decb
    c0) + 12c
    fb49bb84 __1cGPkPingDRun6M_v_ (165e760, 0, 0, 0, 0, 1) + 3a4
    f85b21a4 __1cEMANHDCLSHThread2KThreadMain6Fpv_3_ (165e760, f38fc000, 0, 0, f85b
    2118, 1) + 8c
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)
    ----------------- lwp# 17 / thread# 17 --------------------
    f6d54dd8 t_splay (1a0f848, 80, 2, f8589994, f6de8284, 9) + 10
    f6d54874 realfree (1a0f7c0, 81, 93a88, 25dee0, 0, 80000) + 8c
    f6d550fc cleanfree (0, 1b, 931d8, 2364c0, f6de8284, f6defad4) + 5c
    f6d54254 mallocunlocked (20, 80, 1a0f7c0, 1a0f7c8, 0, f5922c00) + f4
    f6d54144 malloc (20, 1, 94184, f85b7744, f6de8284, f6df09b0) + 4c
    f9dc7064 __1c2n6FI_pv_ (20, 16, 1c, 137d4, f9dda810, f35f3e6c) + 2c
    f859b6dc __1cEMANHDCLSHStringWRAllocBufferAlways6MkI_b_ (f35f61f4, 4, 4, 1, 16,
    1c) + 94
    f859b88c __1cEMANHDCLSHStringWTAllocBufferCopyData6MkIpkw_b_ (f35f61f4, 4, 1295
    994, 137d4, f9dda810, 1a0f7c8) + ac
    f8589994 __1cEMANHDCLSHStringW2t5B6Mpkw_v_ (f35f61f4, 1295994, f35f66b0, f35f66
    ac, f35f66a8, 0) + 74
    0025dee0 __1cIPickWaveHrunWave6M_v_ (184e518, f35f83cc, f35f83d4, 128da9c, 0, 8
    0000) + 3270
    002364c0 __1cIShipWaveLrunPickWave6M_i_ (180ca78, 15d6164, 0, f35f97b4, f35f97b
    0, 33) + 488
    0022c924 __1cIShipWaveTrunWaveForSelection6M_i_ (180ca78, 5, 0, 128bff4, 0, 34)
    + 1954
    002254a8 __1cIShipWaveHrunWave6M_v_ (180ca78, 1658740, 1657f58, 1657f04, 1e24,
    80000) + 14c0
    001fccac __1cKWaveIFImplLrunShipWave6M_v_ (1657ef0, 528, 1288cac, 1288cec, 0, 8
    0000) + 1fc
    0020c3fc __1cKWaveThreadDRun6M_v_ (17dd2e0, 0, 0, 0, 0, 1) + 84
    f85b21a4 __1cEMANHDCLSHThread2KThreadMain6Fpv_3_ (17dd2e0, f35fc000, 0, 0, f85b
    2118, 1) + 8c
    f6dc00b0 lwpstart (0, 0, 0, 0, 0, 0)

    No, this doesn't look like stack overflow.
    Stack overflow usually happens with recursive functions that call each other
    so many times that they exhaust the memory available for the stack. These
    are easy to spot from the stack trace; you can see many many frames.
    There's is a related problem, buffer overflow unto the stack.
    If you have a local array and you write past the end of it you may
    write unto your stack. Often what you write over is the return address
    so the problem manifests itself when the current function tries to
    return. Often, in these cases you cannot get a good stack trace.
    That is not the case here either.
    the clue to what is the case here is the tell-tale segv happening in malloc code:
    [2] t_delete(), at 0xf6d54d40
    [3] realfree(), at 0xf6d54954
    [4] cleanfree(), at 0xf6d551dc
    [5] mallocunlocked(), at 0xf6d54334
    [6] malloc(), at 0xf6d54224
    A bug in malloc? No.
    This is usually a sign of the following:
    Your code has written past one of the objects you have allocated and
    overwritten mallocs own data structures. As a result, at some later
    point in time, when malloc accesses those data structures it bombs.
    Debugging these is hard since the symptom may occur quite a while
    after the overwriting has happenned.
    However, all is not lost. Runtime Memory Checking may help you.
    Bring up The Properties dialog of the project you are debugging.
    Select the Advanced->RuntimeMemoryChecking category.
    Check "Enable RTC While Debugging" and then debug your application.
    You will get reports of possible memory violations.

  • Segmentation fault in /usr/lib32/libc.so.6

    Hi. I have two machines very different, but both of them with fully updated 64 bits Arch with 3.11.2 kernel. I've bought a SpeakOut English course that includes a native linux binary and, for my surprise, it works in one machine but throws a segfault in the other. I would like to know what's the difference, and solve the segfault if possible. The 'sucessful' machine is a wetab tablet with LXDE and intel video drivers, and the 'unsucessful' one is a standard PC with gnome 3.8 and an ATI card (with catalyst-test drivers from AUR).
    The binary seems to be very old, it forced me to install several gtk2 32bits packages (in both machines). In the 'unsucessful' machine
    lib32-gtk2
    lib32-atk
    lib32-libpng
    lib32-libxrender
    lib32-freetype2
    lib32-fontconfig
    lib32-pixman
    lib32-cairo
    lib32-libxft
    lib32-icu
    lib32-harfbuzz
    lib32-pango
    lib32-libjpeg-turbo
    lib32-libtiff
    lib32-gdk-pixbuf2
    lib32-e2fsprogs
    lib32-openssl
    lib32-libldap
    lib32-keyutils
    lib32-krb5
    lib32-libcups
    lib32-libxcursor
    lib32-libxrandr
    lib32-libxinerama
    lib32-libxcomposite
    lib32-sqlite
    lib32-libidn
    lib32-libcanberra
    lib32-libltdl
    lib32-tdb
    lib32-libcanberra-pulse
    That's the debugging of the segfault in the binary  START_Linux:
    % gdb ./START_Linux :(
    GNU gdb (GDB) 7.6.1
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-unknown-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from /run/media/david/SPEAKOUT_PRE_INT_AB/DATA/START_Linux...(no debugging symbols found)...done.
    (gdb) r
    Starting program: /run/media/david/SPEAKOUT_PRE_INT_AB/DATA/./START_Linux
    warning: Could not load shared library symbols for linux-gate.so.1.
    Do you need "set solib-search-path" or "set sysroot"?
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    (START_Linux:1769): Gtk-WARNING **: Imposible encontrar el motor de temas en la ruta al _modulo: «adwaita»,
    (START_Linux:1769): Gtk-WARNING **: Imposible encontrar el motor de temas en la ruta al _modulo: «adwaita»,
    Program received signal SIGSEGV, Segmentation fault.
    0xf75f1f45 in __longjmp_chk () from /usr/lib32/libc.so.6
    (gdb) bt full
    #0 0xf75f1f45 in __longjmp_chk () from /usr/lib32/libc.so.6
    No symbol table info available.
    #1 0xf74d8034 in ?? () from /usr/lib32/libgdk_pixbuf-2.0.so.0
    No symbol table info available.
    #2 0x08316835 in png_error ()
    No symbol table info available.
    #3 0x0831a2a9 in png_create_read_struct_2 ()
    No symbol table info available.
    #4 0xf74d8e0b in ?? () from /usr/lib32/libgdk_pixbuf-2.0.so.0
    No symbol table info available.
    #5 0xf74c8b27 in ?? () from /usr/lib32/libgdk_pixbuf-2.0.so.0
    No symbol table info available.
    #6 0xf74c8dea in gdk_pixbuf_new_from_file ()
    from /usr/lib32/libgdk_pixbuf-2.0.so.0
    No symbol table info available.
    #7 0xf7fc073c in ?? () from /usr/lib32/gtk-2.0/2.10.0/engines/libpixmap.so
    No symbol table info available.
    #8 0xf733a631 in g_cache_insert () from /usr/lib32/libglib-2.0.so.0
    No symbol table info available.
    #9 0xf7fc16e0 in ?? () from /usr/lib32/gtk-2.0/2.10.0/engines/libpixmap.so
    No symbol table info available.
    #10 0xf7fc1771 in ?? () from /usr/lib32/gtk-2.0/2.10.0/engines/libpixmap.so
    No symbol table info available.
    ---Type <return> to continue, or q <return> to quit---
    #11 0xf7fbe071 in ?? () from /usr/lib32/gtk-2.0/2.10.0/engines/libpixmap.so
    No symbol table info available.
    #12 0xf7fbf253 in ?? () from /usr/lib32/gtk-2.0/2.10.0/engines/libpixmap.so
    No symbol table info available.
    #13 0xf7b70524 in gtk_paint_box () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #14 0xf7a2ad43 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #15 0xf7a2ae19 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #16 0xf7ae10ce in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #17 0xf74323c4 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #18 0xf7433a82 in g_closure_invoke () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #19 0xf7445390 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #20 0xf744cf2f in g_signal_emit_valist () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #21 0xf744d513 in g_signal_emit () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #22 0xf7c0e27b in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    ---Type <return> to continue, or q <return> to quit---
    No symbol table info available.
    #23 0xf7a5b0d8 in gtk_container_propagate_expose ()
    from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #24 0xf7a5b100 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #25 0xf7a20c62 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #26 0xf7a5991f in gtk_container_forall () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #27 0xf7a59b22 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #28 0xf7ae10ce in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #29 0xf74323c4 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #30 0xf7433a82 in g_closure_invoke () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #31 0xf7445390 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #32 0xf744cf2f in g_signal_emit_valist () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #33 0xf744d513 in g_signal_emit () from /usr/lib32/libgobject-2.0.so.0
    ---Type <return> to continue, or q <return> to quit---
    No symbol table info available.
    #34 0xf7c0e27b in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #35 0xf7a5b0d8 in gtk_container_propagate_expose ()
    from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #36 0xf7a5b100 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #37 0xf7a20c62 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #38 0xf7a5991f in gtk_container_forall () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #39 0xf7a59b22 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #40 0xf7ae10ce in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #41 0xf74323c4 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #42 0xf7433a82 in g_closure_invoke () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #43 0xf7445390 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #44 0xf744cf2f in g_signal_emit_valist () from /usr/lib32/libgobject-2.0.so.0
    ---Type <return> to continue, or q <return> to quit---
    No symbol table info available.
    #45 0xf744d513 in g_signal_emit () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #46 0xf7c0e27b in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #47 0xf7a5b0d8 in gtk_container_propagate_expose ()
    from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #48 0xf7a5b100 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #49 0xf7a1dedd in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #50 0xf7a5991f in gtk_container_forall () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #51 0xf7a59b22 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #52 0xf7c1c4d0 in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #53 0xf7ae10ce in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #54 0xf74323c4 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #55 0xf7433b0e in g_closure_invoke () from /usr/lib32/libgobject-2.0.so.0
    ---Type <return> to continue, or q <return> to quit---
    No symbol table info available.
    #56 0xf7445390 in ?? () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #57 0xf744cf2f in g_signal_emit_valist () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #58 0xf744d513 in g_signal_emit () from /usr/lib32/libgobject-2.0.so.0
    No symbol table info available.
    #59 0xf7c0e27b in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #60 0xf7adfb37 in gtk_main_do_event () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #61 0xf7941d40 in ?? () from /usr/lib32/libgdk-x11-2.0.so.0
    No symbol table info available.
    #62 0xf7972b03 in ?? () from /usr/lib32/libgdk-x11-2.0.so.0
    No symbol table info available.
    #63 0xf793e578 in ?? () from /usr/lib32/libgdk-x11-2.0.so.0
    No symbol table info available.
    #64 0xf793eef7 in gdk_window_process_all_updates ()
    from /usr/lib32/libgdk-x11-2.0.so.0
    No symbol table info available.
    #65 0xf7a5975f in ?? () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #66 0xf791b8c8 in ?? () from /usr/lib32/libgdk-x11-2.0.so.0
    ---Type <return> to continue, or q <return> to quit---
    No symbol table info available.
    #67 0xf7367050 in ?? () from /usr/lib32/libglib-2.0.so.0
    No symbol table info available.
    #68 0xf736a33e in g_main_context_dispatch () from /usr/lib32/libglib-2.0.so.0
    No symbol table info available.
    #69 0xf736a6e8 in ?? () from /usr/lib32/libglib-2.0.so.0
    No symbol table info available.
    #70 0xf736ab43 in g_main_loop_run () from /usr/lib32/libglib-2.0.so.0
    No symbol table info available.
    #71 0xf7a5cc76 in gtk_dialog_run () from /usr/lib32/libgtk-x11-2.0.so.0
    No symbol table info available.
    #72 0x08184e70 in ?? ()
    No symbol table info available.
    #73 0x08157940 in ?? ()
    No symbol table info available.
    #74 0x080a3bba in ?? ()
    No symbol table info available.
    #75 0x080a3c78 in ?? ()
    No symbol table info available.
    #76 0x080a3fa5 in ?? ()
    No symbol table info available.
    #77 0x0806cc71 in ?? ()
    No symbol table info available.
    ---Type <return> to continue, or q <return> to quit---
    #78 0x080b53a7 in ?? ()
    No symbol table info available.
    #79 0x080b5531 in ?? ()
    No symbol table info available.
    #80 0x0810eaaa in ?? ()
    No symbol table info available.
    #81 0x080b5310 in ?? ()
    No symbol table info available.
    #82 0xf750c9d3 in __libc_start_main () from /usr/lib32/libc.so.6
    No symbol table info available.
    #83 0x080687b1 in ?? ()
    No symbol table info available.
    (gdb) q
    A debugging session is active.
    Inferior 1 [process 1769] will be killed.
    Quit anyway? (y or n) y
    I've tested to run the binary as root with no luck. Any idea? Thanks.

    Also following some information from another thread, I ran
    STEAM_RUNTIME=0 strace -o tmp steam; head tmp
    And got this output:
    execve("/usr/bin/steam", ["steam"], [/* 32 vars */]) = 0
    brk(0) = 0x1c89000
    access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=242411, ...}) = 0
    mmap(NULL, 242411, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb6211bb000
    close(3) = 0
    open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
    read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\1\2\0\0\0\0\0"..., 832) = 832
    fstat(3, {st_mode=S_IFREG|0755, st_size=1984416, ...}) = 0
    So the Steam client is looking for ld.so.preload where it doesn't exist, and accessing the 64bit glibc library.
    I think that when Steam runs with runtime disabled, it is supposed to use the 32bit libraries, but it doesn't search
    in /usr/lib32 when the runtime is disabled. I rolled back lib32-glibc to 2.20-2 (Dec 1st, 04) and there was no change.
    Any ideas?

  • Segmentation fault running cdemocp under valgrind

    I have problems with debugging multithreaded application with connection pooling under valgrind.
    It faults at:
    ==469== Process terminating with default action of signal 11 (SIGSEGV)
    ==469== Access not within mapped region at address 0x7207258
    ==469== at 0x243562D: nigini1 (in /usr/lib/oracle/10.2.0.1/client/lib/libclntsh.so.10.1)
    ==469== by 0x2436491: niqname (in /usr/lib/oracle/10.2.0.1/client/lib/libclntsh.so.10.1)
    ==469== by 0x23627BF: kwfnran (in /usr/lib/oracle/10.2.0.1/client/lib/libclntsh.so.10.1)
    ==469== by 0x232B523: kwfcinit (in /usr/lib/oracle/10.2.0.1/client/lib/libclntsh.so.10.1)
    ==469== by 0x218F4E1: kpuatch (in /usr/lib/oracle/10.2.0.1/client/lib/libclntsh.so.10.1)
    ==469== by 0x21C6A9A: kpulon2 (in /usr/lib/oracle/10.2.0.1/client/lib/libclntsh.so.10.1)
    ==469== by 0x22AB876: OCILogon2 (in /usr/lib/oracle/10.2.0.1/client/lib/libclntsh.so.10.1)
    ==469== by 0x8048F69: threadFunction (cdemocp.c:147)
    ==469== by 0x1B9258D1: thread_wrapper (vg_libpthread.c:867)
    ==469== by 0xB000F14F: do__quit (vg_scheduler.c:1872)
    I have the same problem with other multithreaded applications that use OCI libraries.
    Any suggestions ?
    BTW. I also recieve tons of messages from valgrind about using uninitialized values.
    System: Linux - CentOS release 4.2
    InstantClient:10.2.0.1
    valgrind-2.2.0

    Hi Paul,
    I have the same problem with the J2SE 1.3.1_01 on an AMD Athlon 1 GHz processor with 128 MB RAM and with Linux kernel 2.4.0-4GB. Within the Forte For Java IDE, Xerces runs without any problems, but when I try to run it in a console (be it xterm, kvt or whatever), the segmentation fault occurs.
    The solution appears to be typing "ulimit -s 2048" before running Xerces. Then it works in any console.
    You can find the reason for this at http://www.apachelabs.org/tomcat-user/200109.mbox/%[email protected]%3E
    Good luck!
    Kris Wuyts

  • Segmentation Fault

    Hi-
    I've experienced a segmentation fault from Berkeley DB XML Java bindings running in a web application (Tomcat). I'm not able to reproduce the error myself, but it's particularly troubling becasue it brought down the entire JVM that was running the web site. I'm not at all proficient with JNI, so maybe I'm not able to properly diagnose the problem from the logs. Below is the seg fault error that was logged by the JVM:
    # An unexpected error has been detected by Java Runtime Environment:
    #  SIGSEGV (0xb) at pc=0x063966c3, pid=20961, tid=1839516576
    # Java VM: Java HotSpot(TM) Server VM (11.3-b02 mixed mode linux-x86)
    # Problematic frame:
    # V  [libjvm.so+0x3966c3]
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    ---------------  T H R E A D  ---------------
    Current thread (0x08822c00):  JavaThread "http-8080-6" daemon [_thread_in_vm, id=21027, stack(0x6da2c000,0x6da4d000)]
    siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000
    Registers:
    EAX=0x00000000, EBX=0x08b598d8, ECX=0x0006da4b, EDX=0x08822c00
    ESP=0x6da4b6d4, EBP=0x6da4b738, ESI=0x00000ffc, EDI=0x6db77880
    EIP=0x063966c3, CR2=0x00000000, EFLAGS=0x00010216
    Top of Stack: (sp=0x6da4b6d4)
    0x6da4b6d4:   00000000 67c9ecf8 67c9ece3 08b598d8
    0x6da4b6e4:   6db77880 6db77888 6db77c74 08822c00
    0x6da4b6f4:   00000000 00c5a1e3 6da4b718 08822c00
    0x6da4b704:   6e000048 00000011 67d0b11c 08822c00
    0x6da4b714:   0000001d 6da4b738 67c92fa4 08822d14
    0x6da4b724:   08a64cb4 08c4cddc 67d0b11c 00000000
    0x6da4b734:   0000001d 6da4b7f8 67c732db 08822d14
    0x6da4b744:   00000000 00000000 67c9ece3 6da4b7d0
    Instructions: (pc=0x063966c3)
    0x063966b3:   ac 8b 43 08 89 45 b0 8b 43 0c 89 45 b4 8b 45 0c
    0x063966c3:   8b 00 50 e8 35 02 fe ff 83 ec 0c 89 c6 50 e8 72
    Stack: [0x6da2c000,0x6da4d000],  sp=0x6da4b6d4,  free space=125k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x3966c3]
    C  [libdbxml_java-2.4.so+0x2612db]  _Z17createCPPXmlValueP7JNIEnv_P8_jobjectPb+0xd3
    C  [libdbxml_java-2.4.so+0x26bbcd]  _Z24createCPPXmlQueryContextP7JNIEnv_P8_jobjectP7_jclass+0x969
    C  [libdbxml_java-2.4.so+0x27f2ff]  Java_com_sleepycat_dbxml_dbxml_1javaJNI_XmlManager_1prepare_1_1SWIG_10+0xe7
    j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
    j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7
    j  com.mycompany.dao.xml.XmlDao.executeQuery(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Ljava/util/List;+14
    j  com.mycompany.dao.xml.XMLArticleDAO.getArticleId(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+91
    j  com.mycompany.service.impl.DefaultArticleService.getArticleIdFromUrl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+7
    j  com.mycompany.controller.Level3Controller.handleRequestInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+236
    j  org.springframework.web.servlet.mvc.AbstractController.handleRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+62
    j  org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView;+6
    j  org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+224
    j  org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+219
    j  org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+10
    j  org.springframework.web.servlet.FrameworkServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+3
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+35
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
    j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+374
    j  org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+101
    j  org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+804
    j  org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+365
    j  org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
    j  org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
    j  org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
    j  org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+157
    j  org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+432
    j  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82
    j  org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+41
    j  java.lang.Thread.run()V+11
    v  ~StubRoutines::call_stub
    V  [libjvm.so+0x375c9d]
    V  [libjvm.so+0x5057f8]
    V  [libjvm.so+0x3755b0]
    V  [libjvm.so+0x37563d]
    V  [libjvm.so+0x3e5ca5]
    V  [libjvm.so+0x5cde5d]
    V  [libjvm.so+0x506929]
    C  [libpthread.so.0+0x53cc]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
    j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7
    j  com.mycompany.dao.xml.XmlDao.executeQuery(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Ljava/util/List;+14
    j  com.mycompany.dao.xml.XMLArticleDAO.getArticleId(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+91
    j  com.mycompany.service.impl.DefaultArticleService.getArticleIdFromUrl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+7
    j  com.mycompany.controller.Level3Controller.handleRequestInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+236
    j  org.springframework.web.servlet.mvc.AbstractController.handleRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+62
    j  org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView;+6
    j  org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+224
    j  org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+219
    j  org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+10
    j  org.springframework.web.servlet.FrameworkServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+3
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+35
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
    j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+374
    j  org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+101
    j  org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+804
    j  org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+365
    j  org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
    j  org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
    j  org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
    j  org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+157
    j  org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+432
    j  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82
    j  org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+41
    j  java.lang.Thread.run()V+11
    v  ~StubRoutines::call_stub
    ---------------  P R O C E S S  ---------------
    Java Threads: ( => current thread )
      0x088d4800 JavaThread "http-8080-8" daemon [_thread_blocked, id=21029, stack(0x66e7d000,0x66e9e000)]
      0x08b3d400 JavaThread "http-8080-7" daemon [_thread_blocked, id=21028, stack(0x6da0b000,0x6da2c000)]
    =>0x08822c00 JavaThread "http-8080-6" daemon [_thread_in_vm, id=21027, stack(0x6da2c000,0x6da4d000)]
      0x08823400 JavaThread "http-8080-5" daemon [_thread_blocked, id=21022, stack(0x65cdf000,0x65d00000)]
      0x0881e000 JavaThread "http-8080-4" daemon [_thread_blocked, id=21019, stack(0x6da4d000,0x6da6e000)]
      0x08d75400 JavaThread "pool-2-thread-1" [_thread_blocked, id=21018, stack(0x660df000,0x66100000)]
      0x08976400 JavaThread "http-8080-3" daemon [_thread_blocked, id=21017, stack(0x6da6e000,0x6da8f000)]
      0x08976000 JavaThread "http-8080-2" daemon [_thread_blocked, id=21011, stack(0x6da8f000,0x6dab0000)]
      0x08c4c000 JavaThread "http-8080-1" daemon [_thread_blocked, id=21006, stack(0x6dd9d000,0x6ddbe000)]
      0x08b65000 JavaThread "TP-Monitor" daemon [_thread_blocked, id=21005, stack(0x6ddbe000,0x6dddf000)]
      0x08c5ec00 JavaThread "TP-Processor4" daemon [_thread_in_native, id=21004, stack(0x6dddf000,0x6de00000)]
      0x08c62c00 JavaThread "TP-Processor3" daemon [_thread_blocked, id=21003, stack(0x6df41000,0x6df62000)]
      0x08b66800 JavaThread "TP-Processor2" daemon [_thread_blocked, id=21002, stack(0x6df62000,0x6df83000)]
      0x08eab000 JavaThread "TP-Processor1" daemon [_thread_blocked, id=21001, stack(0x6df83000,0x6dfa4000)]
      0x08c53800 JavaThread "http-8080-Acceptor-0" daemon [_thread_in_native, id=21000, stack(0x6dfa4000,0x6dfc5000)]
      0x08c5d000 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=20999, stack(0x6df1c000,0x6df3d000)]
      0x08c9e400 JavaThread "pool-1-thread-1" [_thread_blocked, id=20998, stack(0x66ea5000,0x66ec6000)]
      0x08684800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=20996, stack(0x6e1e0000,0x6e201000)]
      0x08683000 JavaThread "CompilerThread1" daemon [_thread_blocked, id=20995, stack(0x6e201000,0x6e282000)]
      0x0867e800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=20994, stack(0x6e282000,0x6e303000)]
      0x0867d000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20993, stack(0x6e303000,0x6e324000)]
      0x0867b800 JavaThread "Surrogate Locker Thread (CMS)" daemon [_thread_blocked, id=20992, stack(0x6e324000,0x6e345000)]
      0x08668000 JavaThread "Finalizer" daemon [_thread_blocked, id=20991, stack(0x6e545000,0x6e566000)]
      0x08666c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=20990, stack(0x6e566000,0x6e587000)]
      0x08058800 JavaThread "main" [_thread_in_native, id=20962, stack(0xb7fc9000,0xb7fea000)]
    Other Threads:
      0x08663400 VMThread [stack: 0x6e587000,0x6e608000] [id=20989]
      0x08686800 WatcherThread [stack: 0x6e15f000,0x6e1e0000] [id=20997]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    par new generation   total 471872K, used 261897K [0x70490000, 0x90490000, 0x90490000)
      eden space 419456K,  60% used [0x70490000, 0x7fb7eb48, 0x89e30000)
      from space 52416K,  17% used [0x89e30000, 0x8a703c70, 0x8d160000)
      to   space 52416K,   0% used [0x8d160000, 0x8d160000, 0x90490000)
    concurrent mark-sweep generation total 524288K, used 0K [0x90490000, 0xb0490000, 0xb0490000)
    concurrent-mark-sweep perm gen total 22400K, used 22275K [0xb0490000, 0xb1a70000, 0xb4490000)
    ***DYNAMIC LIBRARIES TRUNCATED (POST TOO LONG)***
    VM Arguments:
    jvm_args: -Xmx1024m -Xms1024m -Xmn512m -Xss128k
    -XX:ParallelGCThreads=20 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:SurvivorRatio=8
    -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=31 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    -Djava.util.logging.config.file=/opt/apps/tomcat-6.0.18/conf/logging.properties -Djava.endorsed.dirs=/opt/apps/tomcat-6.0.18/endorsed
    -Dcatalina.base=/opt/apps/tomcat-6.0.18 -Dcatalina.home=/opt/apps/tomcat-6.0.18 -Djava.io.tmpdir=/opt/apps/tomcat-6.0.18/temp
    java_command: org.apache.catalina.startup.Bootstrap start
    Launcher Type: SUN_STANDARD
    Environment Variables:
    PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/opt/apps/php/bin:/opt/apps/apache2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
    LD_LIBRARY_PATH=/usr/java/jdk1.6.0_13/jre/lib/i386/server:/usr/java/jdk1.6.0_13/jre/lib/i386:/usr/java/jdk1.6.0_13/jre/../lib/i386:/opt/dbxml/lib
    SHELL=/bin/bash
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x6071f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGBUS: [libjvm.so+0x6071f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGFPE: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGPIPE: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGXFSZ: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGILL: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: [libjvm.so+0x506d80], sa_mask[0]=0x00000000, sa_flags=0x10000004
    SIGHUP: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGINT: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGTERM: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGQUIT: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    ---------------  S Y S T E M  ---------------
    OS:Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
    uname:Linux 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686
    libc:glibc 2.3.4 NPTL 2.3.4
    rlimit: STACK 10240k, CORE 0k, NPROC 32742, NOFILE 1024, AS infinity
    load average:0.00 0.00 0.00
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2073300k(27792k free), swap 5197384k(1995648k free)
    vm_info: Java HotSpot(TM) Server VM (11.3-b02) for linux-x86 JRE (1.6.0_13-b03), built on Mar  9 2009 01:16:42 by "java_re" with gcc 3.2.1-7a (J2SE release)
    time: Mon Jul  27 01:51:01 2009
    elapsed time: 11252 secondsI see some "thread blocked" statements, one of them being on the "Low Memory Detector" daemon. Not sure what to make of that.
    This is the method chain (from what I can tell) that caused the error:
    public String getArticleId(String type, String category, String normalizedTitle)
              throws DAOException, DataNotFoundDAOException {
              XmlQueryContext context = null;
              try{
                   context = this.getXmlManager().createQueryContext();
                   context.setEvaluationType(context.Eager);
                   context.setVariableValue("type", new XmlValue(type));
                   context.setVariableValue("category", new XmlValue(category));
                   context.setVariableValue("normalizedTitle", new XmlValue(normalizedTitle));
                   context.setVariableValue("containerName", new XmlValue(this.getContainer().getName()));
                   List<String> results = executeQuery(articleIdQuery, context);
                   if(results.size()>1){
                        logger.warn(String.format("more than one article found for type:%s, category:%s, normalized-title:%s", type, category, normalizedTitle));
                   }else if(results.size()==0){
                        throw new DataNotFoundDAOException(String.format("unable to find an article that matches type:%s, category:%s, normalized-title:%s", type, category, normalizedTitle));
                   /* dbxml returns query values far xml attributes in this format: {}id="this_is_the_id_we_want"
                    * we must extract the id before returning
                   String idString = results.get(0);
                   return idString.substring(idString.indexOf("\"")+1, idString.length()-1);
              }catch (XmlException e) {
                   throw new DAOException("there was a problem querying the database", e);
              } finally{
                   context.delete();
         protected List<String> executeQuery(String query, XmlQueryContext context)
                   throws DAOException {
              // Prepare (compile) the query
              List<String> xmlNodes = new ArrayList<String>();
              XmlQueryExpression qe = null;
              XmlResults results = null;
              try {
                   qe = xmlManager.prepare(query, context);
                   logger.debug("about to perform query: " + qe.getQuery());
                   results = qe.execute(context);
                   while (results.hasNext()) {
                        xmlNodes.add(results.next().asString());
              } catch (XmlException e) {
                   throw new DAOException("Unable to retrieve Page from db", e);
              } finally{
                   if(results != null){
                        results.delete();
                   if(qe != null){
                        qe.delete();
              return xmlNodes;
         }And this is the query that was passed into the method:
    collection($containerName)/article[type=$type and category=$category and normalized-title=$normalizedTitle]/@idSince this happened in a running web application, I unfortunately can't determine exactly which values were set for the query variables in this instance. However, by the nature of this application, those values are NOT taken from user input, so it would be safe to assume that the input comes from a valid, finite set of values.
    Any help would be greatly appreciated.
    Thanks
    Edited by: eric44 on Jul 27, 2009 2:34 PM

    Thanks Lauren.
    I have not yet applied the patch. I will do so shortly. However, I was able to do a bit more tracing, and I think I've gotten to the root of the problem. The seg fault is happening when a null value is used in a query. That is, a Java variable whose value is null is used as the constructor argument to new XmlValue(String s), and then that value is used in the query. I don't know exactly where the error is happening; the log seems a tad ambiguous. Again, I'm not really comfortable at the low-level, but it seems that the stack trace is rooted in the "prepare" java method, but then there seems to be some native trace directly referencing the creation of XmlValue
    Stack: [0x6da2c000,0x6da4d000],  sp=0x6da4b6d4,  free space=125k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x3966c3]
    C  [libdbxml_java-2.4.so+0x2612db]  _Z17createCPPXmlValueP7JNIEnv_P8_jobjectPb+0xd3
    C  [libdbxml_java-2.4.so+0x26bbcd]  _Z24createCPPXmlQueryContextP7JNIEnv_P8_jobjectP7_jclass+0x969
    C  [libdbxml_java-2.4.so+0x27f2ff]  Java_com_sleepycat_dbxml_dbxml_1javaJNI_XmlManager_1prepare_1_1SWIG_10+0xe7
    j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
    j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7thanks again

  • "Segmentation fault" during tns rman active duplicate

    Hello. I am trying to do an active duplicate using tns connectivity and just after restoring the controlfile the process fails with the error "Segmentation fault". However if I start the rman using Ezconnect everything goes smoothly. Restarting the databases did not help. What could be the reason? Here is the output with the error:
    rman target sys/oracle@EN9 auxiliary sys/oracle@EN910
    Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jun 13 17:41:15 2013
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    connected to target database: EN9 (DBID=529480944)
    connected to auxiliary database: EN910 (not mounted)
    RMAN> duplicate target database to EN910 from active database nofilenamecheck;
    Starting Duplicate Db at 13-JUN-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_AUX_DISK_1
    channel ORA_AUX_DISK_1: SID=24 device type=DISK
    contents of Memory Script:
       sql clone "alter system set  control_files =
      ''+DATA/en910/controlfile/current.271.818012497'' comment=
    ''Set by RMAN'' scope=spfile";
       sql clone "alter system set  db_name =
    ''EN9'' comment=
    ''Modified by RMAN duplicate'' scope=spfile";
       sql clone "alter system set  db_unique_name =
    ''EN910'' comment=
    ''Modified by RMAN duplicate'' scope=spfile";
       shutdown clone immediate;
       startup clone force nomount
       backup as copy current controlfile auxiliary format  '+DATA/en910/controlfile/current.275.818012497';
       sql clone "alter system set  control_files =
      ''+DATA/en910/controlfile/current.275.818012497'' comment=
    ''Set by RMAN'' scope=spfile";
       shutdown clone immediate;
       startup clone nomount;
       alter clone database mount;
    executing Memory Script
    sql statement: alter system set  control_files =   ''+DATA/en910/controlfile/current.271.818012497'' comment= ''Set by RMAN'' scope=spfile
    sql statement: alter system set  db_name =  ''EN9'' comment= ''Modified by RMAN duplicate'' scope=spfile
    sql statement: alter system set  db_unique_name =  ''EN910'' comment= ''Modified by RMAN duplicate'' scope=spfile
    Oracle instance shut down
    Oracle instance started
    Total System Global Area     242208768 bytes
    Fixed Size                     2227176 bytes
    Variable Size                184550424 bytes
    Database Buffers              50331648 bytes
    Redo Buffers                   5099520 bytes
    Starting backup at 13-JUN-13
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=25 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    copying current control file
    Oracle instance started
    Segmentation fault
    tnsnames.ora of target db:
    EN9 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = ora9)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = EN9)
    tnsnames.ora of aux db:
    EN910 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = ora10)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = EN910)
    EN9 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = ora9)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = EN9)
    listener.ora of aux db:
    SID_LIST_LISTENER =
            (SID_LIST =
                    (SID_DESC =
                            (GLOBAL_DBNAME=EN910)
                            (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
                            (SID_NAME=EN910)

    if you have access to MOS:
    Rman Duplicate Fails With Segmentation Fault [ID 744717.1]
    Rman Duplicate Failing With A Segmentation Fault [ID 1092423.1]

  • Segmentation fault in __memp_fget

    Hi bdb experts,
    My program encountered the segfault with the following detailed inf:
    # lsb_release -a
    LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
    Distributor ID: RedHatEnterpriseServer
    Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
    Release: 5.5
    Codename: Tikanga
    filesystem: ext2
    gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
    the BDB config:
    ==================
    set_cachesize 2 0 3
    env flag: DB_CREATE | DB_INIT_MPOOL | DB_THREAD
    db flag: DB_CREATE | DB_THREAD
    And my Berkeley database was configured with 3 partitions
    as config above, my bdb was configured within a multithread environment
    dbp->set_partition(dbp, 3, NULL, db_partition_index)
    ==================
    The coredump back trace:
    Program terminated with signal 11, Segmentation fault.
    #0 0x00002ad2db2a78b1 in __memp_fget (dbmfp=0x1f9301e0, pgnoaddr=0x46582324, ip=0x0, txn=0x0, flags=0, addrp=0x46582328) at ../src/mp/mp_fget.c:260
    260 if (bhp->pgno != *pgnoaddr || bhp->mf_offset != mf_offset)
    (gdb) bt
    #0 0x00002ad2db2a78b1 in __memp_fget (dbmfp=0x1f9301e0, pgnoaddr=0x46582324, ip=0x0, txn=0x0, flags=0, addrp=0x46582328) at ../src/mp/mp_fget.c:260
    #1 0x00002ad2db14adb7 in __bam_search (dbc=0x2aaab89d1430, root_pgno=1, key=0x46582b20, flags=12802, slevel=1, recnop=0x0, exactp=0x465826b4) at ../src/btree/bt_search.c:806
    #2 0x00002ad2db1305c4 in __bamc_search (dbc=0x2aaab89d1430, root_pgno=1, key=0x46582b20, flags=14, exactp=0x465826b4) at ../src/btree/bt_cursor.c:2804
    #3 0x00002ad2db12e170 in __bamc_put (dbc=0x2aaab89d1430, key=0x46582b20, data=0x46582af0, flags=20, pgnop=0x46582784) at ../src/btree/bt_cursor.c:2143
    #4 0x00002ad2db22fd95 in __dbc_iput (dbc=0x2aaab49c68e0, key=0x46582b20, data=0x46582af0, flags=20) at ../src/db/db_cam.c:2134
    #5 0x00002ad2db22fbf7 in __dbc_put (dbc=0x2aaab49c68e0, key=0x46582b20, data=0x46582af0, flags=20) at ../src/db/db_cam.c:2047
    #6 0x00002ad2db2c6b91 in __partc_put (dbc=0x2aaab5389810, key=0x46582b20, data=0x46582af0, flags=20, pgnop=0x465828b4) at ../src/db/partition.c:1055
    #7 0x00002ad2db22fd95 in __dbc_iput (dbc=0x2aaab5389810, key=0x46582b20, data=0x46582af0, flags=20) at ../src/db/db_cam.c:2134
    #8 0x00002ad2db22fbf7 in __dbc_put (dbc=0x2aaab5389810, key=0x46582b20, data=0x46582af0, flags=20) at ../src/db/db_cam.c:2047
    #9 0x00002ad2db22aad1 in __db_put (dbp=0x1f92db90, ip=0x0, txn=0x0, key=0x46582b20, data=0x46582af0, flags=20) at ../src/db/db_am.c:537
    #10 0x00002ad2db24488c in __db_put_pp (dbp=0x1f92db90, txn=0x0, key=0x46582b20, data=0x46582af0, flags=20) at ../src/db/db_iface.c:1640
    #11 0x000000000041be46 in bdb::put (this=0x1f92c0a0, key=0x2aaab800103c "Layout:http://emap3.mapabc.com/mapabc/maptile?v=w2.61&x=54&y=26&z=6",
    value=0x2aaab8001240 "256|256▒\232-N", vsize=11, ts=1311611596) at backend/bdb.cc:268
    #12 0x00000000004151bf in cache_process_add (cmd_no=2, req_head=0x2aaab8001010, req_buf=0x46582e90, res_head=0x2aaacc0008c0, res_buf=0x46582e70) at gate_cache.cpp:1061
    #13 0x00000000004121e0 in ub_process_cmdmap (cmd_map=0x508a60, cmd_no=2, req_head=0x2aaab8001010, req_buf=0x46582e90, res_head=0x2aaacc0008c0, res_buf=0x46582e70)
    at ../../../../../../public/ub/output/include/ub_proccmd.h:27
    #14 0x0000000000414245 in cache_cmdproc_callback () at gate_cache.cpp:1302
    #15 0x0000000000469701 in apool_consume (pool=0x1f92e950, data=0x1f92e858) at apool_native.cpp:39
    #16 0x000000000044407f in apoolworkers (param=0x1f92e858) at apool.cpp:533
    #17 0x00000033b100673d in start_thread () from /lib64/libpthread.so.0
    #18 0x00000033b04d3d1d in clone () from /lib64/libc.so.6
    My question is:
    1) in multithread env bdb put and get method should have some other flag exception DB_THREAD or other config for env and db open?
    2) does the ext2 fs may affect the disk read and write for bdb?
    3) does the number of threads of my program affect the bdb put and get?
    4) what is the suitable page size for 64bit machine of bdb?

    Hello,
    What is the Berkeley DB version?
    For your question on page size please take a look at the
    documentation on, "Selecting a page size" at:
    http://download.oracle.com/docs/cd/E17076_02/html/programmer_reference/general_am_conf.html#am_conf_pagesize
    and for those on multithreaded environments please take a
    look at the documentation on, "Multithreaded applications" at:
    http://download.oracle.com/docs/cd/E17076_02/html/programmer_reference/program_mt.html
    I am not aware of any impacts of the ext2 filesystem. Perhaps
    someone else might have more information on that.
    Some other suggestions are to:
    0. Build with --enable-diagnostic to enable run-time
    debugging checks.
    1. turn on verbose error messaging as that often provides
    additional run-time error information. Please see the,
    "Run-time error information", documentation at:
    http://download.oracle.com/docs/cd/E17076_02/html/installation/debug_runtime.html
    2. Collect db_stat -MA statistics to to verify that the cache details
    look to be in order. See:
    http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/db_stat.html
    Thanks,
    Sandra

  • Segmentation fault when enabling replication with SQL API

    Hi,
    I've compiled BDB 5.3.21 on Ubuntu 11.04 (x86) with the following configure options:
    ../dist/configure enable-sql enable-sql_compat enable-debug enable-tcl --with-tcl=/usr/lib
    I was able to follow the Replication Usage Examples given in "Getting Started with the SQL APIs" to set up a set of replicated master/client databases.
    However, after I exited out of the dbsql session that started replication on the master database and re-opened the master database with dbsql, executing "pragma replication_initial_master=ON;" followed by "pragma replication=ON;" led to a segmentation fault. gdb showed that the segmentation fault occurred at:
    dbsql> pragma replication=ON;
    Program received signal SIGSEGV, Segmentation fault.
    0x0032d42b in __env_ref_get (dbenv=0x8056ad8, countp=0xbfffd498)
    at ../src/env/env_region.c:772
    772          renv = infop->primary;
    (gdb) list
    767          REGENV *renv;
    768          REGINFO *infop;
    769     
    770          env = dbenv->env;
    771          infop = env->reginfo;
    772          renv = infop->primary;
    773          *countp = renv->refcnt;
    774          return (0);
    775     }
    776     
    (gdb)
    Does anybody know of a solution to this or could this be a bug? Thanks in advance.
    P.S. here's a stack trace:
    (gdb) bt
    #0 0x0032d42b in __env_ref_get (dbenv=0x8056ad8, countp=0xbfffd498)
    at ../src/env/env_region.c:772
    #1 0x001786fc in hasDatabaseConnections (p=0x8056708)
    at ../lang/sql/generated/sqlite3.c:44420
    #2 0x00178a11 in bdbsqlPragmaStartReplication (pParse=0x80648e0,
    pDb=0x80561cc) at ../lang/sql/generated/sqlite3.c:44533
    #3 0x001797f5 in bdbsqlPragma (pParse=0x80648e0,
    zLeft=0x8062e20 "replication", zRight=0x8062dc0 "ON", iDb=0)
    at ../lang/sql/generated/sqlite3.c:44812
    #4 0x001c215d in sqlite3Pragma (pParse=0x80648e0, pId1=0x8064b60,
    pId2=0x8064b70, pValue=0x8064b90, minusFlag=0)
    at ../lang/sql/generated/sqlite3.c:78941
    #5 0x001e5c83 in yy_reduce (yypParser=0x8064b20, yyruleno=256)
    at ../lang/sql/generated/sqlite3.c:96668
    #6 0x001e6761 in sqlite3Parser (yyp=0x8064b20, yymajor=1, yyminor=...,
    pParse=0x80648e0) at ../lang/sql/generated/sqlite3.c:97051
    #7 0x001e7537 in sqlite3RunParser (pParse=0x80648e0,
    zSql=0x80648b8 "pragma replication=ON;", pzErrMsg=0xbfffdba0)
    at ../lang/sql/generated/sqlite3.c:97877
    #8 0x001c730e in sqlite3Prepare (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, saveSqlFlag=1,
    ---Type <return> to continue, or q <return> to quit---
    pReprepare=0x0, ppStmt=0xbfffdc8c, pzTail=0xbfffdc88)
    at ../lang/sql/generated/sqlite3.c:80736
    #9 0x001c7739 in sqlite3LockAndPrepare (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, saveSqlFlag=1,
    pOld=0x0, ppStmt=0xbfffdc8c, pzTail=0xbfffdc88)
    at ../lang/sql/generated/sqlite3.c:80828
    #10 0x001c7a5e in sqlite3_prepare_v2 (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, ppStmt=0xbfffdc8c,
    pzTail=0xbfffdc88) at ../lang/sql/generated/sqlite3.c:80903
    #11 0x0804baf6 in shell_exec (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;",
    xCallback=0x804a3c4 <shell_callback>, pArg=0xbfffde14, pzErrMsg=0xbfffdcfc)
    at ../lang/sql/sqlite/src/shell.c:1092
    #12 0x0805030e in process_input (p=0xbfffde14, in=0x0)
    at ../lang/sql/sqlite/src/shell.c:2515
    #13 0x08051453 in main (argc=2, argv=0xbffff3f4)
    at ../lang/sql/sqlite/src/shell.c:2946
    -Irving
    Edited by: snowcrash on Jan 15, 2013 2:16 PM

    Thank you for reporting this. I have been able to reproduce this crash in-house.
    You need to specify the replication_initial_master and replication pragmas as part of initially creating your SQL database. The replication_initial_master pragma is not used or needed after the initial database creation at the initial master site. The replication=on pragma is a persistent setting that we remember internally the first time you specify it. This means that after specifying replication=on for the first time on a site, we will automatically restart replication for you in future dbsql sessions when we open the underlying Berkeley DB environment.
    This gives you a very simple workaround: don't respecify replication=on when you reenter dbsql.
    Of course, we shouldn't be crashing on an unnecessary pragma. I have added this to our list of fixes to consider for the future.
    Thanks,
    Paula Bingham
    Oracle

Maybe you are looking for

  • Error While opening an Analytic View (Imported View)

    Dear Colleagues, Procedure Followed as: I exported (through Developer mode) an analytic view named with "abc" from a system called "123"  to my local system. From my local machine I   imported the view into another system called "456", these two proc

  • I can't change the colour of linked text?

    I have a black background on the side of my web page containing the menu bars which requires the link text to be white so it can be seen. I also have it set to change to yellow when you hover over it. The problem is that this setting seems universal

  • How to pass header text in bapi for sale order

    hai to all i am using BAPI_SALESORDER_CREATEFROMDAT2 to create sale order i can find order_text in tables parameters for creating item texts but in my senario i have to maintain header text please advice me how to proceed rgds vijay

  • How do I convert a String to a DateTime in SQL ??

    I have retreived the current date and time and place into String data type. but my table colmun is in datetime data type. How do I convert ?? Thanks in advance.

  • Where to update the query

    Hi All, I am new to webadi. Pls do the needful to resolve my problem. My clinet gave letter names and he told me that, letter are retriving incorrrect results. So, change the query to get the proper details. So, Can anobody suggest what i need to do