Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.oracle.misc > #800

Embedded SQL (C) with multithreaded applications - crashes

From Mark <i@dontgetlotsofspamanymore.invalid>
Newsgroups comp.databases.oracle.misc
Subject Embedded SQL (C) with multithreaded applications - crashes
Date 2014-01-23 09:11 +0000
Message-ID <j7m1e95bkp4942pkgdr616kllciolf8hia@4ax.com> (permalink)

Show all headers | View raw


[Oracle 11.1.0.7.0 on Linux 2.6.32-431.3.1.el6.x86_64]

I am adapting some legacy code to make it multithreaded.  The code
always crashes in the Oracle library in a sub-thread when it is trying
to connect to a database.  

The first statement in the main thread is:
    EXEC SQL ENABLE THREADS;

and the ProC preprocessor is called with "threads=yes".

The first thing the sub-threads do is to connect to the databases
using this code:

    EXEC SQL CONTEXT ALLOCATE :ctx;
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL CONNECT :db_name IDENTIFIED BY :oracle_db_password;
    EXEC SQL ALTER SESSION SET SESSION_CACHED_CURSORS = 10;
    EXEC SQL ALTER SESSION SET NLS_DATE_LANGUAGE    = 'ENGLISH';
    EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT      = 'DD/MM/YY
HH24:MI:SS';
    EXEC SQL ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'DD/MM/YY
HH24:MI:SS';
    EXEC SQL COMMIT;

The second time this code is called (to connect to a second database)
the code crashes at the CONNECT statement with a segmentation fault.

Part of the traceback is:

Program terminated with signal 11, Segmentation fault.
#0  0x0610bc9e in kpummTLSGET1 ()
   from /oracle/instantclient/libclntsh.so.11.1
(gdb) bt
#0  0x0610bc9e in kpummTLSGET1 ()
   from /oracle/instantclient/libclntsh.so.11.1
#1  0x04a01ad3 in kpuhhini ()
   from /oracle/instantclient/libclntsh.so.11.1
#2  0x04a0e2c2 in kpughndl0 ()
   from /oracle/instantclient/libclntsh.so.11.1
#3  0x049ea7c4 in OCIHandleAlloc ()
   from /oracle/instantclient/libclntsh.so.11.1
#4  0x049d255e in sqlv8c ()
   from /oracle/instantclient/libclntsh.so.11.1
#5  0x049d216d in sqllam ()
   from /oracle/instantclient/libclntsh.so.11.1
#6  0x049d3b0f in sqllo3t ()
   from /oracle/instantclient/libclntsh.so.11.1
#7  0x049d36cc in sqlcnt ()
   from /oracle/instantclient/libclntsh.so.11.1
#8  0x05fdc889 in sqlexp ()
...

I know there is not much information in this post but I don't want to
make it too long to read.  I would be grateful for specific ideas on
how to solve this.  I know plenty about programming and multithreaded
applications but I am new to Oracle.
-- 
(\__/)  M.
(='.'=) If a man stands in a forest and no woman is around
(")_(") is he still wrong?

Back to comp.databases.oracle.misc | Previous | Next | Find similar


Thread

Embedded SQL (C) with multithreaded applications - crashes Mark <i@dontgetlotsofspamanymore.invalid> - 2014-01-23 09:11 +0000

csiph-web