Intresting segv:studio12update1 core dump in stlport 4 startup:mixing C&C++
Hi
I am getting core dump below is the stack trace:
(dbx) where
current thread: t@1
=>[1] std::basic_filebuf<wchar_t,std::char_traits<wchar_t> >::imbue(0xffffffff4b3d0bf0, 0xffffffff7fffe790, 0x4c8, 0xffffffff6971f128, 0x400, 0xffffffff69711e68), at 0xffffffff69592200
[2] std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >::pubimbue(0xffffffff695921a0, 0xffffffff4b3d0bf0, 0xffffffff7fffe790, 0xffffffff6971a938, 0x0, 0xffffffff7fffe6d0), at 0xffffffff6956d4e8
[3] std::basic_ios<wchar_t,std::char_traits<wchar_t> >::imbue(0xffffffff7fffe798, 0xffffffff6971fbd0, 0xffffffff7fffe790, 0xffffffff69711e68, 0x13da94, 0x400), at 0xffffffff6957284c
[4] std::basic_ios<wchar_t,std::char_traits<wchar_t> >::init(0xffffffff6971fbd0, 0xffffffff4b3d0bf0, 0x448, 0xffffffff69711e68, 0x19f4c4, 0x400), at 0xffffffff69572a0c
[5] std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::basic_ostream(0xffffffff6971fbc8, 0xffffffff4b3d0bf0, 0xc0, 0x185fec, 0x0, 0xffffffff69711e68), at 0xffffffff6958becc
[6] std::__Wide_Init::__Wide_Init(0xffffffff4b3ceec0, 0xffffffff4b3d0bf0, 0xffffffff4b3d0c90, 0xffffffff4b3c27d0, 0xffffffff6971fd38, 0xe000), at 0xffffffff4b21444c
---- hidden frames, use 'where -h' to see them all ----
[8] __Cimpl::cplus_init(0x1, 0xffffffff4de0dd60, 0xffffffff4de0dd68, 0x0, 0x1044a4, 0xffffffff4b3cf460), at 0xffffffff4dd08660
[9] 0xffffffff4b235ae8(0x0, 0x0, 0xffffffff7f72cb18, 0xffffffff7f611ee8, 0x11e6a0, 0xffffffff7f402400), at 0xffffffff4b235ae8
[10] call_init(0x1, 0x1, 0xffffffff4b235a10, 0xffffffff68a007b8, 0xffdfffff, 0xffffffff7f72cb18), at 0xffffffff7f611ef0
[11] setup(0xc7, 0x28, 0xc10000, 0xa000000, 0xffffffff61a01b08, 0x100000), at 0xffffffff7f6113b4
[12] _setup(0x6ffffff9, 0xb00, 0xffffffff7f62ae5c, 0x100000040, 0x0, 0xffffffff7ffff158), at 0xffffffff7f620554
[13] rtboot(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xffffffff7f60511c
Some important notes I am mixing C & C++
wrap is the C interface so when I link application I am explicitly linking libC & libstlport.so
-L/opt/sunstudio12.1/lib/stlport4/v9 -lstlport
-L/usr/lib/64
-lstlport
-lCrun
I am compiling my application like this :
CC -g0 -mt -compat=5 -I/opt/sunstudio12.1/prod/include/CC/stlport4 -D_POSIX_PTHREAD_SEMANTICS -DACE_HAS_KSTAT -DACE_HAS_SCTP -DACE_HAS_LKSCTP -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -DSUN_CC_HAS_PVFC_BUG -DACE_HAS_CUSTOM_EXPORT_MACROS=0 -m64 -DXALTEDSUN64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -m64 -D_THREAD_SAFE -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I. -I/export/home/frtbld/3rdparty/include/bdb -I/export/home/frtbld/3rdparty/include -I/export/home/oracle/OraHome/precomp/public -I/export/home/oracle/OraHome/network/public -I/export/home/oracle/OraHome/rdbms/public -I/export/home/oracle/OraHome/plsql/public -I/export/home/oracle/OraHome/rdbms/demo -I/export/home/frtbld/libcinc -I/usr/local/include -c DBAbs.cpp -o /export/home/frtbld/TMPOBJ/DBAbs.o
Generating MyDb.o file from MyDb.cpp file ...
CC -g0 -mt -compat=5 -I/opt/sunstudio12.1/prod/include/CC/stlport4 -D_POSIX_PTHREAD_SEMANTICS -DACE_HAS_KSTAT -DACE_HAS_SCTP -DACE_HAS_LKSCTP -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -DSUN_CC_HAS_PVFC_BUG -DACE_HAS_CUSTOM_EXPORT_MACROS=0 -m64 -DXALTEDSUN64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -m64 -D_THREAD_SAFE -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I. -I/export/home/frtbld/3rdparty/include/bdb -I/export/home/frtbld/3rdparty/include -I/export/home/oracle/OraHome/precomp/public -I/export/home/oracle/OraHome/network/public -I/export/home/oracle/OraHome/rdbms/public -I/export/home/oracle/OraHome/plsql/public -I/export/home/oracle/OraHome/rdbms/demo -I/export/home/frtbld/libcinc -I/usr/local/include -c MyDb.cpp -o /export/home/frtbld/TMPOBJ/MyDb.o
Generating wrap.o file from wrap.cpp file ...
CC -g0 -mt -compat=5 -I/opt/sunstudio12.1/prod/include/CC/stlport4 -D_POSIX_PTHREAD_SEMANTICS -DACE_HAS_KSTAT -DACE_HAS_SCTP -DACE_HAS_LKSCTP -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -DSUN_CC_HAS_PVFC_BUG -DACE_HAS_CUSTOM_EXPORT_MACROS=0 -m64 -DXALTEDSUN64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -m64 -D_THREAD_SAFE -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I. -I/export/home/frtbld/3rdparty/include/bdb -I/export/home/frtbld/3rdparty/include -I/export/home/oracle/OraHome/precomp/public -I/export/home/oracle/OraHome/network/public -I/export/home/oracle/OraHome/rdbms/public -I/export/home/oracle/OraHome/plsql/public -I/export/home/oracle/OraHome/rdbms/demo -I/export/home/frtbld/libcinc -I/usr/local/include -c wrap.cpp -o /export/home/frtbld/TMPOBJ/wrap.o
ar *.o -o /export/home/frtbld/libcbin/LIB_BDBManager.a
/export/home/tuxedo/bea/tuxedo10gR3/bin/buildclient -o /export/home/frtbld/TMPBIN/CompilerPP -f-L/export/home/oracle/OraHome/lib -f-lclntsh \
-f /export/home/frtbld/TMPOBJ/CompilerMainPP.o \
-f /export/home/frtbld/TMPOBJ/CompilerDataBasePP1.o \
-f /export/home/frtbld/TMPOBJ/CompilerDataBasePP2.o \
-f /export/home/frtbld/TMPOBJ/utilityPP.o \
-f "-L/opt/sunstudio12.1/lib/stlport4/v9 -lstlport -L/export/home/frtbld/3rdparty/lib/bdblib -L/export/home/frtbld/3rdparty/lib/acelib -ldb_cxx-4.7 -lACE /export/home/frtbld/libcbin/LIB_DataBase.a /export/home/frtbld/libcbin/LIB_FileManager.a /export/home/frtbld/libcbin/LIB_Log.a /export/home/frtbld/libcbin/LIB_SHMManager.a /export/home/frtbld/libcbin/LIB_Expression.a /export/home/frtbld/libcbin/LIB_Timing.a /export/home/frtbld/libcbin/LIB_MMFManager.a /export/home/frtbld/libcbin/LIB_LicManager.a /export/home/frtbld/libcbin/LIB_InterProcComm.a /export/home/frtbld/libcbin/LIB_BDBManager.a /export/home/frtbld/libcbin/LIB_RatingPPMMFManager.a -L/usr/lib/hpux32/ -L/usr/local/lib/hpux32 -L/lib/hpux32 -L/export/home/frtbld/3rdparty/lib/ssllib -lcrypto -lz -lm -L/usr/lib/64 -L/opt/sunstudio12.1/lib/stlport4/v9 -lCrun "
Regards
Anand Rathi
Hi Thanks for your help
I changed the linking process to use CC
but still its same .....
and i can also see that its invoking __Cimpl::cplus_init
also i have an doubt about 64bit and std::__Wide_Init::__Wide_Init
weather issue is with wide character 64 bit ?
Now the command is
CC -g0 -mt -compat=5 -I/opt/sunstudio12.1/prod/include/CC/stlport4 -D_POSIX_PTHREAD_SEMANTICS -DACE_HAS_KSTAT -DACE_HAS_SCTP -DACE_HAS_LKSCTP -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -DSUN_CC_HAS_PVFC_BUG -DACE_HAS_CUSTOM_EXPORT_MACROS=0 -m64 -DXALTEDSUN64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -m64 -mt -I/export/home/tuxedo/bea/tuxedo10gR3/include -o /export/home/frtbld/TMPBIN/CompilerPP -L/export/home/tuxedo/bea/tuxedo10gR3/lib -xarch=v9 -L/export/home/oracle/OraHome/lib -lclntsh /export/home/frtbld/TMPOBJ/CompilerMainPP.o /export/home/frtbld/TMPOBJ/CompilerDataBasePP1.o /export/home/frtbld/TMPOBJ/CompilerDataBasePP2.o /export/home/frtbld/TMPOBJ/utilityPP.o -L/opt/sunstudio12.1/lib/stlport4/v9 -lstlport -L/export/home/frtbld/3rdparty/lib/bdblib -L/export/home/frtbld/3rdparty/lib/acelib -ldb_cxx-4.7 -lACE /export/home/frtbld/libcbin/LIB_DataBase.a /export/home/frtbld/libcbin/LIB_FileManager.a /export/home/frtbld/libcbin/LIB_Log.a /export/home/frtbld/libcbin/LIB_SHMManager.a /export/home/frtbld/libcbin/LIB_Expression.a /export/home/frtbld/libcbin/LIB_Timing.a /export/home/frtbld/libcbin/LIB_MMFManager.a /export/home/frtbld/libcbin/LIB_LicManager.a /export/home/frtbld/libcbin/LIB_InterProcComm.a /export/home/frtbld/libcbin/LIB_BDBManager.a /export/home/frtbld/libcbin/LIB_RatingPPMMFManager.a -L/usr/lib/hpux32/ -L/usr/local/lib/hpux32 -L/lib/hpux32 -L/export/home/frtbld/3rdparty/lib/ssllib -lcrypto -lz -lm -L/usr/lib/64 -L/opt/sunstudio12.1/lib/stlport4/v9 -lCrun -ltux -lbuft -lfml -lfml32 -lengine -R/usr/lib/lwp -lpthread -lposix4 -lsocket -lnsl -lm -lnsl -lsocket
t@1 (l@1) program terminated by signal SEGV (no mapping at the fault address)
0xffffffff7e192200: imbue+0x0060: ldx [%o0], %o1
(dbx) where
current thread: t@1
=>[1] std::basic_filebuf<wchar_t,std::char_traits<wchar_t> >::imbue(0xffffffff7acd0bf0, 0xffffffff7fffe4d0, 0x4c8, 0xffffffff7e31f128, 0x400, 0xffffffff7e311e68), at 0xffffffff7e192200
[2] std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >::pubimbue(0xffffffff7e1921a0, 0xffffffff7acd0bf0, 0xffffffff7fffe4d0, 0xffffffff7e31a938, 0x13da94, 0xffffffff7fffe410), at 0xffffffff7e16d4e8
[3] std::basic_ios<wchar_t,std::char_traits<wchar_t> >::imbue(0xffffffff7fffe4d8, 0xffffffff7e31fbd0, 0xffffffff7fffe4d0, 0xffffffff7e311e68, 0x13da94, 0x400), at 0xffffffff7e17284c
[4] std::basic_ios<wchar_t,std::char_traits<wchar_t> >::init(0xffffffff7e31fbd0, 0xffffffff7acd0bf0, 0x448, 0xffffffff7e311e68, 0x19f4c4, 0x400), at 0xffffffff7e172a0c
[5] std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::basic_ostream(0xffffffff7e31fbc8, 0xffffffff7acd0bf0, 0xc0, 0x185fec, 0x0, 0xffffffff7e311e68), at 0xffffffff7e18becc
[6] std::__Wide_Init::__Wide_Init(0xffffffff7acceec0, 0xffffffff7acd0bf0, 0xffffffff7acd0c90, 0xffffffff7acc27d0, 0xffffffff7e31fd38, 0xe000), at 0xffffffff7ab1444c
---- hidden frames, use 'where -h' to see them all ----
[8] __Cimpl::cplus_init(0x1, 0xffffffff7d00dd60, 0xffffffff7d00dd68, 0x0, 0x1044a4, 0xffffffff7accf460), at 0xffffffff7cf08660
[9] 0xffffffff7cf0a500(0x0, 0x0, 0xffffffff7f72cb18, 0xffffffff7f611ee8, 0x11e6a0, 0xffffffff79702000), at 0xffffffff7cf0a500
[10] call_init(0x1, 0x3, 0xffffffff7cf0a428, 0xffffffff7f201530, 0xffdfffff, 0xffffffff7f72cb18), at 0xffffffff7f611ef0
[11] elf_bndr(0xffffffff7f500718, 0xffffffff7cf016e0, 0xffffffff7ab35ab4, 0xffffffff7cf06610, 0xffffffff78d009e8, 0xffffffff7f72f6d8), at 0xffffffff7f61f060
[12] elf_rtbndr(0x590000, 0x1001d3538, 0x0, 0xffffffff7ab35ab4, 0x0, 0x0), at 0xffffffff7f60514c
[13] 0x0(0xffffffff7acc7e28, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x0
[14] 0xffffffff7ab35ab4(0x0, 0x0, 0xffffffff7f72cb18, 0xffffffff7f611ee8, 0x11e6a0, 0xffffffff79702000), at 0xffffffff7ab35ab4
[15] call_init(0x1, 0x1, 0xffffffff7ab35a10, 0xffffffff7a900030, 0xffdfffff, 0xffffffff7f72cb18), at 0xffffffff7f611ef0
[16] setup(0x0, 0x27, 0xc10000, 0xa000000, 0xffffffff78d01780, 0x100000), at 0xffffffff7f6113b4
[17] _setup(0x6ffffff9, 0xb00, 0xffffffff7f62ae5c, 0x100000040, 0x0, 0xffffffff7ffff288), at 0xffffffff7f620554
[18] rtboot(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xffffffff7f60511c
Edited by: anandprathi on Aug 12, 2009 9:48 AM
Edited by: anandprathi on Aug 12, 2009 9:52 AM
Similar Messages
-
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. -
Getting core dump when using EXEC SQL CLOSE
In my pro*c program , i have used a cursor to fetch the set of accounts.Once cursor is opened , code will perform set
of operation using fetched data and then cursor is closed. Between open and closing of cursor , i have used 23 EXEC
SQL CLOSE. For example i am copying the value of a to b using strlcpy between fetch and close cursor statement.If
returned value from strlcpy is greater than size of destination variable, then flow should not proceed , in that case I will
close the cursor using EXEC SQL CLOSE and return the flow to calling program. Similarly i have closed the cursor at
another 22 locations.
When i compile the code and run binary the core dump occurs. On analyzing the core it shows
t@null (l@8) terminated by signal SEGV (no mapping at the fault address)
0xffffffffffffffff: <bad address 0xffffffffffffffff>
dbx: core file read error: address 0xfc4ffe48 not in data space
Current function is dbMtBaseClass::Pswd_Change
7860 sqlcxt(&_dbMtCtx, &sqlctx, &sqlstm, &sqlfpn);
if I remove any of the three EXEC SQL CLOSE commands , core dump does not occurs.
It looks strange.Please help me to resolve the issue.In my pro*c program , i have used a cursor to fetch the set of accounts.Once cursor is opened , code will perform set
of operation using fetched data and then cursor is closed. Between open and closing of cursor , i have used 23 EXEC
SQL CLOSE. For example i am copying the value of a to b using strlcpy between fetch and close cursor statement.If
returned value from strlcpy is greater than size of destination variable, then flow should not proceed , in that case I will
close the cursor using EXEC SQL CLOSE and return the flow to calling program. Similarly i have closed the cursor at
another 22 locations.
When i compile the code and run binary the core dump occurs. On analyzing the core it shows
t@null (l@8) terminated by signal SEGV (no mapping at the fault address)
0xffffffffffffffff: <bad address 0xffffffffffffffff>
dbx: core file read error: address 0xfc4ffe48 not in data space
Current function is dbMtBaseClass::Pswd_Change
7860 sqlcxt(&_dbMtCtx, &sqlctx, &sqlstm, &sqlfpn);
if I remove any of the three EXEC SQL CLOSE commands , core dump does not occurs.
It looks strange.Please help me to resolve the issue. -
dbx core dumping when I debug my application with RTC enable (I'm truying to dectect some memory leaks in my code). and I'm getting the following
RTC: Enabling Error Checking...
RTC: Running program...
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) suppress rui
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) cont
t@10 (l@10) signal SEGV (no mapping at the fault address) in __rtc_trap_handler at 0xff2e1148
0xff2e1148: __rtc_trap_handler+0x0058: ld [%l5], %l0
dbx: warning: undefined type number (0,158) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #207 sqlca:(0,158),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,211) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #530 host:(0,211),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,212) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #531 pwd:(0,212),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,213) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #532 usrid:(0,213),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,214) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #533 address:(0,214),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,228) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #577 module:(0,228),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,237) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #638 data:(0,237),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,238) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #639 dest:(0,238),
assuming type `int {assumed}'
dbx: warning: undefined type number (0,846) at /export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #1136 username:G(0,846),
assuming type `int {assumed}'
Current function is queue_message
751 EXEC SQL CALL p_message.queue(:seq,:dest, :data, :notempty, :ret);
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
current thread: t@10
[1] sqlscht(0x48708, 0x47914, 0xa, 0x1, 0x3, 0xa), at 0xfe8cd0f8
[2] sqldbid(0x48708, 0xfacf8aa8, 0x4dbf8, 0xff0d180c, 0x4, 0x390), at 0xfe8b0fec
[3] sqlexp(0x48708, 0x1, 0x7a, 0x7a, 0xfacf8aa8, 0xfedecb18), at 0xfe8b4208
[4] sqlcmex(0x0, 0x4dbf8, 0xfacf8aa8, 0xff0d18a6, 0xfedecafc, 0xfee1689c), at 0xfe8ab770
[5] sqlcxt(0xfacf9cac, 0xff0e3d84, 0xfacf8aa8, 0xff0d18a6, 0xfacf9d48, 0xa), at 0xfe8abdbc
Segmentation Fault (core dumped)
Some iformation you might need:
Compiler : code compiled with cc version 6.2
Debugger : 6.2 patch 111683-03
OS : Solaris 8 patch 108528-12
Machine : E250
Thanks/export/home/husam/release/lib/libstorage_s.so.1:backend.c stab #530 host:(0,211),The key to your problem is probably the stabs reading error.
How was backend.c compiled?
Normally dbx will load stabs information on demand as needed.
You can start dbx and use the "module" command to load
the stabs information right away without running the program or using RTC.
Try this:
(dbx) module backend.o
Does that cause the stabs warnings?
If you can "repair" or "normalize" the stabs information in that module,
the crash will probably go away. -
_malloc_unlocked core dump
I am working on Solaris 7 (newest patches installed) using Sun Workshop 6. My multithreaded application runs well for a while but eventually it core dumps.
t@4 (l@1) terminated by signal SEGV (no mapping at the fault address)
The point in my code where it core dumps differs but the top of the stack always ends in
malloc(0x5fa, 0x0, 0xfea0b5c0, 0xfea0b540, 0x31, 0xff26db58)
mallocunlocked(0x0, 0x600, 0x10b9f0, 0x10bab8, 0x0, 0xff0b3f00)
Has anyone an idea?
Thanx in advance
BoerniI have a core dump, my pstack is:
----------------- lwp# 1 / thread# 1 --------------------
fe74251c realfree (3655b468, fe7c2858, fe7bc008, 1e1cc0, 36373539,
1e7f38) + 70
fe742e20 cleanfree (0, fe7bc008, fe7c27cc, fe7c284c, fe7c27e0, 0) + 58
fe741f54 mallocunlocked (1e, 0, fe7bc008, 20, 1f, 0) + f0
fe741e48 malloc (1e, 1a9f00, fe7c3a54, fe7bfc78, 339, fef53cf4) + 20
00041604 ???????? (1f0928, 48052560, ffbef450, 3c, 7400012c, 1acb78)
00042e3c ???????? (1f0918, 1ac740, 1ac718, 1ac6f0, 1ac6c8, 196c74)
00036c88 ???????? (0, 0, 0, 0, 0, 0)
----------------- lwp# 2 / thread# 2 --------------------
fe79f4b0 _signotifywait (fef1c000, ff3de79c, feee028c, 40000000,
feee1508, ff3de0c0) + 8
fef01c90 thr_yield (0, 0, 0, 0, 0, 0) + 8c
----------------- lwp# 3 --------------------------------
fe79d054 doorreturn (4, fef1c000, fef1d678, 3, fef1c000, 1) + 10
feefa380 lwpstart (fe685d98, 0, 6000, ffbeeeac, 0, 0) + 18
fef01c90 thr_yield (0, 0, 0, 0, 0, 0) + 8c
----------------- lwp# 4 --------------------------------
fef09300 private___lwp_cond_wait (fe20bd98, fef1cd74, fef1c000, 3,
fef1c000, 1) + 8
feefa380 lwpstart (fe20bd98, 0, 0, 0, 0, 0) + 18
fef01c90 thr_yield (0, 0, 0, 0, 0, 0) + 8c
-------------------------- thread# 3 --------------------
feefd9e0 reapwait (fef20988, 1e8fc, 0, fef1c000, 0, 0) + 38
feefd738 _reaper (fef1ce08, fef22710, fef20988, fef1cde0, 1, fe400000)
+ 38
fef0b11c threadstart (0, 0, 0, 0, 0, 0) + 40
Help!!!
Cesar Jorge -
We are getting bad address core dump while using Coherence lib .
Please find the dbx stack trace below in .
@null (l@9) terminated by signal SEGV (no mapping at the fault address)
0xffffffffffffffff: <bad address 0xffffffffffffffff>
(dbx) where
[1] 0xfa666f08(0xf71f8940, 0x28ec9c8, 0xf71f8930, 0x18, 0x8, 0xf71f8880), at 0xfa666f08
[2] 0xfa662da8(0xf71f8ab0, 0x28ec9c8, 0xf71f89b0, 0xf71f8940, 0x154396e8, 0xfdf88a80), at 0xfa662da8
[3] 0xfa414a6c(0xf71f8ab0, 0x28ec9d0, 0xf71f8aa0, 0xf71f91e0, 0x0, 0xf71f89b0), at 0xfa414a6c
[4] 0xfaba8c78(0x28ec9c8, 0xf71f8c20, 0x0, 0xf71f8b80, 0xf71f8ab0, 0x1), at 0xfaba8c78
[5] 0xfb1f6b8c(0xf71f9190, 0xf71f91e0, 0xf71f8c20, 0xf71f91a0, 0xf71f8c30, 0x28af100), at 0xfb1f6b8c
[6] 0xfb1f2af0(0x28aaeb0, 0xf71f91a0, 0x0, 0x1, 0xf71f9190, 0xfb1df870), at 0xfb1f2af0
[7] 0xfb1f5c48(0x28aaeb0, 0x569fb10, 0xf71f9270, 0xf71f9280, 0xf71f9280, 0xf71f9360), at 0xfb1f5c48
[8] 0xfad25bd0(0x289f3b8, 0xf71f9360, 0xf71f9360, 0xf71f92f0, 0x1, 0xf71f9360), at 0xfad25bd0
[9] 0xfabf44c0(0x569fb10, 0xfb1fefd4, 0xfeb88ae0, 0xf71f9360, 0xfabf309c, 0xfeaae700), at 0xfabf44c0
[10] 0xfa8a3d70(0x289f228, 0xf71f9460, 0xf71f9420, 0xf71f9430, 0xfdf88a80, 0xf71f9460), at 0xfa8a3d70
[11] 0xfa8a338c(0x289f228, 0xf71f9540, 0xf71f9540, 0xf71f94d0, 0x1, 0xf71f95c0), at 0xfa8a338c
[12] 0xfa7c1dd8(0x25b6ef8, 0x7f13700, 0xf71f9540, 0xf71f95c0, 0xf71f9550, 0x289f2a0), at 0xfa7c1dd8
[13] 0xfabf44c0(0x7f13700, 0xfa7c3a60, 0xfe37b854, 0xf71f95c0, 0xfabf309c, 0xfe37ac90), at 0xfabf44c0
[14] 0xfb2c9184(0xf71f9be0, 0xfdd965d4, 0x0, 0xffffffff, 0x1, 0x0), at 0xfb2c9184
[15] 0xfa8866b4(0x28df150, 0xf71f9d14, 0xf71fa390, 0xfdf88a80, 0x0, 0xf71fa134), at 0xfa8866b4
[16] 0xfa90c320(0x41f30d0, 0xfe476544, 0x28aae50, 0xf71fa380, 0x3, 0xf71fa458), at 0xfa90c320
[17] 0xfad8f044(0x867800, 0x41f3198, 0xf71fb500, 0xf71fa670, 0xf71fb500, 0xf71fa5b0), at 0xfad8f044
[18] 0xfad838dc(0x28aad08, 0xf71fb234, 0xfe7f165c, 0xfdf88a80, 0xf71fad6c, 0xf71fae44), at 0xfad838dc
[19] 0xfb293ed0(0x28dba98, 0x28aad08, 0xc54400, 0xf71fb500, 0xf71fb4d0, 0xfdf88a80), at 0xfb293ed0
[20] 0xfa758038(0x28dbab0, 0xfe6ea03c, 0xfe6ea03c, 0xf71fb5a0, 0x1, 0xf71fb5c0), at 0xfa758038
[21] 0xfa9d9918(0xf71fbed0, 0x28dbdc0, 0xfdf88a80, 0x28e05b8, 0xf71fbf28, 0xfe4eab9c), at 0xfa9d9918
[22] 0xfa614f74(0x17be110, 0xf71fc000, 0x0, 0x0, 0xfa629ee8, 0xfe275df0), at 0xfa614f74
Without Coherence lib we don't see these kind of bad address core dumpsSome time we do see below stack trace caused by coherence ,
Current function is coherence::native::NativeAtomic64::peek
79 return m_lAtomic;
(dbx) where
=>[1] coherence::native::NativeAtomic64::peek(this = 0x3844119f), line 79 in "NativeAtomic64.hpp"
[2] coherence::lang::Object::_detach(this = 0x38441197, fEscaped = false), line 761 in "Object.hpp"
[3] 0xfa2a7fc0(0x3192d5b0, 0x0, 0xc0000000, 0xfdf88a80, 0x0, 0x4f5ca40), at 0xfa2a7fc0
[4] 0xfa7c5570(0x3192d528, 0x1, 0x1000, 0x3f1728, 0x3f1400, 0xfdf88a80), at 0xfa7c5570
[5] 0xfab9537c(0x3192d5c8, 0x1ffffe0, 0xfdf88a80, 0x80000000, 0xc0, 0x80), at 0xfab9537c
[6] coherence::lang::Object::_detach(this = 0x3192d5c8, fEscaped = false), line 774 in "Object.hpp"
[7] 0xfa7ccd34(0xf71fa288, 0x2, 0x18, 0xfdf88a80, 0x1, 0x1), at 0xfa7ccd34
[8] 0xfa886744(0x2c0d4e0, 0xf71f9d14, 0xf71f9d14, 0xfdf88a80, 0x0, 0xf71fa134), at 0xfa886744
[9] 0xfa90c320(0x655adb0, 0xfe476544, 0x2bc2a40, 0xf71fa380, 0x2, 0xf71fa458), at 0xfa90c320
[10] 0xfad8f044(0x867800, 0x655ae78, 0xf71fb500, 0xf71fa670, 0xf71fb500, 0xf71fa5b0), at 0xfad8f044
[11] 0xfad838dc(0x2bc28f8, 0xf71fb234, 0xfe7f165c, 0xfdf88a80, 0xf71fad6c, 0xf71fae44), at 0xfad838dc
[12] 0xfb293ed0(0x2c09620, 0x2bc28f8, 0xc54400, 0xf71fb500, 0xf71fb4d0, 0xfdf88a80), at 0xfb293ed0
[13] 0xfa758038(0x2c09638, 0xfe6ea03c, 0xfe6ea03c, 0xf71fb5a0, 0x1, 0xf71fb5c0), at 0xfa758038
[14] 0xfa9d9918(0xf71fbed0, 0x2c09948, 0xfdf88a80, 0x2c0e9c8, 0xf71fbf28, 0xfe4eab9c), at 0xfa9d9918
[15] 0xfa614f74(0x256e910, 0xf71fc000, 0x0, 0x0, 0xfa629ee8, 0xfe275df0), at 0xfa614f74
(dbx)
Please advice. -
I tried to build latest Python sources with Sun C compiler on Solaris snv_145 (sparc or x86)
There is no issue to build the binary, but then Python's
harness runs it as: 'python -E ./setup.py build' it core dumps.
Actually, Python's version and Sun compiler versions are not essential.
I tried viariety of them, and all produce the same core dump.
I ran dbx with this and pinpointed the place:
At some moment python binary calls rlinit_terminal_io() from
open source readline.so library, which in turn invokes kernel's tgetent()
function from libcurses.so.2. That tgetent() function crashes on the
following line where cur_term is nil:
if (strcmp(cur_term->_term, name) == 0)
The top of crashed stack looks like this:
========================
t@1 (l@1) signal SEGV (no mapping at the fault address) in tgetent at line 65 in file "tgetent.c"
65 if (strcmp(cur_term->_term, name) == 0)
(dbx) print name
name = 0x8047a4d "sun-cmd"
(dbx) print cur_term
cur_term = (nil)
(dbx) where
current thread: t@1
=>[1] tgetent(buffer = 0x8786dd0 "", name = 0x8047a4d "sun-cmd"), line 65 in "tgetent.c"
[2] rlinit_terminal_io(terminal_name = 0x8047a4d "sun-cmd"), line 460 in "terminal.c"
[3] readline_initialize_everything(), line 1066 in "readline.c"
[4] rl_initialize(), line 968 in "readline.c"
[5] setup_readline(), line 884 in "readline.c"
[6] PyInit_readline(), line 1133 in "readline.c"
[7] PyImportLoadDynamicModule(name = 0x8747698 "readline", pathname = 0x8656e38 "build/lib.solaris-2.11-i86pc-3.2-pydebug/readline.so", fp = (nil)), line 57 in "importdl.c"
===================
May be to prevent this crash I need to define some
environment variable which ultimately will initialize 'cur_term' global?
Please advise.Please edit your post and use code tags when posting logs and error messages to the boards:
https://wiki.archlinux.org/index.php/Fo … s_and_Code
As to your errors, this is documented in the wiki:
https://wiki.archlinux.org/index.php/Pa … stem.22.21 -
Indecipherable core dump on Solaris x86_64
On a 64-bit Solaris x86 machine (SunOS tempest-solaris 5.10 Generic_141445-09 i86pc i386 i86pc Solaris), I have been running gcc 4.3.4 (configured for i686-pc-solaris2.10) without a hitch. Both dbx 7.8 and gdb 7.1 are able to read core dumps created from a simple "goodbye, cruel world" program (kind of like "hello world", but it dereferences NULL at the end) built with gcc -m64 -g. However, with a more complex program, neither gdb nor dbx are able to figure it out core dumps (though they can debug it just fine if I set a breakpoint in main and start the program in the debugger).
gdb's failure looks like this:
GNU gdb (GDB) 7.1
Copyright (C) 2010 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-pc-solaris2.10".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/net/chronic2nas/emake-slothman-main-201006211520/out/i686_SunOS_64.5.10/ecloud/agent/ecagent...done.
[New LWP 1]
[New LWP 2]
[New LWP 3]
[New LWP 4]
[New LWP 5]
Reading symbols from /usr/lib/amd64/ld.so.1...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/amd64/ld.so.1
Core was generated by `/opt/ecloud/i686_SunOS.5.10/bin/ecagent
/opt/ecloud/i686_SunOS.5.10/bin/runagen'.
Program terminated with signal 11, Segmentation fault.
#0 0xfffffd7ffeac431c in ?? ()
(gdb) bt
#0 0xfffffd7ffeac431c in ?? ()
Cannot access memory at address 0xfffffd7fffdfed30
(gdb) thread 2
[Switching to thread 2 (LWP 2)]#0 0xfffffd7ffeb2c8fa in ?? ()
(gdb) bt
#0 0xfffffd7ffeb2c8fa in ?? ()
Cannot access memory at address 0xfffffd7ffe1f8dd8
(gdb) thread 3
[Switching to thread 3 (LWP 3)]#0 0xfffffd7ffeb27527 in ?? ()
(gdb) bt
#0 0xfffffd7ffeb27527 in ?? ()
Cannot access memory at address 0xfffffd7ffdfffd68
(gdb) thread 4
[Switching to thread 4 (LWP 4)]#0 0xfffffd7ffeb27527 in ?? ()
(gdb) bt
#0 0xfffffd7ffeb27527 in ?? ()
Cannot access memory at address 0xfffffd7ffde00e78
(gdb) thread 5
[Switching to thread 5 (LWP 5)]#0 0xfffffd7ffeb2c8fa in ?? ()
(gdb) bt
#0 0xfffffd7ffeb2c8fa in ?? ()
Cannot access memory at address 0xfffffd7ffdbffc58
(gdb) info sharedlibrary
From To Syms Read Shared Object Library
0xfffffd7fff3c1010 0xfffffd7fff3e614e Yes (*) /usr/lib/amd64/ld.so.1
(*): Shared library is missing debugging information.and dbx's looks like this:
Reading ecagent
dbx: internal warning: writable memory segment 0x597000[28672] of size 0 in core
dbx: internal warning: writable memory segment 0x59e000[3600384] of size 0 in core
dbx: internal warning: writable memory segment 0xfffffd7ffd405000[4096] of size 0 in core
dbx: internal warning: writable memory segment 0xfffffd7fff3fd000[8192] of size 0 in core
dbx: internal warning: writable memory segment 0xfffffd7fffdfa000[24576] of size 0 in core
core file header read successfully
Reading ld.so.1
dbx: core file read error: address 0xfffffd7fff3fb000 not available
dbx: core file read error: address 0xfffffd7fff3fbae0 not available
dbx: core file read error: address 0x598ff0 not available
dbx: warning: Dbx could not initialize rtld_db
Make sure this is the same version of Solaris where the core dump originated.
Use `help core mismatch' for more info.
(l@1) terminated by signal SEGV (no mapping at the fault address)
0xffffffffffffffff: <bad address 0xffffffffffffffff>
(dbx) where
[1] 0xfffffd7ffeac431c(0x0, 0x0, 0x784120, 0x170, 0x7, 0xffffffff), at 0xfffffd7ffeac431c
(dbx) threads
dbx: thread related commands not availableI get these errors even when debugging on the exact same machine where the core dump was generated. pstack is similarly confused:
tempest-solaris% pstack /net/chronic2nas/emake-slothman-main-201006211520/logs-201006211902-solx2-ea2/core
core '/net/chronic2nas/emake-slothman-main-201006211520/logs-201006211902-solx2-ea2/core' of 14854: /opt/ecloud/i686_SunOS.5.10/bin/ecagent /opt/ecloud/i686_SunOS.5.10/bi
----------------- lwp# 1 --------------------------------
fffffd7ffeac431c ???????? ()
----------------- lwp# 2 --------------------------------
fffffd7ffeb2c8fa ???????? ()
----------------- lwp# 3 --------------------------------
fffffd7ffeb27527 ???????? ()
----------------- lwp# 4 --------------------------------
fffffd7ffeb27527 ???????? ()
----------------- lwp# 5 --------------------------------
fffffd7ffeb2c8fa ???????? ()
pstack: warning: librtld_db failed to initialize; symbols from shared libraries will not be availableAre there any arcane configuration parameters in Solaris that affect the generation of core dumps?Bother. Spoke too soon. One of my tests generated a readable core file, but the rest are having the same issues as detailed above. I am examining the core dump on the machine that generated it. The sizes of the failed tests are 21,522,239 and 21,485,375 and 21,526,447, so I doubt its running into a limit. (The successful one was 27,942,207.)
On this machine, coreadm reports:
global core file pattern:
global core file content: all
init core file pattern: core
init core file content: all
global core dumps: disabled
per-process core dumps: enabled
global setid core dumps: disabled
per-process setid core dumps: disabled
global core dump logging: disabledThe machine that got the successful core dump was physical while the ones where it failed were running under VMware LabManager, but I would be very surprised if that makes a difference to this matter. The successful core dump was generated by signal 9 (kill), while the bad ones have all been by signal 11 (segmentation fault). -
Core dump at ::~RWCString
I am compiling with V5.0 compiler on solaris 2.6
I am getting the following core dump. I am using RogueWave with -library=rwtools7,iostream
compiler option.
The traceback from the core file is:
signal SEGV (no mapping at the fault address) in RWReference::removeRe
ference at 0x77ba70
0x0077ba70: removeReference+0x0038: ld [%i0], %i0
(/opt/shared/sun/workshop/v5.0/SUNWspro/bin/../WS5.0/bin/sparcv9/dbx) where
current thread: t@1
=>[1] RWReference::removeReference(0x323030f4, 0x323030f4, 0xd2dc60, 0xfede36f8,
0x81010100, 0x0), at 0x77ba70
[2] RWCString::~RWCString(0x323030f4, 0x9aa2bc, 0xffbed85c, 0x638790, 0x16608,
0xd30c14), at 0x76e868
[3] StSearchEng::searchbydetail(0xffbedaf0, 0xed2b38, 0x0, 0xd30bcc, 0x986074,
0x0), at 0x6387a0
[4] StStairsSearchGuiMgr::search(0xed2a20, 0xeddcc8, 0xfffffff5, 0xffbeddfc, 0
xfed9a000, 0xeddcc8), at 0x3c5824
[5] UxCStairsSearch::activateCBsearchPB(0xed2ef8, 0xeddcc8, 0x0, 0xffbedf4c,
0xff08ec20, 0x2a5), at 0x25a36c
[6] UxCStairsSearch::WrapactivateCB_searchPB(0xeddcc8, 0x0, 0xffbedf4c, 0xfe
e72000, 0xdc5ab0, 0x0), at 0x25a5d4
[7] XtCallCallbackList(0xeddcc8, 0x0, 0xffbedf4c, 0xeddcc8, 0xe697d8, 0xeddcc8
), at 0xfee3c36c
[8] ActivateCommon(0x0, 0xffbee248, 0xff086000, 0xeddcc8, 0xfef83588, 0xfee3ef
84), at 0xfef83764
[9] HandleActions(0x0, 0xffbee248, 0xe00b88, 0xeddcc8, 0xede69c, 0xe04e80), at
0xfee3f324
[10] HandleComplexState(0xeddd00, 0xe04ee0, 0xe8bed0, 0xfee72000, 0xeddcf8, 0x
ffbee07c), at 0xfee45f94
[11] _XtTranslateEvent(0xfee78298, 0xeddcf8, 0xfee72000, 0xeddcc8, 0xedb358, 0
x8), at 0xfee3dd40
[12] XtDispatchEventToWidget(0x0, 0x1, 0x0, 0xffbee248, 0xeddcc8, 0x8), at 0xf
ee3dab0
[13] _XtDefaultDispatcher(0x8, 0xeddcc8, 0xdd0a54, 0xeddcc8, 0x0, 0x0), at 0xf
ee3d39c
[14] XtDispatchEvent(0x0, 0xfee3cff8, 0xdbb920, 0xfee72000, 0x0, 0x1), at 0xfe
e3ced0
[15] XtAppMainLoop(0xdbb920, 0xdbb920, 0x3e8, 0xde99b8, 0x36ee80, 0xfee72000),
at 0xfee3ab74
[16] main(0x1, 0xffbee724, 0xffbee72c, 0x9f0800, 0x0, 0x0), at 0x283bdc
Thanks
MohanI am compiling with V5.0 compiler on solaris 2.6
I am getting the following core dump. I am using RogueWave with -library=rwtools7,iostream
compiler option.
The traceback from the core file is:
signal SEGV (no mapping at the fault address) in RWReference::removeRe
ference at 0x77ba70
0x0077ba70: removeReference+0x0038: ld [%i0], %i0
(/opt/shared/sun/workshop/v5.0/SUNWspro/bin/../WS5.0/bin/sparcv9/dbx) where
current thread: t@1
=>[1] RWReference::removeReference(0x323030f4, 0x323030f4, 0xd2dc60, 0xfede36f8,
0x81010100, 0x0), at 0x77ba70
[2] RWCString::~RWCString(0x323030f4, 0x9aa2bc, 0xffbed85c, 0x638790, 0x16608,
0xd30c14), at 0x76e868
[3] StSearchEng::searchbydetail(0xffbedaf0, 0xed2b38, 0x0, 0xd30bcc, 0x986074,
0x0), at 0x6387a0
[4] StStairsSearchGuiMgr::search(0xed2a20, 0xeddcc8, 0xfffffff5, 0xffbeddfc, 0
xfed9a000, 0xeddcc8), at 0x3c5824
[5] UxCStairsSearch::activateCBsearchPB(0xed2ef8, 0xeddcc8, 0x0, 0xffbedf4c,
0xff08ec20, 0x2a5), at 0x25a36c
[6] UxCStairsSearch::WrapactivateCB_searchPB(0xeddcc8, 0x0, 0xffbedf4c, 0xfe
e72000, 0xdc5ab0, 0x0), at 0x25a5d4
[7] XtCallCallbackList(0xeddcc8, 0x0, 0xffbedf4c, 0xeddcc8, 0xe697d8, 0xeddcc8
), at 0xfee3c36c
[8] ActivateCommon(0x0, 0xffbee248, 0xff086000, 0xeddcc8, 0xfef83588, 0xfee3ef
84), at 0xfef83764
[9] HandleActions(0x0, 0xffbee248, 0xe00b88, 0xeddcc8, 0xede69c, 0xe04e80), at
0xfee3f324
[10] HandleComplexState(0xeddd00, 0xe04ee0, 0xe8bed0, 0xfee72000, 0xeddcf8, 0x
ffbee07c), at 0xfee45f94
[11] _XtTranslateEvent(0xfee78298, 0xeddcf8, 0xfee72000, 0xeddcc8, 0xedb358, 0
x8), at 0xfee3dd40
[12] XtDispatchEventToWidget(0x0, 0x1, 0x0, 0xffbee248, 0xeddcc8, 0x8), at 0xf
ee3dab0
[13] _XtDefaultDispatcher(0x8, 0xeddcc8, 0xdd0a54, 0xeddcc8, 0x0, 0x0), at 0xf
ee3d39c
[14] XtDispatchEvent(0x0, 0xfee3cff8, 0xdbb920, 0xfee72000, 0x0, 0x1), at 0xfe
e3ced0
[15] XtAppMainLoop(0xdbb920, 0xdbb920, 0x3e8, 0xde99b8, 0x36ee80, 0xfee72000),
at 0xfee3ab74
[16] main(0x1, 0xffbee724, 0xffbee72c, 0x9f0800, 0x0, 0x0), at 0x283bdc
Thanks
Mohan -
Hi,
I am porting the code to Forte 6.0 on Solaris 8.0.
I am compiling the code using :
-library=rwtools7,iostream options.
While executing I get core dump. Following is the dbx description of the code.
detected a multithreaded program
t@1 (l@1) terminated by signal SEGV (no mapping at the fault address)
Current function is unsafe_ostream::operator<<
1211 outstr(_s, 0);
(dbx) where
current thread: t@1
[1] ostream::flush(0x21000000, 0x21000000, 0x0, 0x0, 0x0, 0x0), at 0x2be54
[2] unsafe_ostream::do_opfx(0x47488, 0x1, 0xffbef038, 0x1, 0xff3e260c, 0xff3e3b10), at 0x2a968
[3] unsafe_ostream::outstr(0x47488, 0x46bd4, 0x0, 0x0, 0x47488, 0x46bd4), at 0x2ac50
=>[4] unsafe_ostream::operator<<(this = 0x47488, _s = 0x46bd4 "GetAccessID() test passed"), line 1211 in "iostream.h"
[5] ostream::operator<<(this = 0x47484, _s = 0x46bd4 "GetAccessID() test passed"), line 1350 in "iostream.h"
[6] main(argc = 3, argv = 0xffbef2cc), line 35 in "AccessId.C"
Can somebody help me to soty out this problem.The crash is caused by flush() which was given a bad argument value, i.e. 0x21000000. It seems to me do_opfx(), which prints out any prefix stuff, should not be called by outstr(). Instead outstr() should simply prints out the message "xxx test passed". Please make sure the code was linked with the right libs.
- Rose -
New / malloc / threads core dump
Hi,
I'm trying to port a ftp client from Linux to Solaris. The client runs fine on both Linux and on *BSD.
I'm using the Sun Studio 8 C++ compiler on Solaris 9 4/04 x86.
The program crashes in the below class function:
-- CUT --
FILELIST CServer::ObtainFilelist(bool use_jump) {
FILELIST fl_temp, fl_temp1 = NULL, fl_new, fl_start = NULL;
pthread_mutex_lock(&(this->filelist_lock));
fl_temp = this->actual_filelist;
while (fl_temp) {
fl_new = new(FILELIST);
fl_new->next = NULL;
fl_new->magic = fl_temp->magic;
fl_new->is_marked = FALSE;
fl_new->name = new(char[strlen(fl_temp->name) + 1]);
if (!fl_temp1)
fl_start = fl_new;
else
fl_temp1->next = fl_new;
fl_temp1 = fl_new;
fl_temp = fl_temp->next;
pthread_mutex_unlock(&(this->filelist_lock));
*use_jump = this->prefs.use_jump;
return (fl_start);
-- CUT --
When running the program in dbx I get:
-- CUT --
t@2 (l@2) signal SEGV (no mapping at the fault address) in smalloc at 0xd2f20b09 0xd2f20b09: smalloc+0x0078: movl 0x00000008(%eax),%ecx
Current function is CServer::ObtainFilelist
1815 und bookfl_new->name = new(char[strlen(fl_temp->name) + 1]);
(dbx) where
current thread: t@2
[1] _smalloc(0x8), at 0xd2f20b09
[2] mallocunlocked(0x8), at 0xd2f20d66
[3] malloc(0x5), at 0xd2f20b57
[4] operator new(0x5), at 0xd2ff5d8c
=>[5] CServer::ObtainFilelist(this = 0x839d328, use_jump = 0xd2d8df33), line 1815 in "server.cc"
[6] CDisplayHandler::UpdateServerFilelist(this = 0x80c53a0, server = 0x839d328, window = 0x80eb600), line 1692 in "displayupdate.cc"
[7] CDisplayHandler::HandleServerMessage(this = 0x80c53a0, msg = 2, magic = 1, data = (nil)), line 4596 in "displayhandler.cc"
[8] CDisplayHandler::Loop(this = 0x80c53a0), line 4841 in "displayhandler.cc"
[9] DetachDisplayHandler(dummy = (nil)), line 302 in "main.cc"
[10] thrsetup(0xd2e30200), at 0xd2e54513
[11] lwpstart(), at 0xd2e54790
-- CUT --
I tried to replace the "fl_new->name = new(char[strlen(fl_temp->name) + 1]);" with "fl_new-name new char [255]" with success. fl_temp->name is accessible, I tried to output the contents before doing the new with success.
FILELIST is a struct and FILELIST.name is a char*.
Any help would be really appreciated.martin@sara# CC -V
CC: Sun C++ 5.5 2003/03/12
martin@sara# uname -a
SunOS sara 5.9 Generic_112234-12 i86pc i386 i86pc
Regards,
Martin AnderssonThe stack trace seems to show a core dump from malloc after being asked to allocate 5 bytes. (The operator new in the standard library calls malloc to allocate storage.)
If your code was compiled optimized and without -g, the stack trace is not always reliable, however.
But assuming the trace is accurate, the crash is probably due to a corrupted heap. An invalid free() or delete can corrupt the heap data structures, and the the crash occurs at at later time, often far removed from the offending location. "Invalid" means
- using the wrong form of delete
-deleting an address that was not provided by the matching new operator
-freeing an address that was not provided by malloc/calloc/realloc
-freeing or deletting the same block more than once
The heap (and anything else in the program) can also become corrupted by storing through an invalid pointer or an uninitialized pointer. "Invalid" means the object pointed to no longer exists.
The heap can also become corrupted if you store beyond the bounds of allocated storage.
The classic error is this:
char* p = new char[strlen(msg)]; // forgot about trailing null
strcpy(p, msg); // write one byte too many
If you can't see any of these errors in the souce code (and theyare hard to find), try running under dbx with RTC (run-time checking) enabled, or use some memory debugger. -
Hi
I have a coredump file which was created on our production box. I am debugging that on my development machine.
When i try the command
dbx gwbgas dncore i am getting the output as given
Reading gwbgas
core file header read successfully
Reading ld.so.1
dbx: warning: Dbx could not initialize rtld_db
Make sure this is the same version of Solaris where the core dump originated.
Use `help core mismatch' for more info.
program terminated by signal SEGV (no mapping at the fault address)
0xffffffffffffffff: <bad address 0xffffffffffffffff>
When i try where command i am getting the output as
(dbx) where
[1] 0xff2d071c(0x2a, 0x1617920, 0x5e4390, 0x0, 0x5b4d60, 0x801), at 0xff2d071b
[2] lliomDisableOutputCallBack(0x400, 0x400, 0xa, 0x41ae30, 0xffbef748, 0x2a), at 0x19561c
[3] lliomSelect(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x197054
[4] lliomSelect(0x0, 0xea60, 0x15eec8, 0x0, 0x0, 0x0), at 0x197354
[5] _lliomMapPollToSelect(0xba7b4, 0x15ec00, 0x15fc00, 0xf57, 0x38fc00, 0x44d400), at 0x198f4c
[6] main(0x373000, 0xffbef9d4, 0xffbef9f0, 0x5, 0x265845, 0x0), at 0xba774
This stack trace is not that meaningfull to me. Please help me to debug this furtherSince this is a mismatched core file, below is a snippet from Sun's "Debugging a program with dbx" document. Hope this helps.
1. The shared libraries used by the program on the core-host may not be the same
libraries as those on the dbx-host. To get proper stack traces involving the
libraries, youll want to make these original libraries available on the dbx-host.
2. dbx uses system libraries in /usr/lib to help understand the implementation
details of the run time linker and threads library on the system. It may also be
necessary to provide these system libraries from the core-host so that dbx can
understand the runtime linker data structures and the threads data structures. -
Hello All,
I am developing shared libraries for Solaris 5.8 using CC v5.4 (Sun Forte 7).
These libraries are integrated with application software built with CC v5.6 (Sun Studio 9) also on Solaris 5.8.
The libraries I supply are accessed via a defined C API by the application using "dlopen".
My libraries in turn depend on other, such as libxerces, libCstd and others.
I have verified that the software libraries work correctly when run in a test harness, whether this is compiled using CC v5.4 or CC v5.6.
The application experiences the following fault:
t@4 (l@4) terminated by signal SEGV (no mapping at the fault address)
0xfeec1c98: _smalloc+0x008c: ld [%o1 + 8], %o0
The business end of the stack trace is as follows:
[5] std::valarray<double>::valarray(
[4] __rwstd::_RW_array<double>::_initial_size(
[3] operator new(0x0, ...
[2] malloc(0x1, ...
[1] _smalloc(0x8, ...
I am looking for developers with similar experiences or knowledge of this problem to try and narrow down the possible causes.
I am currently investigating the following possibilities:
Compiler patch or use -xarch=v8plus.
Inconsistent use of "-DRW_MULTI_THREAD -mt" compiler/linker options.
Incompatibility between libCstd & libstlport.
I have already referred to the following forum entries.
http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5069618
http://forum.java.sun.com/thread.jspa?threadID=5071063
The code causing this core dump is in the initialisation section of the constructor of a C++ object.
class c {
public:
c(); // constructor
protected:
std:valarray m;
a::a()
// Initialisation.
: m(0) { <<<<<<<<<< The core dump occurs in the constructor of this valarray member variable.
// Constructor code.
best regards
Geoff Krechting
Edited by: Geoff.Krechting on Apr 23, 2008 5:14 AM
Edited by: Geoff.Krechting on Apr 23, 2008 7:25 AMBoth C++ 5.4 and 5.6 are End Of Life, and little support is available for them. I recommend you upgrade to Sun Studio 11, the most recent compiler that still supports Solaris 8 (which is also End Of Life). Studio 11 is free for all uses, and rebuilding your code using it should not present any problems. You can get it here:
[http://developers.sun.com/sunstudio/products/previous/11/index.jsp]
If you don't want to change compilers, you can still mix binary code from C++ 5.4 and 5.6. The rule is that you can link binaries created by an older compiler into a program or shared library built with a newer compiler, but not the other way around. That is, you need to use C++ 5.6 for all linking steps, not C++ 5.4.
The problem you are running into might be due to a compiler bug, a bug in the runtime library, or a bug in your code.
You can reduce the chances of compiler or library bugs by getting all the current patches for your compilers and libraries here:
[http://developers.sun.com/sunstudio/downloads/patches/index.jsp]
Be sure to update the C++ runtime libraries not only on the computer where you build, but on computers where the application is run.
The crash you are seeing looks like it's due to memory corruption. Memory corruption can be caused by
- using an uninitialized pointer
- using an invalid pointer:
--- points to a deleted object
--- points to an object whose lifetime has ended
- deleting an object more than once
- mis-matched new/delete operations
Using Run-Time Checking in dbx can help you find some of these problems.
% dbx myprog
% check -all
% run -
Compiling own app with -X02 makes external dll core dump.
Hello,
I have a C++ app that calls a function w/in an external shared library. The external dll does not have debug symbols and is probably optimized. When my app is compiled with -xO2 or higher, I get a core dump (no mapping at the fault address) deep within the external dll. When I am compiling my app with -xO1 or with debug info, I do not get the core dump within the external dll.
My questions are:
1. Does this mean that there is a bug w/in my code or within the external dll's code?
2. If not error in either, is there any way to overcome this core dump without lowering the level of optimization (and thus slowing down the app)
Here is a stack trace I got by attaching dbx to my app:
t@1 (l@1) signal SEGV (no mapping at the fault address) in num2qword at 0xfd320248
[1] num2qword(0x345cfd8, 0xffffff85, 0x63ad0, 0xfd323ba0, 0xa800, 0xa8d8), at 0xfd320248
[2] evalexpr(0xffbf7f58, 0x345cee8, 0x1, 0x0, 0xfd27e558, 0xfd3230d0), at 0xfd323ba0
[3] eval_expr_full(0x328e388, 0x345d04c, 0x345cfd8, 0xfd27e558, 0x1, 0x0), at 0xfd3249e8
[4] cm_eval_expr(0x328e388, 0x345d04c, 0x5800, 0x5944, 0xb400, 0xb400), at 0xfd1eea68
[5] cm_optredeem_can_redeem(0x328e388, 0x345d1e0, 0x16ddec, 0x5c00, 0x0, 0x345d1e4), at 0xfd21620c
[6] cm_optredeem_condition(0x328e388, 0x345d1e0, 0x0, 0x0, 0x0, 0x135eb29), at 0xfd2162d8
[7] cm_maybe_execute_optredeem(0x328e388, 0x345d1e0, 0x0, 0x0, 0x0, 0x1), at 0xfd216568
[8] cm_pay_1_period(0x328e388, 0xfd3ba364, 0x345d1e0, 0x345d52c, 0xfd383c98, 0x0), at 0xfd21ab5c
[9] cm_payloop(0x328e388, 0x1, 0x0, 0x324df00, 0x0, 0x3), at 0xfd21ae08
[10] icmo_cashflows(0x0, 0x0, 0x168, 0x328b7b0, 0x0, 0x328b7b0), at 0xfd2d1700
[11] CMOInstrument::getICMOCashFlow(0x1627b28, 0xfd48bdb8, 0x570, 0x2b1c, 0x2800, 0x400), at 0xfd442410
[12] NE_CMOAnalytics::value(0x39b71e0, 0x98, 0xfd48bdb8, 0xe, 0xffbfc268, 0x2e93b08), at 0xfd42d560
[13] NumericExpression::value(0x1643800, 0x1667b48, 0x1667b48, 0x2eabde0, 0x2eabde0, 0x0), at 0xc13410
[14] NE_CMOPriceTimesBalance::value(0x2b02078, 0x2ead230, 0x1667b48, 0x2eabea0, 0x2eac06c, 0xfd48ec8c), at 0xfd42da9c
[15] NumericExpression::value(0x1643800, 0x1667b48, 0x1667b48, 0x2eabea0, 0x2eabea0, 0x0), at 0xc13410
[16] ExchangeableModuleBase::evaluateExpression(0x31259c4, 0x15e4400, 0x0, 0x2eabea0, 0x1667b48, 0x2e93b08), at 0x746e54
[17] ExchangeableModuleBase::evaluateExpressions(0x31259c4, 0x2f3d7c8, 0x746ca0, 0x1, 0x164c800, 0x15c8414), at 0x746c68
[18] ExchangeableModuleBase::recalc(0x31259c4, 0x0, 0xffffffc8, 0x164c800, 0x0, 0x746c40), at 0x746c10
[19] ExchangeableModule::recalc(0x31258d4, 0x15e5730, 0x15c81ac, 0x164c800, 0x7fe8c0, 0x0), at 0x4a8ff4
[20] BatchInstrument::commandDispatch(0x15fd850, 0x1ac, 0x1, 0x619b2c, 0xc, 0x2ebbbc0), at 0x619ce0
[21] Callback(0x2eee48c, 0x3, 0x5, 0x1, 0xffbfccf0, 0xffbfcd6c), at 0xe652f0
[22] CallExtRtn(0xffbfe1d0, 0x2, 0x1, 0xffffdffe, 0x1, 0xfcd0fc86), at 0xe727d4
[23] PcodeExecute(0x2eee8ac, 0xef5c18, 0x1, 0x15b9750, 0xef5c18, 0x4), at 0xeab848
[24] ExpStartThread(0x2eee48c, 0x0, 0x0, 0x1, 0x1, 0x0), at 0xe6e1e0
[25] BasicScriptCodeObject::executeThread(0x2ebb070, 0x2eee48c, 0x0, 0x2ebb074, 0x2eeed68, 0x0), at 0xa0fcb0
[26] BasicScriptCodeObject::run(0x2ebb070, 0x0, 0x0, 0x0, 0x0, 0x2ebb070), at 0xa0fe24
[27] BasicScriptManager::loadAndExecInitScriptFile(0x2d7eb08, 0x1, 0xa, 0x0, 0x1, 0x2eef5f0), at 0x587f80
[28] main(0x32db9b8, 0xffff3400, 0x308b998, 0x0, 0x1c1fd20, 0x1c0db58), at 0x438c6c
[10] icmo_cashflows(...) is the call to the external dll. From 9 and up to 1 the source code is not visible to me..
OS/CC Versions:
CC: Sun C++ 5.5 Patch 113817-05 2004/01/13
SunOS: 5.9 Generic_117171-05 sun4u sparc SUNW,Sun-Fire-880
compilation options:
-dalign -xarch=v8plusa -xlibmopt -D__solaris_sparc__ -errtags=yes -errwarn=wnoretvalue,wnoelseretvalue +w2 -erroff=doubunder,reftotemp,notemsource,hidef,hidevf,wbadlinkage_w,noexthrow,noextry,notused -DLIC_MGR -DUSE_SMART_HEAP -DUSE_SH_ALLOC -template=wholeclass -instances=explicit -features=no%except -features=rtti -Drindex=rindex -Dindex=index -DADD_DYNAMIC_SYMBOLS -KPIC -DNDEBUG -mt -xO1 ( -xO2 .. -xO5 or -fast give above noted core dump)
Thanks in advanice,
AlexFrom the symptoms you describe, it is possible that the shared library contains a bug, but it is more likely that the problem is in your code, passing bad data to the shared library.
The problem might be a compiler bug, but I think an error in your code is more likely.
For example, your code as written might have undefined behavior that works by accident when compiling without optimizing, but fails when the compiler improves the runtime code.
Some examples:
1. A classic MT programming error is failing to declare a variable volatile when it is shared by more than one thread. In each thread, the compiler assumes it can remember the value of the variable and not reload it between references.
2. "x = ++x + b;" Modifying a variable twice in an expression withtout sequence points has undefined behavior -- compiler optimization can affect the result.
3." foo(x, x+=3);" the order of evaluation of function arguments is unspecified, so the actual values passed to foo could depend on optimization.
With C++ 5.5, you get some warnings from system headers that you can't do anything about, which I suspect is why you have disabled some warnings. Unfortunately, you might be disabling warnings that you need to see. That is, some of the disabled warnings could point to invalid code that results in the program crash.
I suggest using w instead of w2 (to avoid uninteresting warnings), and fix your code to eliminate the warnings you get.
In the current compiler, C++ 5.7 in Sun Studio 10, we have made some adjustments to warnings to make w and w2 more useful. You should consider upgrading.You can get a 60-day free trial version here:
http://www.sun.com/software/products/studio/index.xml
Also get the current patches for it here:
http://developers.sun.com/prodtech/cc/downloads/patches/index.html -
Hotspot core dumping during JVM garbage collection ?
We have an application which calls a 3rd party supplied server API which has recently been upgraded to use Java 1.5
We are getting the following error reported by our client application. The application is also now running Java 1.5 but references many classes in jar files which would have quite old code in.
The supplier of the API has stated that the problem requires us to recompile all our jar files using v 1.5 ( including things like jconnect and jms ?!?!? ). This sounds like a bit of a cop-out to me, not to mention being impossible since we don't have the source for things like jconnect.
I suspect that there is a garbage collection problem at the bottom of all this, but I'm not sure how I can "prove" this, nor do I currently have any real clue as to how to fix any GC problem that may exist.
The application is supposed to wait for a message on a MQSeries queue and then transforms it via Xalan XSLT and sends it to a Server application. I've tried playing around with heap sizes etc but that just seems to make it worse. If I leave it at the settings that the previous version used then the client at least manages to process a couple of messages before core dumping. There doesn't seem to be a consistent trigger event to cause the core dump ( it's not a message arriving on a queue for example ) but it does seem to be fairly consistent timewise, i.e. after
Any ideas gratefully accepted.
Here's a logfile excerpt from my applications showing the Hotspot error message :
=====================================================================================
08-Jul-2008 10:01:05 Waiting for messages from COLT.BBFS
08-Jul-2008 10:02:05 Waiting for messages from COLT.BBFS
08-Jul-2008 10:03:05 Waiting for messages from COLT.BBFS
405.815: [GC [PSYoungGen: 17331K->9244K(37632K)] 111702K->103615K(192128K), 0.1615910 secs]
405.977: [Full GC#
# An unexpected error has been detected by HotSpot Virtual Machine:
# SIGBUS (0xa) at pc=0xfe141348, pid=2600, tid=8
# Java VM: Java HotSpot(TM) Server VM (1.5.0_03-b07 mixed mode)
# Problematic frame:
# V [libjvm.so+0x141348]
# An error report file with more information is saved as hs_err_pid2600.log
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
=====================================================================================
The logfile referred to in the error message contains the following.
=====================================================================================
# An unexpected error has been detected by HotSpot Virtual Machine:
# SIGBUS (0xa) at pc=0xfe141348, pid=2600, tid=8
# Java VM: Java HotSpot(TM) Server VM (1.5.0_03-b07 mixed mode)
# Problematic frame:
# V [libjvm.so+0x141348]
--------------- T H R E A D ---------------
Current thread (0x001484d8): VMThread [id=8]
siginfo:si_signo=10, si_errno=0, si_code=1, si_addr=0x0000080f
Registers:
O0=0x00487588 O1=0xfe7d6454 O2=0x000079b0 O3=0x00007800
O4=0x00008868 O5=0x00147d48 O6=0xf8781460 O7=0xfe0f7938
G1=0xe52aaae8 G2=0x00000003 G3=0x00000003 G4=0x001484d8
G5=0xf8781d98 G6=0x00000002 G7=0xf8781d98 Y=0x805683e2
PC=0xfe141348 nPC=0xfe14134c
Top of Stack: (sp=0xf8781460)
0xf8781460: fe786000 00c6ba20 fe10013c e54bab68
0xf8781470: 0000080f e54bab6c 0000080f 00000004
0xf8781480: 00487588 00000134 e54bab6c 00000004
0xf8781490: 00000001 00000000 f87814c0 fe17aef4
0xf87814a0: fe6485b4 fe7d899c 001484d8 0011da40
0xf87814b0: 00148988 00148c10 00148d7c f8781880
0xf87814c0: 007c3389 007c3c0e 00000f87 00008868
0xf87814d0: 00008800 00487588 fe141310 fe7d6454
Instructions: (pc=0xfe141348)
0xfe141338: ec 06 c0 1a 80 a5 a0 00 22 40 00 0a ba 07 60 01
0xfe141348: f2 05 a0 00 ae 0e 60 03 80 a5 e0 03 22 40 00 05
Stack: [0xf8702000,0xf8781d98), sp=0xf8781460, free space=509k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x141348]
V [libjvm.so+0x17aefc]
V [libjvm.so+0x2d557c]
V [libjvm.so+0x300ef8]
V [libjvm.so+0x301e84]
V [libjvm.so+0x2ff950]
V [libjvm.so+0x29df30]
V [libjvm.so+0x362b44]
V [libjvm.so+0x6436f0]
VM_Operation (0xe03012b0): parallel gc system gc, mode: safepoint, requested by thread 0x0031bca0
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00b2c028 JavaThread "Thread-4" [_thread_in_native, id=85]
0x007f5048 JavaThread "Thread-0" [_thread_blocked, id=84]
0x00c27cf0 JavaThread "Notification Delivery" [_thread_blocked, id=81]
0x0026fa08 JavaThread "RMI LeaseChecker" daemon [_thread_blocked, id=73]
0x00821048 JavaThread "RMI RenewClean-[162.11.2.32:44425]" daemon [_thread_blocked, id=70]
0x0031bca0 JavaThread "GC Daemon" daemon [_thread_blocked, id=67]
0x00cd5d28 JavaThread "RMI Reaper" [_thread_blocked, id=66]
0x003c9300 JavaThread "Timer-0" daemon [_thread_blocked, id=65]
0x00929fe0 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=64]
0x0089bf18 JavaThread "SeedGenerator Thread" daemon [_thread_blocked, id=42]
0x00c47248 JavaThread "Pool thread #7" daemon [_thread_blocked, id=38]
0x00c466a0 JavaThread "Pool thread #6" daemon [_thread_blocked, id=37]
0x00311850 JavaThread "Pool thread #5" daemon [_thread_blocked, id=36]
0x00287a40 JavaThread "Pool thread #4" daemon [_thread_blocked, id=35]
0x00286e98 JavaThread "Pool thread #3" daemon [_thread_blocked, id=34]
0x00c134b0 JavaThread "Pool thread #2" daemon [_thread_blocked, id=33]
0x00ad09e0 JavaThread "Pool thread #1" daemon [_thread_blocked, id=32]
0x00286cd8 JavaThread "PoolThreadManager" daemon [_thread_blocked, id=31]
0x00c129e0 JavaThread "Channel Reaper" daemon [_thread_blocked, id=30]
0x00c669e8 JavaThread "ORB Daemon Thread" daemon [_thread_blocked, id=29]
0x00b10170 JavaThread "Worker for ServerProtocol: (iiop) /0.0.0.0:20168" daemon [_thread_blocked, id=22]
0x008a17e0 JavaThread "Syn~ Client" daemon [_thread_blocked, id=21]
0x003dc378 JavaThread "PoolScavenger0" daemon [_thread_blocked, id=20]
0x0015a928 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=15]
0x00159880 JavaThread "CompilerThread1" daemon [_thread_blocked, id=14]
0x00158a18 JavaThread "CompilerThread0" daemon [_thread_blocked, id=13]
0x00157b98 JavaThread "AdapterThread" daemon [_thread_blocked, id=12]
0x00156dc8 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=11]
0x0014ccd8 JavaThread "Finalizer" daemon [_thread_blocked, id=10]
0x0014ad90 JavaThread "Reference Handler" daemon [_thread_blocked, id=9]
0x00038238 JavaThread "main" [_thread_in_native, id=1]
Other Threads:
=>0x001484d8 VMThread [id=8]
0x0015c3b0 WatcherThread [id=16]
VM state:at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x00037728/0x00037758] Threads_lock - owner thread: 0x001484d8
[0x00033650/0x00037ba8] Heap_lock - owner thread: 0x0031bca0
Heap
PSYoungGen total 37632K, used 9244K [0xf2eb0000, 0xf7ba0000, 0xf8400000)
eden space 28352K, 0% used [0xf2eb0000,0xf2eb0000,0xf4a60000)
from space 9280K, 99% used [0xf4a60000,0xf5367080,0xf5370000)
to space 25216K, 0% used [0xf6300000,0xf6300000,0xf7ba0000)
PSOldGen total 154496K, used 94371K [0xe8400000, 0xf1ae0000, 0xf2eb0000)
object space 154496K, 61% used [0xe8400000,0xee028e78,0xf1ae0000)
PSPermGen total 35584K, used 18260K [0xe4400000, 0xe66c0000, 0xe8400000)
object space 35584K, 51% used [0xe4400000,0xe55d5158,0xe66c0000)
Dynamic libraries:
0x00010000 /dsdvlp/java/jvm/jdk1.5.0_03/bin/java
0xff350000 /usr/lib/libthread.so.1
0xff340000 /usr/lib/libdl.so.1
0xff200000 /usr/lib/libc.so.1
0xff390000 /usr/platform/SUNW,Sun-Fire-880/lib/libc_psr.so.1
0xfe000000 /dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/server/libjvm.so
0xff1e0000 /usr/lib/libsocket.so.1
0xff2d0000 /usr/lib/libsched.so.1
0xff1b0000 /usr/lib/libCrun.so.1
0xff160000 /usr/lib/libm.so.1
0xff080000 /usr/lib/libnsl.so.1
0xff060000 /usr/lib/libmp.so.2
0xff030000 /dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/native_threads/libhpi.so
0xfdfc0000 /dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/libverify.so
0xfdf80000 /dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/libjava.so
0xfdf50000 /dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/libzip.so
0xfb7e0000 /usr/lib/locale/en_GB.ISO8859-1/en_GB.ISO8859-1.so.2
0xe4190000 /dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/libnet.so
0xe3bd0000 /dsdvlp/lib/5/libSolarisNatives.so
0xe3e90000 /dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/librmi.so
VM Arguments:
jvm_args: -Djava.ext.dirs=/dsdvlp/java/tmijar/firs7/lib/cli:/dsdvlp/java/tmijar/firs7/lib/cli/ext:/dsdvlp/java/tmijar/firs7/lib/cmn/OpenORB:/dsdvlp/java/tmijar/firs7/lib/cmn/OpenORB/ext:/dsdvlp/java/tmijar/firs7/lib/cmn:/dsdvlp/java/tmijar/firs7/lib/cmn/ext:/dsdvlp/java/tmijar/firs7/daemonlib -Duser.dir=/dsdvlp/java/tmijar/firs7 -Dopenorb.config=file:/dsdvlp/java/tmijar/firs7/configs/OpenORB/config/SynOpenORB.xml -Dopenorb.home=file:/dsdvlp/java/tmijar/firs7/configs/OpenORB -Dcom.coexis.syn.general.orbbinding=com.coexis.syn.general.orbbinding.openorb.OpenORBBinding_1_4 -Dsun.rmi.dgc.client.gcInterval=360000 -Dsun.rmi.dgc.server.gcInterval=360000000 -Xms32m -Xmx256m -Dcom.coexis.syn.clientcommandsconfiglocation=file://localhost//dsdvlp/java/tmijar/firs7/configs/clientcommands.xml -Dcom.coexis.syn.clientconfiglocation=file://localhost//dsdvlp/java/tmijar/firs7/configs/fsbbtd_client.xml -XX:+PrintGCTimeStamps -XX:+PrintGCDetails
java_command: com.coexis.syn.mqmessaging.daemon.RunDaemon -p /dsdvlp/bin/5/lndsfsd_fsbbtd.properties start
Environment Variables:
JAVA_HOME=/dsdvlp/java/jvm/jdk150
CLASSPATH=.:/dsdvlp/java/jar/jconnect520.jar:/dsdvlp/java/jar/vbjapp340.jar:/dsdvlp/java/jar/vbjorb340.jar:/dsdvlp/java/jar/javax_jndi120.jar
PATH=/usr/local/etc:/usr/lang:/usr/openwin/bin:/usr/ucb:/bin:/usr/etc:/usr/local/5/bin:/dsdvlp/bin/5:/dsdvlp/bin/4:/home/app/sybase/5/bin:/home/app/sybase/5/localscripts:/home/app/sybase/5/sqr:/home/app/lang:/home/app/lang/SC2.0.1:/usr/ccs/bin:/usr/local/opt/Acrobat3/bin:/dsdvlp/bin:.
LD_LIBRARY_PATH=/dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc/server:/dsdvlp/java/jvm/jdk1.5.0_03/jre/lib/sparc:/dsdvlp/java/jvm/jdk1.5.0_03/jre/../lib/sparc:/usr/lib:/usr/openwin/lib:/usr/local/5/lib:/dsdvlp/lib/5:/dstest/lib/5:/home/app/sybase/5/lib:/dstest/cats/sun4/lib:/tmitest/Opus/opus/lib
SHELL=/bin/csh
DISPLAY=CLI00184.mfil.local:1.0
OS=5
--------------- S Y S T E M ---------------
OS: Solaris 8 2/02 s28s_u7wos_08a SPARC
Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
Assembled 18 December 2001
uname:SunOS 5.8 Generic_117350-20 sun4u (T1 libthread)
rlimit: STACK 8192k, CORE 9216k, NOFILE 4096, AS infinity
load average:2.24 2.67 2.68
CPU:total 4 has_v8, has_v9, has_vis1, has_vis2, is_ultra3
Memory: 8k page, physical 8388608k(166384k free)
vm_info: Java HotSpot(TM) Server VM (1.5.0_03-b07) for solaris-sparc, built on Apr 13 2005 03:31:26 by unknown with unknown Workshop:0x550The very first suggestion I have is to move your VM to a more recent update of 1.5.0.
It looks like you are crashing with 5.0u3, and I'm pretty sure 5.0u16 is available. You
don't want to waste your time chasing a bug that's already been fixed.
Maybe you are looking for
-
Cannot add a new SHIP_TO address to a exist customer by using Interface
Hi, I am encountered an error when i am using Customer Import Interface to add a new SHIP_TO address to a exist customer, the template format of the Excel i used like below: <will insert to table: ra_customers_interface_all> Customer Num. | Customer
-
OS4.0 Update Wi-Fi Location issue
After updating to OS4.0 on my iPod Touch, the location for the WiFi keeps showing that I'm 50 miles from my actual location, which has never been a problem. Is this a known issue?
-
I'm currently looking at the options for migrating off Crystal Reports V10. Two options have been put forward by my IT supplier - Crystal Reports XI and Business Objects XI. Can anyone offer advice on the Business Objects XI option? Is it easy to 'co
-
Invalid MIC from Mobile Device
Hello guys, i have two media tablets same hardware same driver. One is working proper and the other one is not able to associate with my ssid. the debug out shows the follow: *dot1xMsgTask: Feb 06 14:51:25.007: a8:54:b2:00:8b:34 Starting key exchange
-
Yosemite setup, migration assistants and timemachine restore didn't transfer ANY files to SSD
Hi, I'm at a total loss after 2 days of trying to upgrade my hard disk to an SSD in my Macbook Pro. I have tried Yosemite Setup assistant, the Migration Assistant in Utilities and Restore from Time Machine. All 3 processes run for 5 hours and say the