Dbx check -access

When trying to run a simple program that connects to our database, we get errors when turning on memory access checking in dbx. This simple program:
exec sql include sqlca;
int main(int argc, char *argv[])
exec sql begin declare section;
char pwd[] = "user/pass@database";
exec sql end declare section;
exec sql connect :pwd;
return 0;
compiles and runs just fine, even in the debugger. But when access checking is turned on (check -access), read from unallocated memory errors are reported in various places in libclntsh.so. If we suppress these errors, then it ultimately causes a seg fault. Turning on memory usage checking (check -memuse) operates without issue. We could really benefit from being able to turn on memory access checking, but it seems that our libclntsh.so has some problems.
We are running Oracle 11.2 on Solaris 5.10.
Edited by: 808333 on Nov 8, 2010 9:51 AM

Thanks for the response! Here's the info. The SEGV happens once I rerun the program after entering the following command: (dbx) suppress rua in libclntsh.so.11.1
1) Sparc
2) 32-bit
3)
libclntsh.so.11.1 => /opt/oracle/oracle_11.2_client_32bit/lib//libclntsh.so.11.1
libc.so.1 => /usr/lib/libc.so.1
libnnz11.so => /opt/oracle/oracle_11.2_client_32bit/lib//libnnz11.so
libkstat.so.1 => /usr/lib/libkstat.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libresolv.so.2 => /usr/lib/libresolv.so.2
libgen.so.1 => /usr/lib/libgen.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libsched.so.1 => /usr/lib/libsched.so.1
librt.so.1 => /usr/lib/librt.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.2 => /usr/lib/libm.so.2
libmp.so.2 => /usr/lib/libmp.so.2
libmd.so.1 => /usr/lib/libmd.so.1
libscf.so.1 => /usr/lib/libscf.so.1
libdoor.so.1 => /usr/lib/libdoor.so.1
libuutil.so.1 => /usr/lib/libuutil.so.1
/platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
/lib/libm/libm_hwcap1.so.2
4)
[1] 0xc1d23e94(0x5de80, 0x53fc, 0xe93317a0, 0x1000, 0x0, 0x0), at 0xc1d23e94
[2] kgeade(0x5de80, 0x653c8, 0xe92ab2f8, 0x53fc, 0x1, 0xffbfc9c8), at 0xe7fc65e8
[3] kgeric1(0x5de80, 0x0, 0x42cc, 0x1044, 0x5dfa8, 0x12fdd58), at 0xe7fc3bd0
[4] kgherror(0x5de80, 0x646a0, 0x42cc, 0x0, 0x19e8, 0xe91983f0), at 0xe7f81404
[5] kghini(0x5de80, 0x646a0, 0x1028, 0x102f, 0x50, 0x8000), at 0xe7f84ad8
[6] kpuinit0(0xffbfd93c, 0x400, 0x5de80, 0x646a0, 0xe90993f0, 0x4), at 0xe752fef4
[7] kpuinit(0xffbfd93c, 0x0, 0x0, 0x0, 0x0, 0xe7531f50), at 0xe752eea0
[8] OCIEnvInit(0xffbfd93c, 0x0, 0x0, 0x0, 0x1fe4ab4, 0x1508), at 0xe7367c48
[9] sqgctx(0xe90820c0, 0xffbfd9a4, 0xffbfdad4, 0x1, 0x0, 0xe9082104), at 0xe729f53c
[10] sqgrct(0x0, 0x5091, 0xffbfdad4, 0x122, 0x0, 0xe93226d4), at 0xe729f3e4
[11] sqlcmex(0x50, 0xffbfda68, 0xe90820e4, 0x10ecc, 0xe93226d4, 0x10ece), at 0xe729adac
[12] sqlcxt(0x63, 0x210dc, 0xffbfdad4, 0x10ecc, 0x5091, 0x0), at 0xe729b2fc
[13] main(argc = , argv = ) (optimized), at 0x10e9c
5)
0x00010e9c: main+0x0124: call sqlcxt [PLT] ! 0x20fa0
0x00010ea0: main+0x0128: clr %o0
0x00010ea4: main+0x012c: ret
0x00010ea8: main+0x0130: restore %g0, 0, %o0
0x00010eac: _init             :          save     %sp, -96, %sp
0x00010eb0: _init+0x0004:          ta        %icc,0x00000006
0x00010eb4: _init+0x0008:          ret
0x00010eb8: _init+0x000c:          restore
0x00010ebc: _fini            :          save      %sp, -96, %sp
0x00010ec0: _fini+0x0004:          ret
Edited by: brandon on Nov 9, 2010 2:10 PM

