[Info-vax] calloc fails with access violation

JF Mezei jfmezei.spamnot at vaxination.ca
Mon Aug 24 14:56:55 EDT 2009


Jose Cuevas wrote:

> We are getting an access violation (a crash) on calls to calloc() of
> insignificant size. 

While the program is running, do a SHOW PROC/CONT/ID=xxxxx where xxxxx
is the pid of the process running your app. Monitor the virtual pages
number. It is possible that you have a memory leak and that you run out
of your pagefile quota.

You can increase it via AUTHORIZE by increasing the account's PGFLQUOTA
setting.

In terms of COBOL and C, it has been ages since I did it. Back then, a
CALL would just pass the address to the fixed length COBOL arguments.
The C program had no way to know how long they were. You just had to
code the C program with knowledge of how long they were.

You could specify CALL BY DESCRIPTOR in cobol, at which point, you would
ge the address of a descriptor structure which would contain the address
and allocated length of the argument. But back in the 290th century, "BY
DESCRIPTOR" was not the default.

As for the variabels in record structures:

What you can do is to restructure the way you define your records.

Define your record structures in working storage. And define only a
basic record structure (key and then a dummy variable for rest of
record)  In your program, you
	 READ infile INTO myworking-storage-record-definition.

This way, your data is now contained in accessible working storage
locations.



More information about the Info-vax mailing list