Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Segmentation Fault-Core Dump Error -with Oracle10 programming with C++

561590Feb 13 2007 — edited Feb 13 2007
Hi All
I am getting this weird segmentation fault followed by a core dump when i try to execute my executable for the C++ interface i created for simply connecting to Oracle 10 server on AIX 5.3.0.0 server.The program is as follows:

Program: testocci.cc

#include <stdlib.h>
#include <occi.h>
#include <iostream>
#include <exception>
using namespace oracle::occi;
using namespace std;
int main()
{
Environment *env = Environment::createEnvironment(Environment::OBJECT);
try{
Connection *conn = env->createConnection("icis","icis","csuicis01.mcilink.com" );
cout << "Environment and Connection created" << endl;
env->terminateConnection(conn);
}
catch(SQLException &ex)
{
cout<<"Exception thrown "<<endl;
cout<<"Error number: "<< ex.getErrorCode()<<endl;
cout<<ex.getMessage() << endl;
}
Environment::terminateEnvironment(env);
cout << "Environment and Connection terminated" << endl;
//return 0;
}

Compilation output:

bash-3.00$ gmake
gmake testocci
gmake[1]: Entering directory `/home/msarkar/dboralib'
xlC_r -g -I/usr/lpp/oracle/10.2.0/ldap/public -I/usr/lpp/oracle/10.2.0/plsql/public -I/usr/lpp/oracle/10.2.0/rdbms/public -I/usr/lpp/oracle/10.2.0/xdk/include -I//home/msarkar/dboralib/ocl/include -I/usr/local/include -D_USE_CONTAINER -D_USE_ASTRING -D_THREAD_SAFE -c -o testocci.o testocci.cc

xlC_r -L/usr/local/lib/xlC -L/usr/lpp/oracle/10.2.0/lib32 /usr/lib/libiconv.a -L/usr/local/lib -locci10 -lclient10 -lclntst10 -lodm -lperfstat -lAString -lRegex -o testocci testocci.o

ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiUtil.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiMessage.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiNumber.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiDate.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiBfile.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiAgent.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiTimestamp.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiIntervalDS.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiIntervalYM.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiClob.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiAnyDataImpl.o], imported symbol__n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiPObj.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiSubscription.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiListener.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiProducer.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiMapImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiStatelessCPImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiResultSetVec.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiStatementVec.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiResultSetImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiStatementImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiMetaData.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiConnPoolImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiConnectionImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiEnvImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.
ld: 0711-773 WARNING: Object /usr/lpp/oracle/10.2.0/lib32/libocci10.a[occiSQLExceptionImpl.o], imported symbol __n_pthreads
Symbol was expected to be local. Extra instructions are being generated to reference the symbol.

gmake[1]: Leaving directory `/home/msarkar/dboralib'

bash-3.00$ testocci
Segmentation fault (core dumped)


DBX Output:

bash-3.00$ dbx testocci
Type 'help' for help.
[using memory image in core]
reading symbolic information ...

Segmentation fault in OCIPClearMxCtr at 0x10011d44 ($t1)
0x10011d44 (OCIPClearMxCtr+0x4) b00300e4 sth r0,0xe4(r3)
(dbx) where
OCIPClearMxCtr(??) at 0x10011d44
OCCIErrorGet__Q2_6oracle4occiFPvUiPUcPiT3N22(??, ??, ??, ??, ??, ??, ??) at 0x10cdc138
__ct__Q3_6oracle4occi16SQLExceptionImplFPvT1i(??, ??, ??, ??) at 0x10003848
SQLExceptionCreate__Q2_6oracle4occiFPvi(??, ??, ??) at 0x10cdfcc8
createEnvironment__Q3_6oracle4occi11EnvironmentFQ4_6oracle4occi11Environment4ModePvPFPvUl_PvPFPvT1Ul_PvPFPvT1_v(??, ??, ??, ??, ??) at 0x10dde938
main(), line 11 in "testocci.cc"
(dbx)

I would be extremely grateful if someone could help me to solve this issue.I tried several options or compiling and linking but no luck yet.:(
Thanks
Madhu.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2007
Added on Feb 13 2007
6 comments
656 views