[Info-vax] calloc fails with access violation

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Mon Aug 24 13:45:09 EDT 2009


In article <aecec9c9-3fe0-4b76-b37a-c5cd9ebf5bd3 at a13g2000yqc.googlegroups.com>, Jose Cuevas <jcuevas at mac.com> writes:
>1. We have a problem with a fairly simple library written in C that
>gets called from Cobol.
>
>The C library is used to PUSH data generated by the Cobol application
>over HTTP POST using sockets.
>
>We are getting an access violation (a crash) on calls to calloc() of
>insignificant size. While at first we thought it was on a particular
>record we then found that it is a far more inconsistent.
>
>The C code runs fine when tested on a unix machine.
>
>2. Unrelated question: if we send a variable from a record structure
>to a C function we get an access violation. So far the only workaround
>we found is to move variables to one defined at the working-storage.
>Any ideas on how to use record variables as parameters for C
>functions?

Don't post a snippet of the code which you are questioning -- hint,
hint.  

If you are calling C routines from Cobol, make certain that you are
passing the data properly.  Strings, for example, in COBOL are typ-
ically passed by DESCRIPTOR whereas C will pass references to null-
terminated byte streams.  I would expect any C code to get rather
upset if passed a string DESCRIPTOR in lieu of a reference to null-
terminated streams.

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

  http://www.quirkfactory.com/popart/asskey/eqn2.png
  
  "Well my son, life is like a beanstalk, isn't it?"



More information about the Info-vax mailing list