Click to See Complete Forum and Search --> : Problems in debugging core files
teamankur
April 19th, 2006, 04:06 AM
Dear Friends,
First of all Thanks for sparing time and reading this.
I am a C++ developer and facing problems while debugging a core file.
Here are my environment description.
OS: SOLARIS 5.9
Compiler: GCC 2.95.2
Debugger: GNU gdb 5.0
Language C++
Here is my problem description.
My application which is written in C++ fetches data from ORACLE and pushes it into DB2. I am using PRO*C for connectivity to ORACLE and CLI
on DB2 side.
But my application is giving me core dump.
When I try to debug the CORE file using GDB debugger, it gives me following error.
~/core.18385: Value too large for defined data type.
If anybody has faced such a problem before and can tell me how can I debug the core file or why is this message being displayed.
Thanks in advance
Ankur
olivthill
April 19th, 2006, 05:59 AM
Is it the first program you are doing with Pro*C?
Can you show us the line of code where the error occurs, and a few lines before that line, with the declarations of your variables?
teamankur
April 19th, 2006, 06:14 AM
Is it the first program you are doing with Pro*C?
Can you show us the line of code where the error occurs, and a few lines before that line, with the declarations of your variables?
Hi olivthill,
Thanks for kind and prompt response.
I am getting get core dump while putting data into DB2. PRO*C side everything is in place.
While executing a stored procedure in DB2, I tried to see where the problem is. Here is the stack info:
$$$$$$$$$$$$$$$$$$$$$$$$$
#0 0xfe426670 in __1cTCLI_scnTranslateSQdDL6FpnRCLI_STATEMENTINFO_pClph2pl2l4LC44CCh2pnPCLI_LITERALINFO_22lCC2CpnTCLI_ERRORHEADERINFO_pnPCLI_CONNECTINFO__h_ () from /export/home/miginst/sqllib/lib/libdb2.so.1
(gdb) inf sta
#0 0xfe426670 in __1cTCLI_scnTranslateSQdDL6FpnRCLI_STATEMENTINFO_pClph2pl2l4LC44CCh2pnPCLI_LITERALINFO_22lCC2CpnTCLI_ERRORHEADERINFO_pnPCLI_CONNECTINFO__h_ () from /export/home/miginst/sqllib/lib/libdb2.so.1
#1 0xfe3cb568 in __1cLSQdDLPrepare26FpnRCLI_STATEMENTINFO_pClpnTCLI_ERRORHEADERINFO__h_ ()
from /export/home/miginst/sqllib/lib/libdb2.so.1
#2 0xfe3c7624 in SQLPrepare () from /export/home/miginst/sqllib/lib/libdb2.so.1
#3 0x841ec in dbMgr::execute (this=0xa00c84, sql=@0xfcf7b2e0) at dbMgr.cpp:345
#4 0x25a28 in CPCILoader::DoLoad (this=0xa00bf8, oInstance=@0xfcf7b678, vsWarnings=0x0) at pci_loader.cpp:945
#5 0x3b6fc in {anonymous}::processPatents (arg=0xad9c78) at pci2xml.cpp:826
(gdb) f 4
#4 0x25a28 in CPCILoader::DoLoad (this=0xa00bf8, oInstance=@0xfcf7b678, vsWarnings=0x0) at pci_loader.cpp:945
945 mgr.execute ( "rollback" );
sqlmessage = "[IBM][CLI Driver] CLI0120E Memory allocation failure. SQLSTATE=HY001 {SQLProcedureColumns}\000esult of a query is an empty table. SQLSTATE=02000\n {SQLExecDirect}\000lid because the primary key, unique con"...,
sqlstate = "HY001\000r those columns. SQLSTATE=23505\n {SQLExecDirect}\000Direct}\000\000\000\000\000\000\225Ëø\000\000\000\000\000\000\000\000\000\002", '\000' <repeats 19 times>, "\020\004X\000\000\000\000\000\000\001\220", '\000' <repeats 13 times>, "*\000@\000\002\000\000\000\237!è", '\000' <repeats 13 times>, "\020\004X\000\000\000\000\000\225ÎH\000\000\000\000\000\000\000\000\000\002", '\000' <repeats 19 times>, "\020\004X\000\000\000\000\000\225Îx",
sqlstatement = {<_String_base<char,_STL::allocator<char> >> = {
$$$$$$$$$$$$$$$$$$
Now the problem is that I am unable to again debug the core files which are being created. When ever I try to debug the CORE FILE it gives me following message:
$$$$$$$$
Values too large for data type.
$$$$$$$$
So am unable to ZERO IN to the root cause.
Is that the DB2 driver is behaving ugly because it is unable to allocate the required memory?
Thanks and Regards
Ankur
olivthill
April 19th, 2006, 06:31 AM
Sorry, I realize I might not be very helpful, because althought I know Pro*C, I don't know DB2, and I've used dbx a long time ago.
However, your messages look quite interesting.
The error occurs when a statement is executed, and it seems that you're trying to insert a record whose primary key is the same as that of a record already present in the database. Maybe you need to purge you destination table before inserting your new rows, or maybe try not to insert twice the same data. Good luck!
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.