- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- COBOL, C and C++ Memory Allocation Failure
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2009 05:00 PM
тАО04-23-2009 05:00 PM
COBOL, C and C++ Memory Allocation Failure
Using COBOL program as main program, a C program and a C++ program are called (which also calls the C program). Development of calling interface is nearly completed with successful use of WEBSphere MQ. The C++ program makes heavy use of Apache DOM for creating XML.
STR$COPY_DX fails with access violation or produces unpredictable results other times when called from C program. Not using any special options with the CXXLINK command but suspect answer may be in this area.
Help! To borrow from the old Notes ID, I'm driving a 57 accvio.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2009 05:51 PM
тАО04-23-2009 05:51 PM
Re: COBOL, C and C++ Memory Allocation Failure
Verify the validity of the descriptors being passed to the call using the debugger.
And verify that there have been no modifications to any dynamic descriptors.
Do some debugging, and try to reproduce the error in the debugger. And see what's going on with the arguments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2009 05:34 AM
тАО04-25-2009 05:34 AM
Re: COBOL, C and C++ Memory Allocation Failure
There is less than 1k of data being passed.
Of course I have been in the debugger for hours with this problem and have found replacing STR$COPY_DX with my own manual building and loading of the string descriptor is working but would like to understand why this is necessary because I am concerned this may be pointing to other issues not yet encountered.
Even though member alignment is turned off in C (it is turned off by default in COBOL), an EXAMINE/ASCID shows the correct string in C in the debugger but there is sometimes extra garbage at the end of the string when exmined in COBOL. The string is passed BY DESCRIPTOR in COBOL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2009 06:13 AM
тАО04-25-2009 06:13 AM
Re: COBOL, C and C++ Memory Allocation Failure
(You've described a whole lot of "moving parts" in this source code, too; some rather significant and complex pieces and parts. And some significant recent changes. More than enough to make even guessing difficult. And these errors can be obscure. That you have a specific call failing reliably is certainly very useful, though.)
There's clearly some sort of a heap or stack error here, or a descriptor mismatch. The descriptor you have referenced clearly has issues between the C and the COBOL environments.
FWIW: if you're working with a dynamic descriptor that's been allocated storage, the contents of that dynamic descriptor should not typically be written directly by application code; write access should only be via the RTL calls.
As for a path forward, look at the contents of the descriptor data structure that arrives, and at the Calling Standard manual, and at the COBOL requirements. Mixed language programming usually involves looking at these documents and at example code (eg: COBOL to COBOL) to see what a calling or called routine expects or uses.
That the code has worked for years without errors is certainly interesting, but that does not preclude the existence of latent errors. I'm aware of bugs two and three times the age of this code, and in commonly-used code. A 30+ year old bug surfaced in yacc, for instance.
For some C debugging information, start here:
http://labs.hoffmanlabs.com/node/401
Here's what an ACCVIO really means:
http://labs.hoffmanlabs.com/node/800
And an intro to OpenVMS features and mechanisms in C programs:
http://labs.hoffmanlabs.com/node/273
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2009 11:19 AM
тАО04-25-2009 11:19 AM
Re: COBOL, C and C++ Memory Allocation Failure
Much more information is needed to determine
the cause. As a start, post the register
dump from the ACCVIO and the MAP file
for the image.
Regards,
Guy Peleg
Maklee Engineering
http://www.maklee.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2009 10:12 PM
тАО04-25-2009 10:12 PM
Re: COBOL, C and C++ Memory Allocation Failure
if the program terminates with an ACCVIO, consider to enable a process dump:
$ SET PROC/DUMP
$ RUN image...
This will - in the case of of an image exit due to an imprperly handled condition - save all of the process virtual address space in a process dumpefile (imagename.DMP) and allow you to later use ANAL/PROC to examine the static situation at the time of the ACCVIO.
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2009 06:04 PM
тАО04-27-2009 06:04 PM
Re: COBOL, C and C++ Memory Allocation Failure
Thanks for the advice.