Similar Messages

  • Dbx check -access report wua when call vsnprintf

    I don't undertand WHY I would get this "Write to unallocated (wua)" error? I tried purify, purify does NOT report this error.
    #include <stdio.h>
    #include <stdarg.h>
    int write(char* buffer,const char* format, ...)
    va_list vlist;
    va_start(vlist,format);
    printf("Buffer Address at %x\n", &buffer[0]);
    int size = vsnprintf(&buffer[0], 2, format, vlist);
    va_end(vlist);
    return 0;
    int main()
    char* buffer = new char[2]; *// if I use char buffer[2] instead of new char[2], I won’t get this error report!*
    printf("Buffer Address at %x\n", buffer);
    write(buffer,"%s\n", "xujian");
    return 0;
    CC -g -o test test.cpp
    -bash-3.00$ dbx ./test
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.7' in your .dbxrc
    Reading test
    Reading ld.so.1
    Reading libCstd.so.1
    Reading libCrun.so.1
    Reading libm.so.2
    Reading libc.so.1
    (dbx) check -access
    access checking - ON
    (dbx) run
    Running: test
    (process id 21660)
    RTC: Enabling Error Checking...
    RTC: Running program...
    Reading disasm.so
    Buffer Address at 80672a8
    Buffer Address at 80672a8
    Write to unallocated (wua):
    Attempting to write 1 byte at address 0x80672aa
    which is just past heap block of size 2 bytes at 0x80672a8
    This block was allocated from:
    *[1] operator new() at 0xecd06887*
    *[2] operator new[]() at 0xecd05bdd*
    *[3] main() at line 23 in "test.cpp"*
    stopped in write at line 15 in file "test.cpp"
    *15 int size = vsnprintf(&buffer[0], 2, format, vlist);*
    (dbx)
    Edited by: jianxu1 on Jan 19, 2010 1:49 AM

    jianxu1 wrote:
    Thanks, MaximKartashev~, Yes, I am on x86.
    BTW, I noticed that bcheck(dbx check -access) is much much slower than purify~~ -:(Yes, Purify does not impact performance anywhere near as much as bcheck does.
    Also, the behavior you're seeing seems consistent with trying to write the seven bytes of the string "xujian" into a two-byte buffer allocated from the heap. If you make that string more than 8 characters long, you should see Purify start to complain, too.
    That's because malloc() (which the new operator uses), per the man page, "returns a pointer to a block of at least size bytes suitably aligned for any use." That phrase "suitably aligned for any use" effectively means that malloc()'d memory comes in 8-byte chunks. So even though you're asking for two bytes, you're getting a pointer to an eight-byte chunk. Ask for 9, and you'll get 16.
    Your "char buffer[2];" variant doesn't get any errors from bcheck because bcheck doesn't do any run-time checking of automatic or stack variables. Purify should. I am somewhat surprised Purify doesn't give you an "array bounds write" (ABW) error on the "char buffer[2];" variant of your test case. Perhaps Purify has problems handling varargs and automatic variables. You may want to file a bug on Purify for that. FWIW, if you declare "char buffer[2]" and then try something like
    char buffer[ 2 ];
    strcpy( buffer, "ThisIsALongString" );Purify should give you an ABW for that.

  • HTML links from Full Check Accessibility report do not open the corresponding PDF links

    I regularly generate full Check accessibility reports for the PDF user guides I create in MSWord. However, when I click the links in the HTML file/report generated, they are supposed to link/highlight the corresponding errors in the PDf file. Instead, I get an error message that "There was an error opening this document. Bad parameters."
    How can I get the links to work so I know which section in my PDF has the error (inaccessible items).
    Thanks

    I understand you are creating HTML reports and then using them to find errors/view the PDFs. 
    Is this a new problem or  have you always had problems with the links?  If it's a new problem, what has changed on your system?
    Can you view other PDFs in your browser? 
    Have you moved any of the files since you created the report -- as you may know the HTML report references a specific lcoation on your hard drive and if you moved the PDF after creating the report, it may not be able to find the file.

  • Is it possible to use Acrobat 9 sdk to check accessibility?

    Is it possible to use Acrobat 9 sdk to check accessibility of a pdf and get whether the pdf is accessible or not?
    I've found InvokeAccessibilityCheckerCmdSnip.cpp that seems to call accessibility validator, but I don't know if that will make what I need.
    I've been asked to include an accessibility validation utility in a Content Server after loading a pdf.
    Thanks in advance.

    Post your question in the 'Acrobat Developers SDK' forum.

  • Duplicate check: access ID of current business partner

    Hello,
    we're using BADI ADDRESS_SEARCH to perform duplicate check of business partners in CRM 7.0.
    Some relevant address fields are passed to method ADDRESS_SEARCH (e.g. city, country, ...), however, not the partner ID or the GUID of the business partner.
    Is there any chance to access the currently processed business partner from inside the BADI method? The former (CRM 4.0, 5.0) BDT function modules "BUPMEMORY" don't work any more.
    The thing is that we need to control the duplicate check based on several BP attributes like grouping, BP role, and so on.
    Kindly consider that we're not in the IC (interaction center) but in the CRM web client (role SALESPRO)
    Many thanks for any help & kind regards
    Wolfgang

    Hi,
    One way is to enhance the custom controller of the BP_HEAD component, add a new attribute e.g., BP No or GUID and set its value on submitorenter event or save event and inside the BADI retrieve the custom controller reference to fetch the BP No or GUID.
    Regards
    Prasenjit

  • How to check accessibility in Workspace before ModifyRepositoryFileBQY?

    How can I test, if a report is accessable in the Workspace before I execute the methode ModifyRepositoryFileBQY of an Embedded Bowser?
    thanks
    Jens
    Edited by: user10547262 on 01.07.2009 04:50

    Where is the check for null? I don't see anything?
    EL is a "null-safe" language, which means that even if a null is encountered there won't be any exception, the expression will either evaluate to false or empty or 0 depending on what you're using it for.
    "To check for null explicitly, use either the empty operator, or compare the expression to null using == or the is keyword, like this:
    <c:if test="${a.b is null}">
    <c:if test="${empty a.b}">
    <c:if test="${a.b == null}">
    Quoted from: http://java.sun.com/developer/EJTechTips/2004/tt0126.html

  • Check access on page that inherit security

    Hi,
    I'm building a dynamic menu which needs to render a page_group with all his pages and subpages. I want to implement security in such a way that only pages are shown wherefore the current logged-in user has manage rights for.
    Currently I have 2 pages and each page has a subpage:
    Page 1
    ->Page 1.1
    Page 2
    ->Page 2.1
    On page 1 and 2, I specify access settings (grant a group to access these) and the subpages of both pages will inherit these access settings from there parent pages (respectively page 1 and 2).
    If I check whether a user (that belongs to the above mentioned group) has access to Page 1 or Page 2, the result is TRUE. (using wwsec_api.has_privilege)
    When I check whether a user has access to a subpage of page 1 or page 2, the result is FALSE, although they must inherit the access settings configured on there parent pages.
    My question now is: is there a function available which checks the access settings on pages that inherit these? If not, how can I easily implement this requirement.
    Thanks in advance,
    Koen

    > I am working with php so it constantly needs to be
    uploaded and checked
    > for
    > bugs.
    Why not do that locally?
    > And to top it all off i am not the only one working on
    the project, hence
    > the
    > checkin/out.
    All the more reason to do it locally. Can you install Apache
    or are you on
    a Mac?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "strubester" <[email protected]> wrote in
    message
    news:fn7u3f$kcr$[email protected]..
    > Well my situation is this:
    >
    > I am working on a test server (basically) and so there
    is no worry about
    > pushing stuff live accidentally because the whole site
    is not live.
    >
    > I am working with php so it constantly needs to be
    uploaded and checked
    > for
    > bugs.
    >
    > And to top it all off i am not the only one working on
    the project, hence
    > the
    > checkin/out.
    >
    > I dont shut down my computer.
    >
    > Case to case this *OPTION* of checking in on close may
    not be the best
    > situation, but thats why it is an *OPTION* - something
    that adobe
    > (macromedia)
    > has not even provided.
    >
    > I feel that the absence of even an option for this
    effect means the
    > software
    > is lacking.
    >
    > If you have a better method of development, i am all
    ears.
    >

  • Check access of Sale organization

    Dear Expert,
          Is it possible to check user sales organization level access when i am execute the Z report.
         Thankx,
    Denish Patel

    You can use the Authority Object V_VBAK_VKO.
    Like:
          AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'   
               ID 'VKORG' FIELD VBAK-VKORG      
               ID 'VTWEG' FIELD VBAK-VTWEG      
               ID 'SPART' FIELD VBAK-SPART      
               ID 'ACTVT' FIELD DUMMY.       
    Regards,
    Naimesh Patel

  • Firefox is already running. "Check access rights" - Read Only, revert back and selected automatically!

    I Have follow the steps releated issue "Firefox is already running, but not responding. To open a new window, you must first close the existing Firefox process, or restart your system".
    However, issue is solved for sometimes by following steps (1 & 2) but the issue created again. Regarding step 5, I cannot applied it, because when I uncheck "Read Only" it revert back again!!
    Please advise.
    Note:
    We are running the Firefox through Citrix XenApp Presentation 4.5.
    Thank you

    Do you get that all the time or only if you close Firefox and want to restart Firefox?
    See also:
    * "Hang at exit": http://kb.mozillazine.org/Firefox_hangs
    * "Firefox hangs when you quit it": https://support.mozilla.org/kb/Firefox+hangs
    *http://kb.mozillazine.org/Profile_in_use
    *https://support.mozilla.org/kb/Firefox+is+already+running+but+is+not+responding

  • Dbx rtc shared memory check

    Hi!
    There are two programs (server + client ) which are interconnected via shared mem.
    When Im trying to check client program with dbx( -C and check -access ), server is always dumping core in protocol classes of shmem and client is hanging on handshaking procedure. Is there is any way to disable DBX RTC(access checks ) to put traps or mark somehow the shared memory which is used by client program ?

    Hi Leonard!
    Threre is the problem with sources and stuff for server binary - it is "third side" software with no syms at all. so the core file is quite useless.
    Ive found out the way to run correctly with server and mem access check - it is all about servers parameters about places(addr + page size rounding) of shmem and also Ive figured out another problem - there is an errors in server logs for semaphors and shmem lock calls. It looks like dbx is trapping whole mmap area from client.
    Im still on investigation so I will post any usefull results here.
    btw, skippatch is working quite strange actually...
    Here is an example:
    %dbx -C ./some_binary
    (dbx)modules > ./loaded_modules
    do some preparation stuff with output files so the file should looks like this( Ive ran with sed ):
    rtc skippatch wait3.o
    rtc skippatch wait4.o
    rtc skippatch waitid.o
    rtc skippatch waitpid.o
    rtc skippatch walkstack.o
    (dbx)check -access
    (dbx) <copy/paste prepared file >
    (dbx)run
    theoretically, RTC should not work at all just because generated and pasted file contains all objects and librarys which is used by target binary.
    but actually, RTC is patching and working as usual.
    ps. 5.10 Generic_138888-01 sun4u sparc SUNW,Netra-T12 with dbx 7.7 ( from sunstudio 12.1 ).
    pps. Ive read your short HOWTO about DBX RTC usage from the blog - very useful! Tommorow I will try to go with LD_AUDIT option.

  • Studio 12 DBX  internal error while memcheck is on.

    bash-3.00$ dbx -xexec32
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.6' in your .dbxrc
    (dbx) -rwxr-xr-x 1 orbit osgrp1 1.2M Dec 26 17:18 <my_processnmae>
    -rwxr-xr-x: not found
    (dbx) dbxenv mt_sync_tracking off
    (dbx) attach 6792 <this is pid>
    Reading <my_processname>
    Reading ld.so.1
    Reading librtc.so
    Reading libmapmalloc.so.1
    Reading libcurses.so.1
    Reading libnsl.so.1
    Reading libsocket.so.1
    Reading libelf.so.1
    Reading libcrypt_i.so.1
    Reading libpthread.so.1
    Reading libdl.so.1
    Reading librt.so.1
    Reading libc.so.1
    Reading libgen.so.1
    Reading libaio.so.1
    Reading libmd5.so.1
    Reading libc_psr.so.1
    Reading library_name**
    Reading library_name**
    Attached to process 6792 with 3 LWPs
    t@1 (l@1) stopped in soaccept at 0xff040314
    0xff040314: soaccept+0x0004: ta %icc,0x00000008
    Current function is Tcp_receive
    284 if ((th_data->sockfd = accept (sockfd, (struct sockaddr *)&clientaddr,&length)) == -1)
    (dbx) check -access
    access checking - ON
    RTC: Enabling Error Checking...
    RTC: Running program...
    (dbx) cont
    RTC: internal RTC error -- disabling Error Checking file: rtc_heap_map.c line: 697
    ^Ct@2 (l@2) signal INT (Interrupt) in ___sigtimedwait at 0xff040220
    0xff040220: ___sigtimedwait+0x0004: ta %icc,0x00000008
    Current function is sig_thr
    1256 sigwait (&glb_sigact, &signal_alr);
    (dbx) version
    Machine hardware: sun4u
    OS version: 5.10
    Processor type: sparc
    Hardware: SUNW,Sun-Fire-280R
    The following components are installed on your system:
    Sun Studio 12
    Sun Studio 12 C Compiler
    Sun Studio 12 C++ Compiler
    Sun Studio 12 Tools.h++ 7.1
    Sun Studio 12 C++ Standard 64-bit Class Library
    Sun Studio 12 Garbage Collector
    Sun Studio 12 Fortran 95
    Sun Studio 12 Debugging Tools (including dbx)
    Sun Studio 12 IDE
    Sun Studio 12 Debugger GUI
    Sun Studio 12 Performance Analyzer (including collect, ...)
    Sun Studio 12 X-Designer
    Sun Studio 12 VIM editor
    Sun Studio 12 XEmacs editor
    Sun Studio 12 Performance Library
    Sun Studio 12 LockLint
    Sun Studio 12 Building Software (including dmake)
    Sun Studio 12 Documentation Set
    Sun Studio 12 /usr symbolic links and GNOME menu item
    version of "/opt/SunStudio12/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.9 SunOS_sparc 2007/05/03
    version of "/opt/SunStudio12/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.9 SunOS_sparc 2007/05/03
    version of "/opt/SunStudio12/SUNWspro/bin/../prod/bin/../../bin/f90": Sun Fortran 95 8.3 SunOS_sparc 2007/05/03
    version of "/opt/SunStudio12/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.6 SunOS_sparc 2007/05/03
    version of "/opt/SunStudio12/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Analyzer 7.6 SunOS_sparc 2007/05/03
    version of "/opt/SunStudio12/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.8 SunOS_sparc 2007/05/03
    any Idea ?
    am i doing something wrong here. ? I want to check memory leak. ?
    -Raxit

    With hope if its bug, below may helpful.
    (dbx) (dbx) (dbx) quit
    detaching from process 6792
    dbx: internal warning: function (__rtc_release_heap_region) called too early (preloading)
    t@3 (l@3) signal SEGV (no mapping at the fault address) in _sleep at 0xff0330f0
    0xff0330f0: _sleep+0x0078:      ldsb     [%o3 - 3005], %o2
    Current function is scansessionisam_thr
    1362 sleep (cfg_sec_shm_scantime); /*SCF no 10750 */
    execution completed, exit code is 4982056
    dbx: internal warning: rtc: _syscall: failed
    dbx: warning: librtc.so and dbx version mismatch; Error checking disabled
    Check your installation of librtc.so.
    dbx: internal warning: rtc: munmap of patch area of segment '/usr/lib/libmapmalloc.so.1' failed
    dbx: internal error: signal SIGSEGV (no mapping at the fault address)
    dbx's coredump will appear in /tmp
    ls -lrAbort (core dumped)
    bash-3.00$ pstack /tmp/core
    core '/tmp/core' of 6794: dbx -xexec32
    ff1c0f90 lwpkill (6, 0, ff1a4a98, ffffffff, ff1e8284, 6) + 8
    ff13ff98 abort (0, 1, 377d74, a83f0, ff1eb298, 0) + 110
    000b5bf8 ???????? (b, 3c4400, 4575a1, 38b1f4, 37eabe, 1)
    ff1bfec8 __sighndlr (b, ffbff408, ffbff150, b59ec, 0, 1) + c
    ff1b4ff4 call_user_handler (b, 0, 8, 0, ff252000, ffbff150) + 3b8
    001aef98 __1cGRtcMgrShandle_proc_detach6M_v_ (47d670, 5dd2a8, 38, 396000, 4c0498, 38) + d8
    0018f850 __1cEProcGdetach6Mbbbb_v_ (4c0468, 467400, 466400, 0, 3ae2ac, 0) + 19c
    000b8c68 ???????? (47e6f8, 0, 0, 0, 0, 1)
    00289d94 __1cMpdksh_c_exit6FpnGInterp_ippcpv_i_ (47e6f8, 0, 876890, 0, 0, 466000) + a8
    0015fbf4 ???????? (47e6f8, 1, 876890, 0, 877b78, 0)
    002857a0 ???????? (47e6f8, 877b78, 877b58, 876890, 0, 467708)
    0028468c __1cNpdksh_execute6FpnGInterp_pnCop_i_i_ (47e6f8, 49bab8, 0, 277c50, 47e6f8, 38b1f4) + 194
    002735e0 __1cLpdksh_shell6FpnGInterp_pnGSource__i_ (47e6f8, 49e098, 465628, 446f54, 3d9625, 3d962c) + 46c
    000b90d4 __1cNmain_cmd_loop6FpnGInterp__v_ (47e6f8, 37f400, 3ca2a4, 446f70, 3ca000, 3ca000) + 88
    000b9e60 main (37e400, 0, 40, 47e6f8, 37f7c8, 1) + 750
    000af268 _start   (0, 0, 0, 0, 0, 0) + 108
    bash-3.00$
    bash-3.00$ dbx /opt/SunStudio12/
    SUNWspro/ uninstall_Sun_Studio_12.class
    bash-3.00$ dbx /opt/SunStudio12/SUNWspro/bin/dbx /tmp/core
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.6' in your .dbxrc
    Reading dbx
    core file header read successfully
    Reading ld.so.1
    Reading libintl.so.1
    Reading libnsl.so.1
    Reading libsocket.so.1
    Reading libdl.so.1
    Reading libgen.so.1
    Reading libw.so.1
    Reading libm.so.1
    Reading libc.so.1
    Reading libc_psr.so.1
    Reading libcpc.so.1
    Reading libpctx.so.1
    Reading libnvpair.so.1
    Reading libdevinfo.so.1
    Reading libproc.so.1
    Reading librtld_db.so.1
    Reading libelf.so.1
    Reading libctf.so.1
    program terminated by signal ABRT (Abort)
    0xff1c0f90: __lwp_kill+0x0008: bcc,a,pt %icc,__lwp_kill+0x18 ! 0xff1c0fa0
    (dbx) threads
    dbx: thread related commands not available
    (dbx) where
    =>[1] __lwp_kill(0x0, 0x6, 0x0, 0x6, 0xfc00, 0x0), at 0xff1c0f90
    [2] raise(0x6, 0x0, 0xff1a4a98, 0xffffffff, 0xff1e8284, 0x6), at 0xff15fd78
    [3] abort(0x0, 0x1, 0x377d74, 0xa83f0, 0xff1eb298, 0x0), at 0xff13ff98
    [4] 0xb5bf8(0xb, 0x3c4400, 0x4575a1, 0x38b1f4, 0x37eabe, 0x1), at 0xb5bf8
    [5] __sighndlr(0xb, 0xffbff408, 0xffbff150, 0xb59ec, 0x0, 0x1), at 0xff1bfec8
    ---- called from signal handler with signal 11 (SIGSEGV) ------
    [6] RtcMgr::handle_proc_detach(0x47d670, 0x5dd2a8, 0x38, 0x396000, 0x4c0498, 0x38), at 0x1aef98
    [7] Proc::detach(0x4c0468, 0x467400, 0x466400, 0x0, 0x3ae2ac, 0x0), at 0x18f850
    [8] 0xb8c68(0x47e6f8, 0x0, 0x0, 0x0, 0x0, 0x1), at 0xb8c68
    [9] pdksh_c_exit(0x47e6f8, 0x0, 0x876890, 0x0, 0x0, 0x466000), at 0x289d94
    [10] 0x15fbf4(0x47e6f8, 0x1, 0x876890, 0x0, 0x877b78, 0x0), at 0x15fbf4
    [11] 0x2857a0(0x47e6f8, 0x877b78, 0x877b58, 0x876890, 0x0, 0x467708), at 0x2857a0
    [12] pdksh_execute(0x47e6f8, 0x49bab8, 0x0, 0x277c50, 0x47e6f8, 0x38b1f4), at 0x28468c
    [13] pdksh_shell(0x47e6f8, 0x49e098, 0x465628, 0x446f54, 0x3d9625, 0x3d962c), at 0x2735e0
    [14] main_cmd_loop(0x47e6f8, 0x37f400, 0x3ca2a4, 0x446f70, 0x3ca000, 0x3ca000), at 0xb90d4
    [15] main(0x37e400, 0x0, 0x40, 0x47e6f8, 0x37f7c8, 0x1), at 0xb9e60
    (dbx)
    -Raxit

  • Runtime memory checking - freezes program from the start

    We'd very much like to use Forte to check a program for memory leaks. When it runs from the GUI invocation it seems to freeze up during init'ing. I discovered "bcheck", and tried it as well (See below), but once again it seems not to be talking to the proc it's intended to, and nor does the log show anything, so it seems to freeze as well.
    Any clues on how we move on from here?
    bash-2.03$ bcheck -all -o l.log longlife -port=20020 &
    [4] 23702
    bash-2.03$ Reading longlife
    Reading ld.so.1
    Reading librtc.so
    Reading libretriever.so
    Reading libdl.so.1
    Reading libsocket.so.1
    Reading libnsl.so.1
    Reading libpthread.so.1
    Reading libCrun.so.1
    Reading libm.so.1
    Reading libw.so.1
    Reading libthread.so.1
    Reading libc.so.1
    Reading libz.so.1
    Reading libmp.so.2
    Reading libc_psr.so.1
    detected a multithreaded program
    access checking - ON
    memuse checking - ON
    Running: longlife -port=20020
    (process id 23714)

    I am seeing something similar, trying to debug a multithreaded app.
    Reading libsocket.so.1
    Reading libnsl.so.1
    Reading libdl.so.1
    Reading librt.so.1
    Reading libpthread.so.1
    Reading libresolv.so.2
    Reading libc.so.1
    Reading libCrun.so.1
    Reading libmp.so.2
    Reading libaio.so.1
    Reading libw.so.1
    Reading libc_psr.so.1
    Reading libthread.so.1
    detected a multithreaded program
    (/opt/SUNWspro/bin/../WS6U1/bin/sparcv9/dbx) check -access
    access checking - ON
    (/opt/SUNWspro/bin/../WS6U1/bin/sparcv9/dbx) run
    Running: <>
    (process id 24424)
    RTC: Enabling Error Checking...
    And it just sits there.truss -p 24419
    write(9, "\0\0\0\0\0\0\003", 8) (sleeping...)
    pstack 24419
    24419: /opt/SUNWspro/bin/../WS6U1/bin/sparcv9/dbx -C /tmp/awz/bin/nsd8x
    ffffffff7e5a1f40 write (9, 1010e79a0, 8)
    00000001001e18f8 __1cEPCmdKflush_help6M_v_ (1010e6990, 3, 0, 0, 0, 0) + 19c
    00000001001e1640 __1cEPCmdFflush6M_i_ (1010e6990, 3, 400000000, 0, 0, ffffffff7fffdc51) + 2c
    00000001001e66d8 __1cFPcsPDEwait6MpnDLwp__b_ (10054516b, 100543ae8, 1010e6990, 0, 0, 0) + 110
    00000001001f69b0 __1cEProcEwait6M_v_ (1005f5fd0, 1, 54ac00, 54aef4, 100000000, 0) + c4
    00000001001fdaec __1cEProcCgo6MpnEVCpu_nGProcGo_b_v_ (0, ffffffffffffffff, 3, 0, 1005f5fd0, 1012121d0) + 500
    00000001001056a8 __1cHCallMgrEcall6MpnMActiveEntity_pnDFun_pnICallArgs_pnHRetRegs_I_b_ (100547278, 100998df7, 0, 1005f5fd0, 0, 0) + 658
    000000010021da8c __1cIRtcMgr_tIcallproc6MpnDFun_pnICallArgs_pnHRetRegs_b_b_ (0, 0, 100628610, 1006280c0, 101210f30, 101211130) + 31c
    000000010021de14 __1cIRtcMgr_tNcheck_uncheck6MLLb_v_ (1005f6ea0, 1858c0, 80, 0, 0, 0) + 184
    000000010021aa2c __1cIRtcMgr_tWinit_uncheck_func_list6M_v_ (10062ee20, 1, 0, ab4, 1005f26f0, 1005519ab) + 29c
    0000000100214404 __1cIRtcMgr_tPrtc_new_process6M_v_ (10111d190, 1005141f8, 0, 100551922, 50430001, 4c455645) + 72c
    0000000100212c54 ???????? (1005f5fd0, 10111cf50, 0, 10111cf50, 1, 0)
    00000001000ec138 __1cSActionList_execute6FpnEList4nGAction___pnEProc_pnHHandler_pnJEventInst_nHLevel_e__v_ (100b2ecc0, 1005f5fd0, 101121be0, 10111cf50, 1, 54494400) + 4c
    0000000100188d84 __1cHHandlerSdecision_procedure6MpnEProc__v_ (101121be0, 1005f5fd0, 54ac00, 54aef4, 100000000, 101122693) + 168
    000000010020a9e0 __1cKRecognizerHtrigger6M_v_ (101121be0, 10111cf50, fe92e7a0, 10051e438, 0, 101122690) + 138
    000000010020afb0 __1cKRecognizerIdispatch6F_v_ (1005e8940, 100866ef0, 0, 1010e7a40, 101122080, 0) + 6c
    00000001001fc9cc __1cEProcNvcpu_dispatch6MpnEVCpu__b_ (101122080, 1005141f8, 100866ef0, 0, 0, ffffffff7fffe821) + 37c
    00000001001fcadc __1cEProcQpervcpu_dispatch6MpnEVCpu__v_ (564400, 5646d0, 100000000, 0, 0, 0) + ac
    00000001001fd364 __1cEProcQgeneric_dispatch6MpnEVCpu__b_ (1005f5fd0, ffffffffffffffff, 0, 1010e7a40, 0, 100547d7f) + 18c
    00000001001fdb4c __1cEProcCgo6MpnEVCpu_nGProcGo_b_v_ (0, ffffffffffffffff, 1, 1, 1, 5dec00) + 560
    00000001001a3f48 __1cGdo_run6FbnHLevel_e__i_ (5d3400, 0, 1, 514000, 5141f8, 100000000) + 538
    00000001002bdec0 ???????? (0, 1002c4508, 100575f8f, 1, 1005fb098, 1005fb050)
    00000001002bcb2c __1cHexecute6FpnGInterp_pnCop_i_i_ (2, 101087df0, 0, 0, 5f63625f, 64697370) + 228
    00000001002a934c __1cFshell6FpnGInterp_pnGSource__i_ (1000df06c, 1005748a0, 0, 1005fb2d0, 1005fb2c8, 1) + 5b0
    00000001000e48fc __1cNmain_cmd_loop6FpnGInterp__v_ (1005fb050, 530f80, 1, 0, 0, ffffffff7ffff0d0) + fc
    00000001000e5cb4 main (1, 0, 1, 504800, 504918, 100000000) + db8
    00000001000db2bc _start (0, 0, 0, 0, 0, 0) + 17c
    I am too lazy to run this through dem.

  • 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.

  • Views Status at MARA general info segment level

    Hi all,
    Please guide me how to maintain Views Status at MARA general info segment level.I am extending standard MATMAS IDOC for my own fields.
    Thank you.

    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.

  • Tools for root cause analysis of stack corruption?

    I'm experiencing extremely rare stack corruption that results in SEGV core dumps for a large and complex C++ program. Having run all the standard tools such as IBM Rational Purify, Sun mdb/libumem and dbx/rtc (although unfortunately using dbx check -access takes inordinately long and eventually crashes before the main() function is executed), I am no closer to discovering the root cause of the stack corruption. I'm confident based on the tools run and on the stack trace from the core dump that the problem is not heap corruption, but stack corruption.
    The environment is Sun Studio 12 (but not update 1) on Solaris 10 on SPARC. The program is compiled with minor optimisation (-xO2 -xbuiltin=%all).
    Is anyone aware of other tools or approaches that could help pinpoint the problem? Your help would be much appreciated!
    Thanks in advance,
    Simon

    If you are in fact having stack corruption issues, I don't think any of the tools you mentioned other than Purify would help you identify it.
    You may also be simply running out of stack space, and not having corruption issues. Is your app multi-threaded? If so, you could increase the stack size your threads use to something larger than the default.
    Another thing you can look for are syslog entries stating "no swap space to grow stack" for your process, you've run out of virtual memory. To avoid this, you can "pre-allocate" your stack memory with code similar to this:
    void growStack( size_t bytes )
        char *mem = ( char * ) alloca( bytes );
        memset( mem, 0, bytes );
        return;
    }That code, when called, will force the creation of stack memory virtual pages backed by swap, before your server gets into a situation where free memory might be in short supply.
    I also seem to recall that Solaris under certain circumstances will allocate stack memory with the MAP_NORESERVE option, which means swap space won't be reserved for your stack. If your process gets swapped out, its stack(s) will be lost and you'll probably get a SIGSEGV or SIGBUS. See this bug:
    [http://bugs.opensolaris.org/view_bug.do?bug_id=1221729|http://bugs.opensolaris.org/view_bug.do?bug_id=1221729]
    I remember working a similar issue for a customer running large apps on Sun E15Ks, maybe about 5 years ago. To work around this behavoir, I think you'll need to explicitly allocate stack memory for any threads you may be creating. I think that's what we had to do.

Maybe you are looking for

  • Can't download file from iCloud

    Hello. I can't download my Keynote project from iCloud. What do i need to do? Help, please!

  • Searching in Calendar

    If I am looking for a calendar entry I've made on my iPhone but can't remember where it is (which day), how does one search within this function? There is no "search" mechanism that I can find. There must be an easier way to locate rather than scroll

  • What's Mobile Me? Forgive stupid question

    What's Mobile Me, and do I need it? Please forgive a stupid question.

  • Lauching photoshop(different problem)

    Hi! I managed to install photoshop cs3 on my computer, but when i try to launcg it, i have a problem. It says that the application adobe photoshop cs3 quit unexpectedly. When i click on relaunch, the window just keep popping back. What am i supposed

  • Enable the Bluetooth stack in vista for communicat​ion in LabVIEW

    hi i am finding problems in the detection of the Bluetooth by the LabVIEW. i have searches on it and i need to enable the bluetooth stack. how can i enable the bluetooth stack in Vista? Somil Gautam Think Weird