Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

memory leaks

Hi All,

I don't normally get a chance to read the netcdf digest
so maybe this question has been dealt with previously.
When using the new dbx that comes on the SPARCstation 20
(Solaris 2.3) with the all the memory checking capabilities
turned on (access and mem leak checks) I get complaints from
NC_incr_array().  The complaint is about the memcpy() contained
therein and involves trying to write to unallocated space
off this or that "heap block".  Obviously, it could be my
code but in my defense I have tried it on a number of simple
test examples.  I know that in this mode the debugger is
sensitive to argument lists with incorrect ptr types and
have seen it complain about usage of BSD malloc (i.e.,
malloc(unsigned)).  I also know that simply making sure
the argument matchs correctly (in the case of malloc this
would mean making sure that the arg is size_t) solves 
this particular problem. 

I notice in the source that malloc sometimes uses size_t
and sometimes not.  I also presume that sizeof() returns
size_t here since I see malloc(sizeof(NC_something)) alot.

If anybody has any suggestions they would surely be
appreciated, since they could save me a great deal
of thrashing about.  For me this is an important issue
since it makes working with this otherwise wonderful
and excellent dbx option useless.

Thanks,
Dan

-- 
Dan Hansen              | #include <standard.disclaimer>
dhansen@xxxxxxxxxxxxx   |
(303) 497-8945          |
National Center for Atmospheric Research


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690